public int GetNumberOfTheoreticalPeptides(Protease protease, int minLength, int maxLength) { if (!theoreticalPeptides.ContainsKey(protease)) { CalculateTheoreticalPeptides(protease, minLength, maxLength, 0, double.PositiveInfinity); } return(theoreticalPeptides[protease].Length); }
public PeptideSequence[] GetTheoreticalPeptides(Protease protease) { if (!theoreticalPeptides.ContainsKey(protease)) { CalculateTheoreticalPeptides(protease); } return(theoreticalPeptides[protease]); }
public int GetNumberOfTheoreticalPeptides(Protease protease) { if (!theoreticalPeptides.ContainsKey(protease)) { CalculateTheoreticalPeptides(protease); } return(theoreticalPeptides[protease].Length); }
public PeptideSequence[] GetTheoreticalPeptides(Protease protease, int minLength, int maxLength) { if (!theoreticalPeptides.ContainsKey(protease)) { CalculateTheoreticalPeptides(protease, minLength, maxLength, 0, double.PositiveInfinity); } return(theoreticalPeptides[protease]); }
private void CalculateTheoreticalPeptides(Protease protease) { int minLength = 7; int maxLength = 30; double minWeight = 0; double maxWeight = double.PositiveInfinity; CalculateTheoreticalPeptides(protease, minLength, maxLength, minWeight, maxWeight); }
public int GetNumberOfTheoreticalPeptides() { Protease protease = Constants.trypsin; if (!theoreticalPeptides.ContainsKey(protease)) { CalculateTheoreticalPeptides(protease); } return(theoreticalPeptides[protease].Length); }
public PeptideSequence[] GetTheoreticalPeptides() { Protease protease = Constants.trypsin; if (!theoreticalPeptides.ContainsKey(protease)) { CalculateTheoreticalPeptides(protease); } return(theoreticalPeptides[protease]); }
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()); }
// 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(); }