Exemplo n.º 1
0
        public static void Start(IProtease protease, int maxMissed = 3, int minLength = 5, int maxLength = 35)
        {
            Console.WriteLine("**Start Morpheus Search**");
            Stopwatch watch = new Stopwatch();

            watch.Start();
            List <int> hashCodes = new List <int>();
            // Generate peptide candidates

            HashSet <Peptide> peptides = new HashSet <Peptide>();

            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))
                    {
                        peptides.Add(peptide);
                    }
                }
            }

            MSSearchEngine engine = new MorpheusSearchEngine();

            engine.PrecursorMassTolerance = Tolerance.FromPPM(100);
            engine.ProductMassTolerance   = Tolerance.FromPPM(10);

            engine.LoadPeptides(peptides);

            watch.Stop();
            Console.WriteLine("Time elapsed: {0}", watch.Elapsed);
            Console.WriteLine("Memory used: {0:N0} MB", Environment.WorkingSet / (1024 * 1024));
            Console.WriteLine("**End Morpheus Search**");
        }
        public void ToleranceWithin2()
        {
            var tol = Tolerance.FromPPM(10, ToleranceType.FullWidth);

            Assert.IsFalse(tol.Within(500, 500.005));
        }
        public void ToleranceWithin1()
        {
            var tol = Tolerance.FromPPM(10);

            Assert.IsTrue(tol.Within(500, 500.005));
        }