コード例 #1
0
        /// <summary>
        /// Creates a PeptideWithSetModifications object from a sequence string.
        /// Useful for reading in MetaMorpheus search engine output into mzLib objects.
        /// </summary>
        public PeptideWithSetModifications(string sequence, Dictionary <string, Modification> allKnownMods, int numFixedMods = 0,
                                           DigestionParams digestionParams         = null, Protein p = null, int oneBasedStartResidueInProtein = int.MinValue,
                                           int oneBasedEndResidueInProtein         = int.MinValue, int missedCleavages = int.MinValue,
                                           CleavageSpecificity cleavageSpecificity = CleavageSpecificity.Full, string peptideDescription = null)
            : base(p, oneBasedStartResidueInProtein, oneBasedEndResidueInProtein, missedCleavages, cleavageSpecificity, peptideDescription)
        {
            if (sequence.Contains("|"))
            {
                throw new MzLibUtil.MzLibException("Ambiguous peptide cannot be parsed from string: " + sequence);
            }

            FullSequence = sequence;
            GetModsAfterDeserialization(allKnownMods, out _baseSequence);
            NumFixedMods     = numFixedMods;
            _digestionParams = digestionParams;

            if (p != null)
            {
                ProteinAccession = p.Accession;
            }
            if (digestionParams != null)
            {
                DigestionParamString = digestionParams.ToString();
            }
        }
コード例 #2
0
        private ProteaseDictionary()
            : base()
        {
            using (StreamReader proteases = new StreamReader(Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]), "proteases.tsv")))
            {
                proteases.ReadLine();

                while (proteases.Peek() != -1)
                {
                    string   line   = proteases.ReadLine();
                    string[] fields = line.Split('\t');

                    string              name = fields[0];
                    string[]            sequences_inducing_cleavage   = fields[1].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    string[]            sequences_preventing_cleavage = fields[2].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    Terminus            cleavage_terminus             = (Terminus)Enum.Parse(typeof(Terminus), fields[3], true);
                    CleavageSpecificity cleavage_specificity          = (CleavageSpecificity)Enum.Parse(typeof(CleavageSpecificity), fields[4], true);
                    string              psi_ms_accession_number       = fields[5];
                    string              psi_ms_name = fields[6];
                    string              site_regexp = fields[7];
                    Protease            protease    = new Protease(name, sequences_inducing_cleavage, sequences_preventing_cleavage, cleavage_terminus, cleavage_specificity, psi_ms_accession_number, psi_ms_name, site_regexp);
                    Add(protease);
                }
            }
        }
コード例 #3
0
ファイル: Protease.cs プロジェクト: cameyer6/mzLib
 public Protease(string name, CleavageSpecificity cleavageSpecificity, string psiMSAccessionNumber, string psiMSName, List <DigestionMotif> motifList)
 {
     Name = name;
     CleavageSpecificity  = cleavageSpecificity;
     PsiMsAccessionNumber = psiMSAccessionNumber;
     PsiMsName            = psiMSName;
     DigestionMotifs      = motifList ?? new List <DigestionMotif>();
 }
コード例 #4
0
 public Protease(string name, IEnumerable<string> sequencesInducingCleavage, IEnumerable<string> sequencesPreventingCleavage, Terminus cleavageTerminus, CleavageSpecificity cleavageSpecificity)
 {
     Name = name;
     SequencesInducingCleavage = sequencesInducingCleavage;
     SequencesPreventingCleavage = sequencesPreventingCleavage;
     CleavageTerminus = cleavageTerminus;
     CleavageSpecificity = cleavageSpecificity;
 }
コード例 #5
0
 public Protease(string name, string aminoAcidsInducingCleavage, string aminoAcidsPreventingCleavage, Terminus cleavageTerminus, CleavageSpecificity cleavageSpecificity)
 {
     Name                         = name;
     CleavageTerminus             = cleavageTerminus;
     AminoAcidsInducingCleavage   = aminoAcidsInducingCleavage;
     AminoAcidsPreventingCleavage = aminoAcidsPreventingCleavage;
     CleavageSpecificity          = cleavageSpecificity;
 }
