Exemple #1
0
        public void outputToSqlite_uimf_test1()
        {
            List <Run> runcoll = new List <Run>();
            Run        run     = new UIMFRun(uimfFile1);

            runcoll.Add(run);


            FrameSetCollectionCreator fsc = new FrameSetCollectionCreator(run, 800, 809, 3, 1);

            fsc.Create();

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 200, 220, 9, 1);

            sscc.Create();


            Task msgen              = new UIMF_MSGenerator();
            Task peakDetector       = new DeconToolsPeakDetector();
            Task decon              = new RapidDeconvolutor();
            Task driftTimeExtractor = new DeconTools.Backend.ProcessingTasks.UIMFDriftTimeExtractor();
            Task origIntensExtr     = new DeconTools.Backend.ProcessingTasks.OriginalIntensitiesExtractor();
            Task ticExtractor       = new DeconTools.Backend.ProcessingTasks.UIMF_TICExtractor();

            Task scanResultUpdater = new ScanResultUpdater();


            Task sqliteExporter = new DeconTools.Backend.ProcessingTasks.ResultExporters.ScanResultExporters.UIMFScanResult_SqliteExporter(uimf_Sqlite_ScanResultOutputFile1);

            Stopwatch sw;

            foreach (FrameSet frame in ((UIMFRun)run).FrameSetCollection.FrameSetList)
            {
                ((UIMFRun)run).CurrentFrameSet = frame;
                foreach (ScanSet scan in run.ScanSetCollection.ScanSetList)
                {
                    run.CurrentScanSet = scan;
                    msgen.Execute(run.ResultCollection);
                    peakDetector.Execute(run.ResultCollection);

                    decon.Execute(run.ResultCollection);
                    ticExtractor.Execute(run.ResultCollection);
                    scanResultUpdater.Execute(run.ResultCollection);


                    driftTimeExtractor.Execute(run.ResultCollection);
                    origIntensExtr.Execute(run.ResultCollection);

                    sw = new Stopwatch();
                    sw.Start();

                    sqliteExporter.Execute(run.ResultCollection);
                    sw.Stop();
                    if (sw.ElapsedMilliseconds > 10)
                    {
                        Console.WriteLine("SqliteExporter execution time = \t" + sw.ElapsedMilliseconds);
                    }
                }
            }
        }
        public void outputToText_uimf_test1()
        {
            if (File.Exists(uimf_text_IsosResultOutputFile1))
            {
                File.Delete(uimf_text_IsosResultOutputFile1);
            }

            List <Run> runcoll = new List <Run>();
            Run        run     = new UIMFRun(uimfFile1);

            runcoll.Add(run);

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 200, 240, 9, 1, false);

            sscc.Create();

            FrameSetCollectionCreator fsc = new FrameSetCollectionCreator(run, 800, 801, 3, 1);

            fsc.Create();


            Task msgen              = new UIMF_MSGenerator();
            Task peakDetector       = new DeconToolsPeakDetector();
            Task decon              = new HornDeconvolutor();
            Task driftTimeExtractor = new DeconTools.Backend.ProcessingTasks.UIMFDriftTimeExtractor();
            Task origIntensExtr     = new DeconTools.Backend.ProcessingTasks.OriginalIntensitiesExtractor();
            Task isosExporter       = new DeconTools.Backend.ProcessingTasks.ResultExporters.IsosResultExporters.UIMFIsosResultTextFileExporter(uimf_text_IsosResultOutputFile1, 1000000);
            Task flagger            = new ResultValidatorTask();

            Stopwatch sw;

            foreach (FrameSet frame in ((UIMFRun)run).FrameSetCollection.FrameSetList)
            {
                ((UIMFRun)run).CurrentFrameSet = frame;
                foreach (ScanSet scan in run.ScanSetCollection.ScanSetList)
                {
                    run.CurrentScanSet = scan;
                    msgen.Execute(run.ResultCollection);
                    peakDetector.Execute(run.ResultCollection);

                    decon.Execute(run.ResultCollection);
                    flagger.Execute(run.ResultCollection);
                    driftTimeExtractor.Execute(run.ResultCollection);
                    origIntensExtr.Execute(run.ResultCollection);

                    sw = new Stopwatch();
                    sw.Start();

                    isosExporter.Execute(run.ResultCollection);
                    sw.Stop();
                    if (sw.ElapsedMilliseconds > 10)
                    {
                        Console.WriteLine("execution time = \t" + sw.ElapsedMilliseconds);
                    }
                }
            }
            Assert.AreEqual(true, File.Exists(uimf_text_IsosResultOutputFile1));

            FileInfo fi = new FileInfo(uimf_text_IsosResultOutputFile1);

            Assert.AreEqual(99743, fi.Length);
            Console.Write(fi.Length);
        }
        public void msGeneratorSummingTest1()
        {
            Run run        = new UIMFRun(uimfFilePath3);
            int startFrame = 800;
            int stopFrame  = 802;

            int numFramesSummed = 3;
            int numScansSummed  = 9;


            FrameSetCollectionCreator framesetCreator = new FrameSetCollectionCreator(run, startFrame, stopFrame, numFramesSummed, 1);

            framesetCreator.Create();

            ScanSetCollectionCreator scanSetCreator = new ScanSetCollectionCreator(run, numScansSummed, 1);

            scanSetCreator.Create();

            ResultCollection    results       = new ResultCollection(run);
            List <timingResult> timingResults = new List <timingResult>();

            Task msgen              = new UIMF_MSGenerator();
            Task peakDetector       = new DeconToolsPeakDetector();
            Task decon              = new HornDeconvolutor();
            Task scanResultUpdater  = new ScanResultUpdater();
            Task uimfTicExtractor   = new UIMF_TICExtractor();
            Task driftTimeExtractor = new DeconTools.Backend.ProcessingTasks.UIMFDriftTimeExtractor();


            ((HornDeconvolutor)decon).MinPeptideBackgroundRatio = 4;

            foreach (FrameSet frameset in ((UIMFRun)run).FrameSetCollection.FrameSetList)
            {
                System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();



                ((UIMFRun)run).CurrentFrameSet = frameset;
                foreach (ScanSet scanset in run.ScanSetCollection.ScanSetList)
                {
                    sw.Reset();
                    timingResult timeresult = new timingResult();
                    timeresult.frameNum = frameset.PrimaryFrame;
                    timeresult.scanNum  = scanset.PrimaryScanNumber;
                    sw.Start();

                    run.CurrentScanSet = scanset;

                    msgen.Execute(results);
                    timeresult.msGenTime = sw.ElapsedMilliseconds;

                    sw.Reset();
                    sw.Start();
                    peakDetector.Execute(results);
                    timeresult.peakDetectorTime = sw.ElapsedMilliseconds;

                    sw.Reset();
                    sw.Start();
                    decon.Execute(results);
                    timeresult.deconTime = sw.ElapsedMilliseconds;

                    sw.Reset();
                    sw.Start();
                    scanResultUpdater.Execute(results);
                    timeresult.resultUpdaterTime = sw.ElapsedMilliseconds;

                    sw.Reset();
                    sw.Start();
                    uimfTicExtractor.Execute(results);
                    timeresult.ticExtractorTime = sw.ElapsedMilliseconds;


                    sw.Reset();
                    sw.Start();
                    driftTimeExtractor.Execute(results);

                    timeresult.driftTimeExtractorTime = sw.ElapsedMilliseconds;

                    timingResults.Add(timeresult);
                }
            }

            //reportTimingEachFrameEachScan(timingResults);

            Console.WriteLine("Total _isos = " + results.ResultList.Count);
            Console.WriteLine("PeptideBR = " + ((HornDeconvolutor)decon).MinPeptideBackgroundRatio);
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();

            reportTiming_FrameAggregate(timingResults, startFrame, stopFrame);
            Project.Reset();
        }