コード例 #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 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, string peptideDescription, int missedCleavages,
                                           Dictionary <int, Modification> allModsOneIsNterminus, int numFixedMods)
            : base(protein, oneBasedStartResidueInProtein, oneBasedEndResidueInProtein, missedCleavages, peptideDescription)
        {
            _allModsOneIsNterminus = allModsOneIsNterminus;
            NumFixedMods           = numFixedMods;
            _digestionParams       = digestionParams;
            DetermineFullSequence();
            ProteinAccession     = protein.Accession;
            DigestionParamString = digestionParams.ToString();
        }