コード例 #6
0
 public Protease(string name, CleavageSpecificity cleavageSpecificity, string psiMSAccessionNumber, string psiMSName, List <DigestionMotif> motifList, Modification modDetails = null)
 {
     Name = name;
     CleavageSpecificity  = cleavageSpecificity;
     PsiMsAccessionNumber = psiMSAccessionNumber;
     PsiMsName            = psiMSName;
     DigestionMotifs      = motifList ?? new List <DigestionMotif>();
     CleavageMod          = modDetails;
 }
コード例 #7
0
 internal ProteolyticPeptide(Protein protein, int oneBasedStartResidueInProtein, int oneBasedEndResidueInProtein, int missedCleavages, CleavageSpecificity cleavageSpecificityForFdrCategory, string peptideDescription = null, string baseSequence = null)
 {
     _protein = protein;
     OneBasedStartResidueInProtein = oneBasedStartResidueInProtein;
     OneBasedEndResidueInProtein   = oneBasedEndResidueInProtein;
     MissedCleavages = missedCleavages;
     CleavageSpecificityForFdrCategory = cleavageSpecificityForFdrCategory;
     PeptideDescription = peptideDescription;
     _baseSequence      = baseSequence;
 }
コード例 #8
0
ファイル: Protease.cs プロジェクト: leahvschaffer/mzLib
 public Protease(string name, IEnumerable <Tuple <string, FragmentationTerminus> > sequencesInducingCleavage, IEnumerable <Tuple <string, FragmentationTerminus> > sequencesPreventingCleavage, CleavageSpecificity cleavageSpecificity, string psiMSAccessionNumber, string psiMSName, string siteRegexp)
 {
     Name = name;
     SequencesInducingCleavage   = sequencesInducingCleavage;
     SequencesPreventingCleavage = sequencesPreventingCleavage;
     CleavageSpecificity         = cleavageSpecificity;
     PsiMsAccessionNumber        = psiMSAccessionNumber;
     PsiMsName  = psiMSName;
     SiteRegexp = siteRegexp;
 }
コード例 #9
0
 public Protease(string name, IEnumerable <string> sequencesInducingCleavage, IEnumerable <string> sequencesPreventingCleavage, Terminus cleavageTerminus, CleavageSpecificity cleavageSpecificity, string psiMsAccessionNumber, string psiMsName, string siteRegexp)
 {
     Name = name;
     SequencesInducingCleavage   = sequencesInducingCleavage;
     SequencesPreventingCleavage = sequencesPreventingCleavage;
     CleavageTerminus            = cleavageTerminus;
     CleavageSpecificity         = cleavageSpecificity;
     PsiMsAccessionNumber        = psiMsAccessionNumber;
     PsiMsName  = psiMsName;
     SiteRegexp = siteRegexp;
 }
コード例 #10
0
ファイル: Protease.cs プロジェクト: cwenger/Morpheus
 public Protease(string name, IEnumerable<string> sequencesInducingCleavage, IEnumerable<string> sequencesPreventingCleavage, Terminus cleavageTerminus, CleavageSpecificity cleavageSpecificity, string psiMsAccessionNumber, string psiMsName, string siteRegexp)
 {
     Name = name;
     SequencesInducingCleavage = sequencesInducingCleavage;
     SequencesPreventingCleavage = sequencesPreventingCleavage;
     CleavageTerminus = cleavageTerminus;
     CleavageSpecificity = cleavageSpecificity;
     PsiMsAccessionNumber = psiMsAccessionNumber;
     PsiMsName = psiMsName;
     SiteRegexp = siteRegexp;
 }
