Exemplo n.º 1
0
 public int GetNumberOfTheoreticalPeptides(Protease protease, int minLength, int maxLength)
 {
     if (!theoreticalPeptides.ContainsKey(protease))
     {
         CalculateTheoreticalPeptides(protease, minLength, maxLength, 0, double.PositiveInfinity);
     }
     return(theoreticalPeptides[protease].Length);
 }
Exemplo n.º 2
0
 public PeptideSequence[] GetTheoreticalPeptides(Protease protease)
 {
     if (!theoreticalPeptides.ContainsKey(protease))
     {
         CalculateTheoreticalPeptides(protease);
     }
     return(theoreticalPeptides[protease]);
 }
Exemplo n.º 3
0
 public int GetNumberOfTheoreticalPeptides(Protease protease)
 {
     if (!theoreticalPeptides.ContainsKey(protease))
     {
         CalculateTheoreticalPeptides(protease);
     }
     return(theoreticalPeptides[protease].Length);
 }
Exemplo n.º 4
0
 public PeptideSequence[] GetTheoreticalPeptides(Protease protease, int minLength, int maxLength)
 {
     if (!theoreticalPeptides.ContainsKey(protease))
     {
         CalculateTheoreticalPeptides(protease, minLength, maxLength, 0, double.PositiveInfinity);
     }
     return(theoreticalPeptides[protease]);
 }
Exemplo n.º 5
0
        private void CalculateTheoreticalPeptides(Protease protease)
        {
            int    minLength = 7;
            int    maxLength = 30;
            double minWeight = 0;
            double maxWeight = double.PositiveInfinity;

            CalculateTheoreticalPeptides(protease, minLength, maxLength, minWeight, maxWeight);
        }
Exemplo n.º 6
0
        public int GetNumberOfTheoreticalPeptides()
        {
            Protease protease = Constants.trypsin;

            if (!theoreticalPeptides.ContainsKey(protease))
            {
                CalculateTheoreticalPeptides(protease);
            }
            return(theoreticalPeptides[protease].Length);
        }
Exemplo n.º 7
0
        public PeptideSequence[] GetTheoreticalPeptides()
        {
            Protease protease = Constants.trypsin;

            if (!theoreticalPeptides.ContainsKey(protease))
            {
                CalculateTheoreticalPeptides(protease);
            }
            return(theoreticalPeptides[protease]);
        }
Exemplo n.º 8
0
        public string[] GetTheoreticalPeptideSequences(Protease protease, int minLength, int maxLength)
        {
            PeptideSequence[] peptides         = GetTheoreticalPeptides(protease, minLength, maxLength);
            List <string>     peptideSequences = new List <string>();

            foreach (PeptideSequence peptide in peptides)
            {
                peptideSequences.Add(peptide.GetSequence());
            }
            return(peptideSequences.ToArray());
        }
Exemplo n.º 9
0
        // generic method; protease and margins can be defined
        private void CalculateTheoreticalPeptides(Protease protease, int minLength, int maxLength, double minWeight,
                                                  double maxWeight)
        {
            MatchCollection        peptideMatches       = protease.cleavageSpecificity.Matches(GetSequence());
            List <PeptideSequence> theoreticalPeptides1 = new List <PeptideSequence>();

            foreach (Match match in peptideMatches)
            {
                PeptideSequence theoreticalPeptide = new PeptideSequence();
                theoreticalPeptide.SetSequence(match.Groups[1].Value);
                if (theoreticalPeptide.GetLength() >= minLength && theoreticalPeptide.GetLength() <= maxLength &&
                    (minWeight > 0 && maxWeight < double.PositiveInfinity                     // speed up calculations in case there are no weight limits
                     ||
                     theoreticalPeptide.GetMonoisotopicMolecularMass() >= minWeight &&
                     theoreticalPeptide.GetMonoisotopicMolecularMass() <= maxWeight))
                {
                    theoreticalPeptides1.Add(theoreticalPeptide);
                }
            }
            theoreticalPeptides[protease] = theoreticalPeptides1.ToArray();
        }