Beispiel #1
0
        public override void Run()
        {
            var watch = new System.Diagnostics.Stopwatch();

            watch.Start();

            FastaSearchRunPeptides pepRunner = new FastaSearchRunPeptides();

            pepRunner.SetPeptideCreator(new NGlycosylationPeptideCreator(new GeneralPeptideCreator()));
            List <IPeptide> peptides = pepRunner.Run(@"C:\Users\iruiz\Downloads\ms_fasta.fasta");

            //List<IPeptide> peptides = pepRunner.Run(@"C:\Users\rz20\Downloads\ms_fasta.fasta");
            Console.WriteLine(peptides.Count);

            IAccumulatedMSNGlycanCreator       glyRunner = new AccumulatedMSBruteForceNGlycanCreator();
            List <IAccumulatedGlycanMassProxy> glycans   = glyRunner.GenerateSpecific();

            IAccumulatedStructNGlycanCreator        glyRunner2 = new AccumulatedStructBruteForceNGlycanCreator();
            List <IAccumulatedGlycanStructureProxy> glycans2   = glyRunner2.GenerateSpecific();

            ThermoRawSearchRunSpectrum specRunner = new ThermoRawSearchRunSpectrum();

            specRunner.Run(@"C:\Users\iruiz\Downloads\1.raw");
            //specRunner.Run(@"C:\Users\rz20\Downloads\1.raw");

            //for (int i = 1; i < specRunner.GetLastScan(); i++)
            //{

            ISpectrum spectrum = specRunner.GetSpectrum(3361);

            //if (spectrum.GetMSnOrder() == 1) continue;
            //if ((spectrum as ISpectrumMSn).GetActivation() != TypeOfMSActivation.ETD) continue;

            List <IGlycan> glycanSet = new List <IGlycan>();

            glycanSet.AddRange(glycans);

            ISpectrumProcessing processor = new GeneralPeakPickingSpectrumProcessing();

            processor.Process(spectrum);

            double pretol = 20;
            IAccumulatedPrecursorMatcher precursorMatcher = new AccumulatedMSNGlycoPeptidePrecursorMatcher(peptides, glycanSet, pretol);

            List <IGlycoPeptide> glycoPeptides = precursorMatcher.Match(spectrum);

            IGlycoPeptideScoreFactory searchRunner = new BinSearchSpectrumEThcD();


            searchRunner.Search(spectrum, glycoPeptides);
            IGlycoPeptideScoreResultProduct result = searchRunner.GetResult();

            List <IGlycoPeptideScore> results   = result.GetResults();
            IAnnotatedPeakFactory     annotator = new BinSearchAnnotatedSpectrumEThcD(glycans2, 20);

            foreach (IGlycoPeptideScore r in results)
            {
                annotator.Annotate(spectrum, r);
                IAnnotatedPeakResultProduct peaks = annotator.GetResult();
                peaks.Report("test.txt");
            }
            watch.Stop();
            Console.WriteLine($"Execution Time: {watch.ElapsedMilliseconds} ms");
        }