コード例 #11
0
        private readonly string ProteinAccession; // used to get protein object after deserialization

        /// <summary>
        /// Creates a PeptideWithSetModifications object from a protein. Used when a Protein is digested.
        /// </summary>
        public PeptideWithSetModifications(Protein protein, DigestionParams digestionParams, int oneBasedStartResidueInProtein,
                                           int oneBasedEndResidueInProtein, CleavageSpecificity cleavageSpecificity, string peptideDescription, int missedCleavages,
                                           Dictionary <int, Modification> allModsOneIsNterminus, int numFixedMods, string baseSequence = null)
            : base(protein, oneBasedStartResidueInProtein, oneBasedEndResidueInProtein, missedCleavages, cleavageSpecificity, peptideDescription, baseSequence)
        {
            _allModsOneIsNterminus = allModsOneIsNterminus;
            NumFixedMods           = numFixedMods;
            _digestionParams       = digestionParams;
            DetermineFullSequence();
            ProteinAccession = protein.Accession;
            UpdateCleavageSpecificity();
        }
コード例 #12
0
        public static int GetMinNumberTermini(this CleavageSpecificity cleavageSpecifity)
        {
            switch (cleavageSpecifity)
            {
            case CleavageSpecificity.None:
                return(0);

            case CleavageSpecificity.Semi:
            case CleavageSpecificity.SemiN:
            case CleavageSpecificity.SemiC:
                return(1);

            case CleavageSpecificity.Full:
            default:
                return(2);
            }
        }
コード例 #13
0
 public DigestionParams(string protease                        = "trypsin", int maxMissedCleavages = 2, int minPeptideLength = 7, int maxPeptideLength = int.MaxValue,
                        int maxModificationIsoforms            = 1024, InitiatorMethionineBehavior initiatorMethionineBehavior = InitiatorMethionineBehavior.Variable,
                        int maxModsForPeptides                 = 2, CleavageSpecificity searchModeType = CleavageSpecificity.Full, FragmentationTerminus fragmentationTerminus = FragmentationTerminus.Both,
                        bool generateUnlabeledProteinsForSilac = true)
 {
     Protease                    = ProteaseDictionary.Dictionary[protease];
     MaxMissedCleavages          = maxMissedCleavages;
     MinPeptideLength            = minPeptideLength;
     MaxPeptideLength            = maxPeptideLength;
     MaxModificationIsoforms     = maxModificationIsoforms;
     InitiatorMethionineBehavior = initiatorMethionineBehavior;
     MaxModsForPeptide           = maxModsForPeptides;
     SearchModeType              = searchModeType;
     FragmentationTerminus       = fragmentationTerminus;
     RecordSpecificProtease();
     GeneratehUnlabeledProteinsForSilac = generateUnlabeledProteinsForSilac;
 }
コード例 #14
0
ファイル: FdrClassifier.cs プロジェクト: zrolfs/MetaMorpheus
 public static FdrCategory GetCleavageSpecificityCategory(CleavageSpecificity cleavageSpecificity)
 {
     if (cleavageSpecificity == CleavageSpecificity.Full)
     {
         return(FdrCategory.FullySpecific);
     }
     else if (cleavageSpecificity == CleavageSpecificity.Semi)
     {
         return(FdrCategory.SemiSpecific);
     }
     else if (cleavageSpecificity == CleavageSpecificity.None)
     {
         return(FdrCategory.NonSpecific);
     }
     else
     {
         throw new NotImplementedException("Cleavage specificity '" + cleavageSpecificity + "' has not been immplemented for local FDR calculations.");
     }
 }
コード例 #15
0
        private ProteaseDictionary()
            : base()
        {
            using (StreamReader proteases = new StreamReader(Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]), "Configuration", "proteases.tsv")))
            {
                string header = proteases.ReadLine();

                while (proteases.Peek() != -1)
                {
                    string   line   = proteases.ReadLine();
                    string[] fields = line.Split('\t');

                    string              name = fields[0];
                    string              amino_acids_inducing_cleavage   = fields[1];
                    string              amino_acids_preventing_cleavage = fields[2];
                    Terminus            cleavage_terminus    = (Terminus)Enum.Parse(typeof(Terminus), fields[3]);
                    CleavageSpecificity cleavage_specificity = (CleavageSpecificity)Enum.Parse(typeof(CleavageSpecificity), fields[4]);
                    Protease            protease             = new Protease(name, amino_acids_inducing_cleavage, amino_acids_preventing_cleavage, cleavage_terminus, cleavage_specificity);
                    Add(protease);
                }
            }
        }
