public static Run CreateResultsFromThreeScansOfStandardOrbitrapData()
        {
            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            run.ScanSetCollection.Create(run, 6000, 6020, 1, 1, false);

            Task msgen             = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);
            Task peakDetector      = new DeconToolsPeakDetectorV2();
            Task decon             = new ThrashDeconvolutorV2();
            Task msScanInfoCreator = new ScanResultUpdater();
            Task flagger           = new ResultValidatorTask();

            foreach (var scan in run.ScanSetCollection.ScanSetList)
            {
                run.CurrentScanSet = scan;
                msgen.Execute(run.ResultCollection);
                peakDetector.Execute(run.ResultCollection);

                decon.Execute(run.ResultCollection);
                msScanInfoCreator.Execute(run.ResultCollection);
                flagger.Execute(run.ResultCollection);
            }

            return(run);
        }
        public void deconWithRAPID_Then_ValidateTest1()
        {
            Run     run     = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);
            ScanSet scanSet = new ScanSet(6005);

            run.CurrentScanSet = scanSet;


            MSGenerator msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);

            DeconToolsPeakDetectorV2 peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true);
            RapidDeconvolutor        decon        = new RapidDeconvolutor();
            ResultValidatorTask      validator    = new ResultValidatorTask();

            msgen.Execute(run.ResultCollection);
            peakDetector.Execute(run.ResultCollection);
            decon.Execute(run.ResultCollection);
            validator.Execute(run.ResultCollection);

            Assert.AreEqual(190, run.ResultCollection.ResultList.Count);
            IsosResult testResult = run.ResultCollection.ResultList[0];

            Assert.AreEqual(0.0213668719893332m, (decimal)testResult.InterferenceScore);

            //TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);
        }
        public void deconWithTHRASH_Then_ValidateTest1()
        {
            Run run     = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);
            var scanSet = new ScanSet(6005);

            run.CurrentScanSet = scanSet;

            var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);

            var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true);
            var decon        = new HornDeconvolutor();
            var validator    = new ResultValidatorTask();

            msgen.Execute(run.ResultCollection);
            peakDetector.Execute(run.ResultCollection);
            decon.Execute(run.ResultCollection);
            validator.Execute(run.ResultCollection);

            Assert.AreEqual(93, run.ResultCollection.ResultList.Count);
            var testResult = run.ResultCollection.ResultList[0];

            Assert.AreEqual(0.0532199478712594m, (decimal)testResult.InterferenceScore);

            //TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);
        }
        public void outputToText_xcaliburData_Test1()
        {
            string testFile = xcalibur_text_IsosResultOutputFile1;

            List <Run> runcoll = new List <Run>();
            Run        run     = new XCaliburRun(xcaliburFile1);

            runcoll.Add(run);

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 6000, 6020, 1, 1, false);

            sscc.Create();

            Task msgen        = new GenericMSGenerator();
            Task peakDetector = new DeconToolsPeakDetector();
            Task decon        = new HornDeconvolutor();
            Task flagger      = new ResultValidatorTask();
            Task isosExporter = new DeconTools.Backend.ProcessingTasks.ResultExporters.IsosResultExporters.BasicIsosResultTextFileExporter(testFile);
            Task peakExporter = new DeconTools.Backend.ProcessingTasks.PeakListExporters.PeakListSQLiteExporter(100000, peakExporter1);


            Stopwatch sw;

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

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

                isosExporter.Execute(run.ResultCollection);
                sw.Stop();
                if (sw.ElapsedMilliseconds > 10)
                {
                    Console.WriteLine("Exporter execution time = \t" + sw.ElapsedMilliseconds);
                }

                peakExporter.Execute(run.ResultCollection);
            }

            Assert.AreEqual(true, File.Exists(testFile));

            FileInfo fi = new FileInfo(testFile);

            //Assert.AreEqual(25881, fi.Length);
            Console.Write(fi.Length);
        }
        public void outputToText_xcaliburData_Test2()
        {
            string testFile = xcalibur_text_IsosResultOutputFile1;



            List <Run> runcoll = new List <Run>();
            Run        run     = new XCaliburRun(xcaliburFile1);

            runcoll.Add(run);

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 6000, 6020, 1, 1, false);

            sscc.Create();

            Task msgen        = new GenericMSGenerator();
            Task peakDetector = new DeconToolsPeakDetector();
            Task decon        = new HornDeconvolutor();
            Task flagger      = new ResultValidatorTask();
            BasicIsosResultTextFileExporter isosExporter = new BasicIsosResultTextFileExporter(testFile);


            Stopwatch sw;

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

            isosExporter.ExportIsosResults(run.ResultCollection.ResultList);

            Assert.AreEqual(true, File.Exists(testFile));

            FileInfo fi = new FileInfo(testFile);

            //Assert.AreEqual(25881, fi.Length);
            Console.Write(fi.Length);
        }
        public static Run CreateResultsFromTwoFramesOfStandardUIMFData()
        {
            var run = new UIMFRun(FileRefs.RawDataMSFiles.UIMFStdFile1);

            run.ResultCollection.ResultType = Globals.ResultType.UIMF_TRADITIONAL_RESULT;
            run.ScanSetCollection.Create(run, 500, 501, 3, 1);

            run.IMSScanSetCollection.Create(run, 250, 270, 9, 1);

            Task msgen              = new UIMF_MSGenerator();
            Task peakDetector       = new DeconToolsPeakDetectorV2();
            Task decon              = new ThrashDeconvolutorV2();
            Task msScanInfoCreator  = new ScanResultUpdater();
            Task flagger            = new ResultValidatorTask();
            Task ticExtractor       = new DeconTools.Backend.ProcessingTasks.UIMF_TICExtractor();
            Task driftTimeextractor = new UIMFDriftTimeExtractor();

            foreach (var frame in run.ScanSetCollection.ScanSetList)
            {
                run.CurrentScanSet = frame;

                foreach (IMSScanSet scan in run.IMSScanSetCollection.ScanSetList)
                {
                    run.CurrentIMSScanSet = scan;
                    msgen.Execute(run.ResultCollection);
                    peakDetector.Execute(run.ResultCollection);
                    decon.Execute(run.ResultCollection);
                    flagger.Execute(run.ResultCollection);
                    driftTimeextractor.Execute(run.ResultCollection);
                    msScanInfoCreator.Execute(run.ResultCollection);
                    ticExtractor.Execute(run.ResultCollection);
                }
            }

            return(run);
        }
        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);
        }