Beispiel #2
0
        public override void Run()
        {
            IDoubleDigestionPeptidesSearchRun pepRunner = new DoubleDigestionFastaSearchRunPeptides();

            pepRunner.SetPeptideCreator(new NGlycosylationPeptideCreator(new DoubleDigestionPeptideCreator()));
            IPeptideCreatorParameter parameter = new GeneralPeptideCreatorParameter(Proteases.Trypsin, 2, 7);;

            pepRunner.AddPeptideParameter(parameter);
            //parameter = new GeneralPeptideCreatorParameter(Proteases.GluC, 2, 7);
            //pepRunner.AddPeptideParameter(parameter);

            List <IPeptide> peptides = pepRunner.Run(@"C:\Users\iruiz\Downloads\Human_ReviewedCanonical_20201Entries_25thJuly_2017.fasta");

            IGlycanCreator glyRunner = new BruteForceNGlycanCreator();
            List <IGlycan> glycans   = glyRunner.Generate();
            //IGlycanGenerator glyRunner = new SimpleGlycanGenerator();
            //List<IGlycan> glycans = glyRunner.Generate();

            ThermoRawSearchRunSpectrum specRunner = new ThermoRawSearchRunSpectrum();

            //specRunner.Run(@"C:\Users\iruiz\Downloads\ZC_20171218_H95_R1.raw");
            specRunner.Run(@"C:\Users\iruiz\Downloads\1.raw");
            //specRunner.Run(@"C:\Users\rz20\Downloads\1.raw");
            Console.Write("scan, ");
            Console.Write("peptide, ");
            Console.Write("glycan, ");
            Console.Write("score, ");
            Console.Write("mz, ");
            Console.WriteLine("charge");
            var watch = new System.Diagnostics.Stopwatch();

            watch.Start();


            IMonoMassSpectrumRun monoRunner    = new BinSearchMonoMassSpectrumRun();
            double            pretol           = 20;
            IPrecursorMatcher precursorMatcher = new Y1PeptidesFilterPrecursorMatcher(
                new GlycoPeptidePrecursorMatcher(peptides, glycans, pretol), peptides);
            IGlycoPeptideScoreFactory searchRunner = new DPSearchSpectrumCID();

            for (int i = 10621; i < 10628; i++)
            //for (int i = 1; i < specRunner.GetLastScan(); i++)
            {
                ISpectrum spectrum = specRunner.GetSpectrum(i);

                if (spectrum.GetMSnOrder() == 1)
                {
                    monoRunner.SetMS1Spectrum(spectrum);
                    continue;
                }

                if ((spectrum as ISpectrumMSn).GetActivation() != TypeOfMSActivation.CID)
                {
                    continue;
                }

                ISpectrumProcessing processor = new GeneralPeakPickingSpectrumProcessing();
                processor.Process(spectrum);

                monoRunner.Run(spectrum as ISpectrumMSn);
                double mass = monoRunner.GetMonoMass();

                List <IGlycoPeptide> glycoPeptides = precursorMatcher.Match(spectrum, mass);

                searchRunner.Search(spectrum, glycoPeptides);
                IGlycoPeptideScoreResultProduct result = searchRunner.GetResult();
                result.MaxScore();

                result.Report("test.txt");
            }

            watch.Stop();
            Console.WriteLine($"Execution Time: {watch.ElapsedMilliseconds} ms");
            Console.Read();
        }
        public override void Run()
        {
            var watch = new System.Diagnostics.Stopwatch();

            watch.Start();

            IDoubleDigestionPeptidesSearchRun pepRunner = new DoubleDigestionFastaSearchRunPeptides();

            pepRunner.SetPeptideCreator(new NGlycosylationPeptideCreator(new DoubleDigestionPeptideCreator()));
            IPeptideCreatorParameter parameter = new GeneralPeptideCreatorParameter(Proteases.Trypsin, 2, 7);;

            pepRunner.AddPeptideParameter(parameter);
            parameter = new GeneralPeptideCreatorParameter(Proteases.GluC, 2, 7);
            pepRunner.AddPeptideParameter(parameter);

            List <IPeptide> peptides = pepRunner.Run(@"C:\Users\iruiz\Downloads\HP.fasta");

            IAccumulatedMSNGlycanCreator       glyRunner = new AccumulatedMSBruteForceNGlycanCreator();
            List <IAccumulatedGlycanMassProxy> glycans   = glyRunner.GenerateSpecific();
            //IGlycanGenerator glyRunner = new SimpleGlycanGenerator();
            //List<IGlycan> glycans = glyRunner.Generate();

            ThermoRawSearchRunSpectrum specRunner = new ThermoRawSearchRunSpectrum();

            specRunner.Run(@"C:\Users\iruiz\Downloads\ZC_20171218_H95_R1.raw");
            //specRunner.Run(@"C:\Users\rz20\Downloads\1.raw");
            Console.Write("scan, ");
            Console.Write("peptide, ");
            Console.Write("glycan, ");
            Console.Write("score, ");
            Console.Write("mz, ");
            Console.WriteLine("charge");
            for (int i = 7861; i < 7862; i++)
            {
                ISpectrum spectrum = specRunner.GetSpectrum(i);

                if (spectrum.GetMSnOrder() == 1)
                {
                    continue;
                }
                if ((spectrum as ISpectrumMSn).GetActivation() != TypeOfMSActivation.ETD)
                {
                    continue;
                }

                List <IGlycan> glycanSet = new List <IGlycan>();
                glycanSet.AddRange(glycans);

                ISpectrumProcessing processor = new GeneralPeakPickingSpectrumProcessing();
                processor.Process(spectrum);

                double pretol = 20;
                IAccumulatedPrecursorMatcher precursorMatcher = new AccumulatedMSNGlycoPeptidePrecursorMatcher(peptides, glycanSet, pretol);

                List <IGlycoPeptide> glycoPeptides = precursorMatcher.Match(spectrum);


                IGlycoPeptideScoreFactory searchRunner = new BinSearchSpectrumEThcD();
                searchRunner.Search(spectrum, glycoPeptides);
                IGlycoPeptideScoreResultProduct result = searchRunner.GetResult();
                result.MaxScore();


                result.Report("test.txt");
            }
            watch.Stop();
            Console.WriteLine($"Execution Time: {watch.ElapsedMilliseconds} ms");
        }