public 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(); //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\ZC_20171218_H95_R1.raw"); ISpectrumMSn spectrum = specRunner.GetSpectrum(7861) as ISpectrumMSn; List <IGlycan> glycanSet = new List <IGlycan>(); glycanSet.AddRange(glycans); //IAccumulatedPrecursorMatcher matcher = new AccumulatedNGlycoPeptidePrecursorMatcher(peptides, glycanSet, 20); //List<IAccumulatedGlycoPeptideMassProxy> glycoPeptides = matcher.Match(spectrum); IPrecursorMatcher matcher = new GlycoPeptidePrecursorMatcher(peptides, glycanSet, 20); List <IGlycoPeptide> glycoPeptides = matcher.Match(spectrum); //int last = specRunner.GetLastScan(); //for (int i = 0; i <= last; i++) //{ // specRunner.GetSpectrum(i); //} //specRunner.Run(@"C:\Users\iruiz\Downloads\2.raw"); //last = specRunner.GetLastScan(); //for (int i = 0; i <= last; i++) //{ // specRunner.GetSpectrum(i); //} //specRunner.Exit(); watch.Stop(); Console.WriteLine(glycans.Count); Console.WriteLine(glycoPeptides.Count); foreach (IGlycoPeptide gly in glycoPeptides) { Console.WriteLine(gly.GetPeptide().GetSequence()); Console.WriteLine(gly.GetGlycan().GetName()); } Console.WriteLine($"Execution Time: {watch.ElapsedMilliseconds} ms"); Console.Read(); }
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"); }