public static void Start(IProtease protease, int maxMissed = 1, int minLength = 0, int maxLength = int.MaxValue, bool storeSequenceString = true)
{
Console.WriteLine("**Start Digestion**");
Stopwatch watch = new Stopwatch();
watch.Start();
List<Peptide> peps = new List<Peptide>();
List<Protein> prots = new List<Protein>();
List<double> allMzs = new List<double>();
AminoAcidPolymer.StoreSequenceString = storeSequenceString;
using (FastaReader reader = new FastaReader("Resources/yeast_uniprot_120226.fasta"))
{
foreach (Protein protein in reader.ReadNextProtein())
{
foreach (Peptide peptide in protein.Digest(protease, maxMissed, minLength, maxLength))
{
peps.Add(peptide);
allMzs.Add(peptide.ToMz(2)); // forces the calculation of the mass and thus chemical formula
}
prots.Add(protein);
}
}
watch.Stop();
Console.WriteLine("{0:N0} proteins produced {1:N0} peptides using {2:N0} missed cleavages", prots.Count, peps.Count, maxMissed);
Console.WriteLine("Time elapsed: {0}", watch.Elapsed);
Console.WriteLine("Memory used: {0:N0} MB", Environment.WorkingSet/(1024*1024));
Console.WriteLine("**End Digestion**");
}