Ejemplo n.º 1
0
        public void ProduceResult(IDataPoints data, ISpectrum spectrum, IGlycoPeptide glycoPeptide)
        {
            ITableNGlycan glycan                      = glycoPeptide.GetGlycan() as ITableNGlycan;
            Dictionary <string, IPeak> peaks          = new Dictionary <string, IPeak>();
            List <IAnnotatedPeak>      annotatedPeaks = new List <IAnnotatedPeak>();

            foreach (PeakPoint pt in data.GetPoints())
            {
                if (!peaks.ContainsKey(pt.GetID()))
                {
                    double mass = Double.Parse(pt.GetID());
                    peaks[pt.GetID()] = new GeneralPeak(mass, pt.GetIntensity());
                }

                List <IGlycoPeptide> glycoPeptides = new List <IGlycoPeptide>();

                foreach (NGlycoPeptideNode node in pt.GetMaxNode())
                {
                    if (IsGlycanMatch(node.GetNGlycan(), glycan))
                    {
                        glycoPeptides.Add(new GeneralGlycoPeptide(node.GetPeptide(), node.GetNGlycan(), -1));
                    }
                }

                if (glycoPeptides.Count > 0)
                {
                    IAnnotatedPeak p = new GeneralAnnotatedSpectrumPeak(peaks[pt.GetID()], glycoPeptides);
                    annotatedPeaks.Add(p);
                }
            }

            result = new GeneralAnnotatedSpectrumPeakResultProduct(spectrum,
                                                                   annotatedPeaks.OrderBy(x => x.GetMZ()).ToList());
        }
        public void Annotate(ISpectrum spectrum, IGlycoPeptide glycoPeptide)
        {
            InitMatcher(glycoPeptide);

            List <IAnnotatedPeak> peaks = GenerateMatcherResult(spectrum);

            result = new GeneralAnnotatedSpectrumPeakResultProduct(spectrum, peaks);
        }
 public override void Analyze(int scan)
 {
     if (resultTable[scan] != null)
     {
         foreach (IGlycoPeptideScore r in resultTable[scan].GetResults())
         {
             annotator.Annotate(spectrumTable[scan], r);
             product = annotator.GetResult();
             (analyzer as IAnnotatedPeakResultAnalyzer).SetResultProduct(product);
             analyzer.Analyze();
         }
     }
 }
 public void SetResultProduct(IAnnotatedPeakResultProduct product)
 {
     this.product = product;
 }
Ejemplo n.º 5
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");
        }