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"); }
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"); }