コード例 #16
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            CleavageSpecificity searchModeType = CleavageSpecificity.Full; //classic and modern by default

            if (semiSpecificSearchRadioButton.IsChecked.Value)             //semi
            {
                searchModeType = CleavageSpecificity.Semi;
            }
            else if (nonSpecificSearchRadioButton.IsChecked.Value) //non
            {
                searchModeType = CleavageSpecificity.None;
            }
            //else it's the default of full

            if (searchModeType != CleavageSpecificity.Full)
            {
                if (((Protease)proteaseComboBox.SelectedItem).Name.Contains("non-specific"))
                {
                    searchModeType = CleavageSpecificity.None; //prevents an accidental semi attempt of a non-specific protease

                    if (cTerminalIons.IsChecked.Value)
                    {
                        Protease singleC = ProteaseDictionary.Dictionary["singleC"];
                        proteaseComboBox.SelectedItem = singleC;
                    }
                    else //we're not allowing no ion types. It must have N if it doesn't have C.
                    {
                        Protease singleN = ProteaseDictionary.Dictionary["singleN"];
                        proteaseComboBox.SelectedItem = singleN;
                    }
                }
                if (!addCompIonCheckBox.IsChecked.Value)
                {
                    MessageBox.Show("Warning: Complementary ions are strongly recommended when using this algorithm.");
                }
                //only use N or C termini, not both
                if (cTerminalIons.IsChecked.Value)
                {
                    nTerminalIons.IsChecked = false;
                }
                else
                {
                    nTerminalIons.IsChecked = true;
                }
            }

            if (!GlobalGuiSettings.CheckTaskSettingsValidity(precursorMassToleranceTextBox.Text, productMassToleranceTextBox.Text, missedCleavagesTextBox.Text,
                                                             maxModificationIsoformsTextBox.Text, MinPeptideLengthTextBox.Text, MaxPeptideLengthTextBox.Text, maxThreadsTextBox.Text, minScoreAllowed.Text,
                                                             peakFindingToleranceTextBox.Text, histogramBinWidthTextBox.Text, DeconvolutionMaxAssumedChargeStateTextBox.Text, NumberOfPeaksToKeepPerWindowTextBox.Text,
                                                             MinimumAllowedIntensityRatioToBasePeakTexBox.Text, WindowWidthThomsonsTextBox.Text, NumberOfWindowsTextBox.Text, numberOfDatabaseSearchesTextBox.Text, MaxModNumTextBox.Text, MaxFragmentMassTextBox.Text, QValueTextBox.Text))
            {
                return;
            }

            Protease protease = (Protease)proteaseComboBox.SelectedItem;

            DissociationType dissociationType = GlobalVariables.AllSupportedDissociationTypes[dissociationTypeComboBox.SelectedItem.ToString()];

            CustomFragmentationWindow.Close();

            FragmentationTerminus fragmentationTerminus = FragmentationTerminus.Both;

            if (nTerminalIons.IsChecked.Value && !cTerminalIons.IsChecked.Value)
            {
                fragmentationTerminus = FragmentationTerminus.N;
            }
            else if (!nTerminalIons.IsChecked.Value && cTerminalIons.IsChecked.Value)
            {
                fragmentationTerminus = FragmentationTerminus.C;
            }
            else if (!nTerminalIons.IsChecked.Value && !cTerminalIons.IsChecked.Value) //why would you want this
            {
                fragmentationTerminus = FragmentationTerminus.None;
                MessageBox.Show("Warning: No ion types were selected. MetaMorpheus will be unable to search MS/MS spectra.");
            }
            //else both

            int maxMissedCleavages           = string.IsNullOrEmpty(missedCleavagesTextBox.Text) ? int.MaxValue : (int.Parse(missedCleavagesTextBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture));
            int minPeptideLengthValue        = (int.Parse(MinPeptideLengthTextBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture));
            int maxPeptideLengthValue        = string.IsNullOrEmpty(MaxPeptideLengthTextBox.Text) ? int.MaxValue : (int.Parse(MaxPeptideLengthTextBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture));
            int MinVariantDepth              = int.Parse(MinVariantDepthTextBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture);
            int MaxHeterozygousVariants      = int.Parse(MaxHeterozygousVariantsTextBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture);
            int maxModificationIsoformsValue = (int.Parse(maxModificationIsoformsTextBox.Text, CultureInfo.InvariantCulture));
            int maxModsForPeptideValue       = (int.Parse(MaxModNumTextBox.Text, CultureInfo.InvariantCulture));
            InitiatorMethionineBehavior initiatorMethionineBehavior = ((InitiatorMethionineBehavior)initiatorMethionineBehaviorComboBox.SelectedIndex);

            DigestionParams digestionParamsToSave = new DigestionParams(
                protease: protease.Name,
                maxMissedCleavages: maxMissedCleavages,
                minPeptideLength: minPeptideLengthValue,
                maxPeptideLength: maxPeptideLengthValue,
                maxModificationIsoforms: maxModificationIsoformsValue,
                initiatorMethionineBehavior: initiatorMethionineBehavior,
                maxModsForPeptides: maxModsForPeptideValue,
                searchModeType: searchModeType,
                fragmentationTerminus: fragmentationTerminus,
                generateUnlabeledProteinsForSilac: CheckBoxQuantifyUnlabeledForSilac.IsChecked.Value);

            Tolerance ProductMassTolerance;

            if (productMassToleranceComboBox.SelectedIndex == 0)
            {
                ProductMassTolerance = new AbsoluteTolerance(double.Parse(productMassToleranceTextBox.Text, CultureInfo.InvariantCulture));
            }
            else
            {
                ProductMassTolerance = new PpmTolerance(double.Parse(productMassToleranceTextBox.Text, CultureInfo.InvariantCulture));
            }

            Tolerance PrecursorMassTolerance;

            if (precursorMassToleranceComboBox.SelectedIndex == 0)
            {
                PrecursorMassTolerance = new AbsoluteTolerance(double.Parse(precursorMassToleranceTextBox.Text, CultureInfo.InvariantCulture));
            }
            else
            {
                PrecursorMassTolerance = new PpmTolerance(double.Parse(precursorMassToleranceTextBox.Text, CultureInfo.InvariantCulture));
            }
            TheTask.SearchParameters.MaxFragmentSize = Double.Parse(MaxFragmentMassTextBox.Text, CultureInfo.InvariantCulture);

            var listOfModsVariable = new List <(string, string)>();

            foreach (var heh in VariableModTypeForTreeViewObservableCollection)
            {
                listOfModsVariable.AddRange(heh.Children.Where(b => b.Use).Select(b => (b.Parent.DisplayName, b.ModName)));
            }

            var listOfModsFixed = new List <(string, string)>();

            foreach (var heh in FixedModTypeForTreeViewObservableCollection)
            {
                listOfModsFixed.AddRange(heh.Children.Where(b => b.Use).Select(b => (b.Parent.DisplayName, b.ModName)));
            }

            if (!GlobalGuiSettings.VariableModCheck(listOfModsVariable))
            {
                return;
            }

            bool TrimMs1Peaks  = trimMs1.IsChecked.Value;
            bool TrimMsMsPeaks = trimMsMs.IsChecked.Value;

            int?numPeaksToKeep = null;

            if (int.TryParse(NumberOfPeaksToKeepPerWindowTextBox.Text, out int numberOfPeaksToKeeep))
            {
                numPeaksToKeep = numberOfPeaksToKeeep;
            }

            double?minimumAllowedIntensityRatioToBasePeak = null;

            if (double.TryParse(MinimumAllowedIntensityRatioToBasePeakTexBox.Text, out double minimumAllowedIntensityRatio))
            {
                minimumAllowedIntensityRatioToBasePeak = minimumAllowedIntensityRatio;
            }

            double?windowWidthThompsons = null;

            if (double.TryParse(WindowWidthThomsonsTextBox.Text, out double windowWidth))
            {
                windowWidthThompsons = windowWidth;
            }

            int?numberOfWindows = null;

            if (int.TryParse(NumberOfWindowsTextBox.Text, out int numWindows))
            {
                numberOfWindows = numWindows;
            }

            bool normalizePeaksAccrossAllWindows = normalizePeaksInWindowCheckBox.IsChecked.Value;

            bool parseMaxThreadsPerFile = !maxThreadsTextBox.Text.Equals("") && (int.Parse(maxThreadsTextBox.Text) <= Environment.ProcessorCount && int.Parse(maxThreadsTextBox.Text) > 0);

            CommonParameters commonParamsToSave = new CommonParameters(
                taskDescriptor: OutputFileNameTextBox.Text != "" ? OutputFileNameTextBox.Text : "SearchTask",
                maxThreadsToUsePerFile: parseMaxThreadsPerFile ? int.Parse(maxThreadsTextBox.Text, CultureInfo.InvariantCulture) : new CommonParameters().MaxThreadsToUsePerFile,
                useDeltaScore: deltaScoreCheckBox.IsChecked.Value,
                reportAllAmbiguity: allAmbiguity.IsChecked.Value,
                deconvolutionMaxAssumedChargeState: int.Parse(DeconvolutionMaxAssumedChargeStateTextBox.Text, CultureInfo.InvariantCulture),
                totalPartitions: int.Parse(numberOfDatabaseSearchesTextBox.Text, CultureInfo.InvariantCulture),
                doPrecursorDeconvolution: deconvolutePrecursors.IsChecked.Value,
                useProvidedPrecursorInfo: useProvidedPrecursor.IsChecked.Value,
                scoreCutoff: double.Parse(minScoreAllowed.Text, CultureInfo.InvariantCulture),
                listOfModsFixed: listOfModsFixed,
                listOfModsVariable: listOfModsVariable,
                dissociationType: dissociationType,
                precursorMassTolerance: PrecursorMassTolerance,
                productMassTolerance: ProductMassTolerance,
                digestionParams: digestionParamsToSave,
                trimMs1Peaks: TrimMs1Peaks,
                trimMsMsPeaks: TrimMsMsPeaks,
                numberOfPeaksToKeepPerWindow: numPeaksToKeep,
                minimumAllowedIntensityRatioToBasePeak: minimumAllowedIntensityRatioToBasePeak,
                windowWidthThomsons: windowWidthThompsons,
                numberOfWindows: numberOfWindows,                                 //maybe change this some day
                normalizePeaksAccrossAllWindows: normalizePeaksAccrossAllWindows, //maybe change this some day
                addCompIons: addCompIonCheckBox.IsChecked.Value,
                qValueOutputFilter: QValueCheckBox.IsChecked.Value ? double.Parse(QValueTextBox.Text, CultureInfo.InvariantCulture) : 1.0,
                assumeOrphanPeaksAreZ1Fragments: protease.Name != "top-down",
                minVariantDepth: MinVariantDepth,
                maxHeterozygousVariants: MaxHeterozygousVariants);

            if (classicSearchRadioButton.IsChecked.Value)
            {
                TheTask.SearchParameters.SearchType = SearchType.Classic;
            }
            else if (modernSearchRadioButton.IsChecked.Value)
            {
                TheTask.SearchParameters.SearchType = SearchType.Modern;
            }
            else //both semi and nonspecific are termed "nonspecific", because they both contain at least one nonspecific cleavage and they share the same algorithm
            {
                TheTask.SearchParameters.SearchType = SearchType.NonSpecific;
            }

            TheTask.SearchParameters.DoParsimony      = checkBoxParsimony.IsChecked.Value;
            TheTask.SearchParameters.NoOneHitWonders  = checkBoxNoOneHitWonders.IsChecked.Value;
            TheTask.SearchParameters.DoQuantification = !checkBoxNoQuant.IsChecked.Value;

            //SilacLabel deconvolution
            {
                if (StaticSilacLabelsObservableCollection.Count == 0)
                {
                    TheTask.SearchParameters.SilacLabels = null;
                }
                else
                {
                    List <Proteomics.SilacLabel> labelsToSave = new List <Proteomics.SilacLabel>();
                    foreach (SilacInfoForDataGrid info in StaticSilacLabelsObservableCollection)
                    {
                        Proteomics.SilacLabel labelToAdd = info.SilacLabel[0];

                        //This is needed to prevent double adding of additional labels.
                        //A quick test is to create a silac condition with two labels, save, reopen the task, save, and reopen again.
                        //Without this line, the second label will be doubled (K+8)&(R+10)&(R+10)
                        if (labelToAdd.AdditionalLabels != null)
                        {
                            labelToAdd.AdditionalLabels.Clear();
                        }

                        for (int infoIndex = 1; infoIndex < info.SilacLabel.Count; infoIndex++)
                        {
                            labelToAdd.AddAdditionalSilacLabel(info.SilacLabel[infoIndex]);
                        }
                        labelsToSave.Add(labelToAdd);
                    }
                    TheTask.SearchParameters.SilacLabels = labelsToSave;
                }
            }

            TheTask.SearchParameters.Normalize               = checkBoxNormalize.IsChecked.Value;
            TheTask.SearchParameters.MatchBetweenRuns        = checkBoxMatchBetweenRuns.IsChecked.Value;
            TheTask.SearchParameters.ModPeptidesAreDifferent = modPepsAreUnique.IsChecked.Value;
            TheTask.SearchParameters.QuantifyPpmTol          = double.Parse(peakFindingToleranceTextBox.Text, CultureInfo.InvariantCulture);
            TheTask.SearchParameters.SearchTarget            = checkBoxTarget.IsChecked.Value;
            TheTask.SearchParameters.WriteMzId               = ckbMzId.IsChecked.Value;
            TheTask.SearchParameters.WriteDecoys             = writeDecoyCheckBox.IsChecked.Value;
            TheTask.SearchParameters.WriteContaminants       = writeContaminantCheckBox.IsChecked.Value;
            //TheTask.SearchParameters.OutPepXML = ckbPepXML.IsChecked.Value;

            if (checkBoxDecoy.IsChecked.Value)
            {
                if (radioButtonReverseDecoy.IsChecked.Value)
                {
                    TheTask.SearchParameters.DecoyType = DecoyType.Reverse;
                }
                else //if (radioButtonSlideDecoy.IsChecked.Value)
                {
                    TheTask.SearchParameters.DecoyType = DecoyType.Slide;
                }
            }
            else
            {
                TheTask.SearchParameters.DecoyType = DecoyType.None;
            }

            if (massDiffAcceptExact.IsChecked.HasValue && massDiffAcceptExact.IsChecked.Value)
            {
                TheTask.SearchParameters.MassDiffAcceptorType = MassDiffAcceptorType.Exact;
            }
            if (massDiffAccept1mm.IsChecked.HasValue && massDiffAccept1mm.IsChecked.Value)
            {
                TheTask.SearchParameters.MassDiffAcceptorType = MassDiffAcceptorType.OneMM;
            }
            if (massDiffAccept2mm.IsChecked.HasValue && massDiffAccept2mm.IsChecked.Value)
            {
                TheTask.SearchParameters.MassDiffAcceptorType = MassDiffAcceptorType.TwoMM;
            }
            if (massDiffAccept3mm.IsChecked.HasValue && massDiffAccept3mm.IsChecked.Value)
            {
                TheTask.SearchParameters.MassDiffAcceptorType = MassDiffAcceptorType.ThreeMM;
            }
            if (massDiffAccept187.IsChecked.HasValue && massDiffAccept187.IsChecked.Value)
            {
                TheTask.SearchParameters.MassDiffAcceptorType = MassDiffAcceptorType.ModOpen;
            }
            if (massDiffAcceptOpen.IsChecked.HasValue && massDiffAcceptOpen.IsChecked.Value)
            {
                TheTask.SearchParameters.MassDiffAcceptorType = MassDiffAcceptorType.Open;
            }
            if (massDiffAcceptCustom.IsChecked.HasValue && massDiffAcceptCustom.IsChecked.Value)
            {
                try
                {
                    MassDiffAcceptor customMassDiffAcceptor = SearchTask.GetMassDiffAcceptor(null, MassDiffAcceptorType.Custom, customkMdacTextBox.Text);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Could not parse custom mass difference acceptor: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                TheTask.SearchParameters.MassDiffAcceptorType = MassDiffAcceptorType.Custom;
                TheTask.SearchParameters.CustomMdac           = customkMdacTextBox.Text;
            }

            //determine if semi or nonspecific with a specific protease.
            if (searchModeType == CleavageSpecificity.Semi || protease.CleavageSpecificity == CleavageSpecificity.Semi)
            {
                TheTask.SearchParameters.LocalFdrCategories = new List <FdrCategory> {
                    FdrCategory.FullySpecific, FdrCategory.SemiSpecific
                };
            }
            else if (searchModeType == CleavageSpecificity.None && protease.CleavageSpecificity != CleavageSpecificity.None)
            {
                TheTask.SearchParameters.LocalFdrCategories = new List <FdrCategory> {
                    FdrCategory.FullySpecific, FdrCategory.SemiSpecific, FdrCategory.NonSpecific
                };
            }
            else
            {
                TheTask.SearchParameters.LocalFdrCategories = new List <FdrCategory> {
                    FdrCategory.FullySpecific
                };
            }

            // displays warning if classic search is enabled with an open search mode
            if (TheTask.SearchParameters.SearchType == SearchType.Classic &&
                (TheTask.SearchParameters.MassDiffAcceptorType == MassDiffAcceptorType.ModOpen || TheTask.SearchParameters.MassDiffAcceptorType == MassDiffAcceptorType.Open))
            {
                MessageBoxResult result = MessageBox.Show("Modern Search mode is recommended when conducting open precursor mass searches to reduce search time.\n\n" +
                                                          "Continue anyway?", "Modern search recommended", MessageBoxButton.OKCancel);

                if (result == MessageBoxResult.Cancel)
                {
                    return;
                }
            }

            TheTask.SearchParameters.DoHistogramAnalysis      = checkBoxHistogramAnalysis.IsChecked.Value;
            TheTask.SearchParameters.HistogramBinTolInDaltons = double.Parse(histogramBinWidthTextBox.Text, CultureInfo.InvariantCulture);

            TheTask.SearchParameters.WritePrunedDatabase = writePrunedDBCheckBox.IsChecked.Value;

            SetModSelectionForPrunedDB();

            TheTask.CommonParameters = commonParamsToSave;

            DialogResult = true;
        }
コード例 #17
0
        private readonly string ProteinAccession; // used to get protein object after deserialization

        public InSilicoPeptide(Protein protein, DigestionParams digestionParams, int oneBasedStartResidueInProtein, int oneBasedEndResidueInProtein, CleavageSpecificity cleavageSpecificity,
                               string peptideDescription, int missedCleavages, Dictionary <int, Modification> allModsOneIsNterminus, int numFixedMods, string baseSeqeunce, bool isPeptideUnique) : base(protein, digestionParams, oneBasedStartResidueInProtein, oneBasedEndResidueInProtein,
                                                                                                                                                                                                         cleavageSpecificity, peptideDescription, missedCleavages, allModsOneIsNterminus, numFixedMods, baseSeqeunce)
        {
            _allModsOneIsNterminus = allModsOneIsNterminus;
            _digestionParams       = digestionParams;
            ProteinAccession       = protein.Accession;
            UniquePeptide          = isPeptideUnique;
        }