Exemplo n.º 1
0
        public static PeptideSpectralMatch GetSilacPsm(PeptideSpectralMatch psm, SilacLabel silacLabel)
        {
            List <(int Notch, PeptideWithSetModifications Peptide)> updatedBestMatchingPeptides = new List <(int Notch, PeptideWithSetModifications Peptide)>();

            foreach ((int Notch, PeptideWithSetModifications Peptide)notchAndPwsm in psm.BestMatchingPeptides)
            {
                PeptideWithSetModifications modifiedPwsm = CreateSilacPwsm(silacLabel, notchAndPwsm.Peptide);
                updatedBestMatchingPeptides.Add((notchAndPwsm.Notch, modifiedPwsm));
            }
            return(psm.Clone(updatedBestMatchingPeptides));
        }
        //Needed for parsimony, where there are ambiguous psms
        //Quantification ignores ambiguity
        public static PeptideSpectralMatch GetSilacPsmFromAmbiguousPsm(PeptideSpectralMatch psm, List <SilacLabel> silacLabels)
        {
            List <(int Notch, PeptideWithSetModifications Peptide)> updatedBestMatchingPeptides = new List <(int Notch, PeptideWithSetModifications Peptide)>();

            foreach ((int Notch, PeptideWithSetModifications Peptide)notchAndPwsm in psm.BestMatchingPeptides)
            {
                PeptideWithSetModifications pwsm = notchAndPwsm.Peptide;
                SilacLabel silacLabel            = GetRelevantLabelFromBaseSequence(pwsm.Protein.BaseSequence, silacLabels);
                if (silacLabel == null)
                {
                    updatedBestMatchingPeptides.Add(notchAndPwsm);
                }
                else
                {
                    PeptideWithSetModifications modifiedPwsm = CreateSilacPwsm(true, silacLabel, pwsm); //create light pwsm
                    updatedBestMatchingPeptides.Add((notchAndPwsm.Notch, modifiedPwsm));
                }
            }
            return(psm.Clone(updatedBestMatchingPeptides));
        }