public void getDriftProfileFromRawDataMZ_771_Test1()
        {
            Run run = TestUtilities.GetStandardUIMFRun();

            UIMFRun uimfRun = (UIMFRun)run;
            DriftTimeProfileExtractor profileExtractor = new DriftTimeProfileExtractor();

            FrameSet frameset = new FrameSet(805, 804, 806);

            double targetMZ1 = 746.3842;
            double targetMZ2 = 771.6894;


            ScanSetCollectionCreator ssc = new ScanSetCollectionCreator(run, 200, 350, 1, 1);

            ssc.Create();

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();
            XYData xydata = profileExtractor.ExtractProfileFromRawData(uimfRun, frameset, run.ScanSetCollection, targetMZ2, 10d);

            sw.Stop();

            TestUtilities.DisplayXYValues(xydata);
            Console.WriteLine(sw.ElapsedMilliseconds);
        }
        public void getDriftProfileFromRawDataMZ_967_Test1()
        {
            Run run = TestUtilities.GetStandardUIMFRun();

            UIMFRun uimfRun = (UIMFRun)run;
            DriftTimeProfileExtractor profileExtractor = new DriftTimeProfileExtractor();

            FrameSet frameset = new FrameSet(804, 803, 805);

            uimfRun.CurrentFrameSet = frameset;

            double targetMZ = 967.26;


            ScanSetCollectionCreator ssc = new ScanSetCollectionCreator(run, 200, 350, 9, 1);

            ssc.Create();

            //XYData xydata = profileExtractor.ExtractProfileFromRawData(uimfRun, frameset, run.ScanSetCollection, targetMZ, 30d);

            createPeaks(run);
            XYData xydata = profileExtractor.ExtractProfileFromPeakData(uimfRun, frameset, run.ScanSetCollection, targetMZ, 30d);


            TestUtilities.DisplayXYValues(xydata);
        }
예제 #3
0
        public void exportAllPeaksInXCaliburFile()
        {
            if (File.Exists(xcaliburAllPeaksFileName))
            {
                File.Delete(xcaliburAllPeaksFileName);
            }

            Run run = new XCaliburRun(xcaliburTestfile);

            ScanSetCollectionCreator scansetCreator = new ScanSetCollectionCreator(run, run.MinScan, run.MaxScan, 1, 1, false);

            scansetCreator.Create();

            Task msgen = new GenericMSGenerator();

            DeconToolsV2.Peaks.clsPeakProcessorParameters peakParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(2, 1.3, true, DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC);
            Task peakDetector = new DeconToolsPeakDetector(peakParams);

            ((DeconToolsPeakDetector)peakDetector).StorePeakData = true;

            Task exporter = new DeconTools.Backend.ProcessingTasks.PeakListExporters.PeakListTextExporter(run.MSFileType, 1000000, xcaliburAllPeaksFileName);     //trigger of 1E5 = 310 sec (memory = 150 MB);    trigger of 1E6 =  231 Sec (memory = 250 MB);

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

            exporter.Cleanup();
            Assert.AreEqual(true, File.Exists(xcaliburAllPeaksFileName));
        }
예제 #4
0
        public void criticalErrorInPeakDetectorTest1()
        {
            UIMFRun run = new DeconTools.Backend.Runs.UIMFRun(fpgaUIMFFilePath2);

            FrameSetCollectionCreator ffcc = new FrameSetCollectionCreator(run, 425, 432, 3, 1);

            ffcc.Create();

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 1, 500, 9, 1);

            sscc.Create();

            MSGeneratorFactory factory = new MSGeneratorFactory();
            Task msgen = factory.CreateMSGenerator(run.MSFileType);

            DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector();

            peakDet.PeakBackgroundRatio = 4;
            peakDet.SigNoiseThreshold   = 3;


            foreach (var frame in run.FrameSetCollection.FrameSetList)
            {
                run.CurrentFrameSet = frame;

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

                    msgen.Execute(run.ResultCollection);
                    peakDet.Execute(run.ResultCollection);
                }
            }
        }
예제 #5
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);
                    }
                }
            }
        }
예제 #6
0
        public void weirdZeroValuesForMZsAtEarlyFramesTest1()
        {
            UIMFRun run = new UIMFRun(uimfTestfile1);

            FrameSetCollectionCreator framecreator = new FrameSetCollectionCreator(run, 1, 10, 5, 1);

            framecreator.Create();

            ScanSetCollectionCreator scanCreator = new ScanSetCollectionCreator(run, 1, 1);

            scanCreator.Create();

            Task msgen   = new UIMF_MSGenerator(0, 5000);
            Task peakDet = new DeconToolsPeakDetector();


            int scanstop  = 599;
            int scanstart = 0;

            for (int i = scanstart; i < scanstop; i++)
            {
                run.CurrentFrameSet = run.FrameSetCollection.GetFrameSet(1);
                run.CurrentScanSet  = run.ScanSetCollection.GetScanSet(i);
                msgen.Execute(run.ResultCollection);

                if (run.XYData != null && run.XYData.Xvalues != null && run.XYData.Xvalues[0] == 0)
                {
                    reportXYValues(run);
                }
            }
        }
        public void getDriftProfileMZ_796_Test1()      //**
        {
            Run run = TestUtilities.GetStandardUIMFRun();

            UIMFRun uimfRun = (UIMFRun)run;
            DriftTimeProfileExtractor profileExtractor = new DriftTimeProfileExtractor();

            FrameSet frameset = new FrameSet(616, 615, 617);

            uimfRun.CurrentFrameSet = frameset;

            double targetMZ = 1004.1987;


            ScanSetCollectionCreator ssc = new ScanSetCollectionCreator(run, 200, 350, 1, 1);

            ssc.Create();

            XYData xydata = profileExtractor.ExtractProfileFromRawData(uimfRun, frameset, run.ScanSetCollection, targetMZ, 30d);

            TestUtilities.DisplayXYValues(xydata);

            Console.WriteLine("-------------------------------------------------------------------------------------");

            createPeaks(run);
            xydata = profileExtractor.ExtractProfileFromPeakData(uimfRun, frameset, run.ScanSetCollection, targetMZ, 30d);


            TestUtilities.DisplayXYValues(xydata);
        }
        public void turnRAPIDScoreIntoHornScoreAndCompareTest1()
        {
            Run run = new XCaliburRun(xcaliburTestfile, 6000, 6050);


            int numScansSummed = 1;

            ScanSetCollectionCreator scanSetCreator = new ScanSetCollectionCreator(run, run.MinScan, run.MaxScan, numScansSummed, 1, false);

            scanSetCreator.Create();

            Task msgen = new GenericMSGenerator();

            DeconToolsV2.Peaks.clsPeakProcessorParameters detParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detParams.PeakBackgroundRatio    = 3;
            detParams.SignalToNoiseThreshold = 3;

            Task peakDet = new DeconToolsPeakDetector(detParams);

            Task rapid = new RapidDeconvolutor();
            Task horn  = new HornDeconvolutor();

            Task fitcalc = new DeconToolsFitScoreCalculator();

            run.CurrentScanSet = run.ScanSetCollection.GetScanSet(6005);
            msgen.Execute(run.ResultCollection);
            peakDet.Execute(run.ResultCollection);
            horn.Execute(run.ResultCollection);

            //string isosData = reportIsotopicProfiles(run);
            //Console.Write(isosData);

            //First evaluate HornTransform score
            Assert.AreEqual(481.274105402604, (decimal)run.ResultCollection.ResultList[0].IsotopicProfile.GetMZ());
            Assert.AreEqual(0.0101245114907111, (decimal)run.ResultCollection.ResultList[0].IsotopicProfile.Score);

            run.ResultCollection.ClearAllResults();


            horn.Execute(run.ResultCollection);
            fitcalc.Execute(run.ResultCollection);
            Assert.AreEqual(0.00583991502104572, (decimal)run.ResultCollection.ResultList[0].IsotopicProfile.Score);

            run.ResultCollection.ClearAllResults();


            //Run RAPID and evaluate the score Rapid gives it
            rapid.Execute(run.ResultCollection);
            Assert.AreEqual(481.274105402604, (decimal)run.ResultCollection.ResultList[7].IsotopicProfile.GetMZ());
            Assert.AreEqual(1.52062147024669, (decimal)run.ResultCollection.ResultList[7].IsotopicProfile.Score);


            //Run the DeconToolsFitScoreCalculator
            fitcalc.Execute(run.ResultCollection);

            //Evaluate the score given by the fitscore calculator
            Assert.AreNotEqual(1.52062147024669, (decimal)run.ResultCollection.ResultList[7].IsotopicProfile.Score);
            Assert.AreEqual(0.00583991502104572m, (decimal)run.ResultCollection.ResultList[7].IsotopicProfile.Score);
        }
        public void serializeUIMFDataTest1()
        {
            Run        run           = new UIMFRun(uimfFilepath2);
            List <Run> runCollection = new List <Run>();

            runCollection.Add(run);

            int startFrame = 1200;
            int stopFrame  = 1205;

            int numFramesSummed = 3;
            int numScansSummed  = 3;


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

            framesetCreator.Create();

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

            scanSetCreator.Create();

            Task msgen = new UIMF_MSGenerator();

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            detectorParams.ThresholdedData        = true;

            Task peakdetector = new DeconToolsPeakDetector(detectorParams);

            Task decon = new RapidDeconvolutor();

            TaskCollection taskcollection = new TaskCollection();

            taskcollection.TaskList.Add(msgen);
            taskcollection.TaskList.Add(peakdetector);
            taskcollection.TaskList.Add(decon);


            TaskController taskcontroller = new UIMF_TaskController(taskcollection);

            taskcontroller.IsosResultThresholdNum = 50;
            taskcontroller.Execute(runCollection);


            ResultCollection       results;
            IsosResultDeSerializer deserializer = new IsosResultDeSerializer(run.Filename + "_tmp.bin");
            int counter = 0;

            do
            {
                counter++;
                results = deserializer.GetNextSetOfResults();
            } while (results != null);

            Assert.AreEqual(8, counter);
        }
        public void uimfTest2()       //ScanSets are created based on the number of scans per frame
        {
            Run run = new UIMFRun(uimfFilepath);

            ScanSetCollectionCreator creator = new ScanSetCollectionCreator(run, 700, 800, 3, 1, false);

            creator.Create();
        }
예제 #11
0
        public void simpleAddTest1()
        {
            //first deconvolute with THRASH
            //then deconvolute with RAPID, using comboMode = 'simplyAddIt'
            //so there will be duplicate results
            Project.Reset();

            Run run = new XCaliburRun(xcaliburTestfile, 6000, 6050);

            Project.getInstance().RunCollection.Add(run);


            ResultCollection results        = new ResultCollection(run);
            TaskCollection   taskCollection = new TaskCollection();

            ScanSetCollectionCreator scansetCreator = new ScanSetCollectionCreator(run, run.MinScan, run.MaxScan, 1, 1, false);

            scansetCreator.Create();


            Task msgen = new GenericMSGenerator();

            DeconToolsV2.Peaks.clsPeakProcessorParameters peakDetParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            peakDetParams.SignalToNoiseThreshold = 3;
            peakDetParams.PeakBackgroundRatio    = 0.5;
            Task peakDetector = new DeconToolsPeakDetector(peakDetParams);

            Task thrashDecon = new HornDeconvolutor();
            Task rapidDecon  = new RapidDeconvolutor();

            taskCollection.TaskList.Add(msgen);
            taskCollection.TaskList.Add(peakDetector);
            taskCollection.TaskList.Add(thrashDecon);


            TaskController taskcontroller = new BasicTaskController(taskCollection);

            taskcontroller.Execute(Project.getInstance().RunCollection);

            Assert.AreEqual(644, Project.getInstance().RunCollection[0].ResultCollection.ResultList.Count);


            taskCollection.TaskList.Remove(thrashDecon);
            taskCollection.TaskList.Add(rapidDecon);

            Project.getInstance().RunCollection[0].ResultCollection.ResultList.Clear();

            taskcontroller.Execute(Project.getInstance().RunCollection);
            Assert.AreEqual(2472, Project.getInstance().RunCollection[0].ResultCollection.ResultList.Count);

            Project.getInstance().RunCollection[0].ResultCollection.ResultList.Clear();
            taskCollection.TaskList.Remove(rapidDecon);
            taskCollection.TaskList.Add(thrashDecon);
            taskCollection.TaskList.Add(rapidDecon);

            taskcontroller.Execute(Project.getInstance().RunCollection);
            Assert.AreEqual(2472 + 644, Project.getInstance().RunCollection[0].ResultCollection.ResultList.Count);
        }
예제 #12
0
        public void uimf_data_preLoaded()        // in this case, data is preloaded, preventing re-accessing the same drifttimes over and over
        {
            Run run = new UIMFRun(uimfFilepath);

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

            fscc.Create();

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

            sscc.Create();

            ((UIMFRun)run).GetFrameDataAllFrameSets();    // this is the key line... loads data necessary for drift time calc and correction



            UIMF_MSGenerator       msgen   = new UIMF_MSGenerator();
            DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector();

            peakDet.PeakBackgroundRatio = 6;
            peakDet.SigNoiseThreshold   = 3;

            HornDeconvolutor       decon = new HornDeconvolutor();
            UIMFDriftTimeExtractor driftTimeExtractor = new UIMFDriftTimeExtractor();

            StringBuilder sb = new StringBuilder();

            foreach (var frame in ((UIMFRun)run).FrameSetCollection.FrameSetList)
            {
                ((UIMFRun)run).CurrentFrameSet = frame;

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

                    msgen.Execute(run.ResultCollection);
                    peakDet.Execute(run.ResultCollection);
                    decon.Execute(run.ResultCollection);
                    driftTimeExtractor.Execute(run.ResultCollection);
                }
            }

            foreach (var item in run.ResultCollection.ResultList)
            {
                UIMFIsosResult isosresult = (UIMFIsosResult)item;

                sb.Append(isosresult.FrameSet.PrimaryFrame);
                sb.Append("\t");
                sb.Append(isosresult.ScanSet.PrimaryScanNumber);
                sb.Append("\t");
                sb.Append(isosresult.IsotopicProfile.MonoPeakMZ.ToString("0.000"));
                sb.Append("\t");
                sb.Append(isosresult.DriftTime.ToString("0.000"));
                sb.Append(Environment.NewLine);
            }

            Console.Write(sb.ToString());
        }
예제 #13
0
        public void checkIntegrityOfUIMF_RawDataTest1()
        {
            UIMFRun run = new DeconTools.Backend.Runs.UIMFRun(fpgaUIMFFilePath2);

            FrameSetCollectionCreator ffcc = new FrameSetCollectionCreator(run, 696, 696, 3, 1);

            ffcc.Create();

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 350, 500, 9, 1);

            sscc.Create();

            MSGeneratorFactory factory = new MSGeneratorFactory();
            Task msgen = factory.CreateMSGenerator(run.MSFileType);

            DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector();

            peakDet.PeakBackgroundRatio = 6;
            peakDet.SigNoiseThreshold   = 3;


            StringBuilder sb = new StringBuilder();


            sb.Append("frame\tscan\tmaxIntens\tnumZeros\n");

            foreach (var frame in run.FrameSetCollection.FrameSetList)
            {
                run.CurrentFrameSet = frame;

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

                    msgen.Execute(run.ResultCollection);

                    List <int> indices = getIndicesOf0MZValues(run.XYData.Xvalues);

                    double maxY = run.XYData.GetMaxY();


                    if (indices.Count > -1)
                    {
                        sb.Append(frame.PrimaryFrame);
                        sb.Append("\t");
                        sb.Append(scan.PrimaryScanNumber);
                        sb.Append("\t");
                        sb.Append(maxY);
                        sb.Append("\t");
                        sb.Append(indices.Count);
                        sb.Append("\n");
                    }
                }
            }

            Console.WriteLine(sb.ToString());
        }
예제 #14
0
        public void xcaliburSpeed_RAPID_Test1()
        {
            Run run       = new XCaliburRun(xcaliburTestfile);
            int startScan = 6005;
            int stopScan  = 7000;

            int numScansSummed = 1;

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

            scanSetCreator.Create();

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

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            foreach (ScanSet scanset in run.ScanSetCollection.ScanSetList)
            {
                if (results.Run.GetMSLevel(scanset.PrimaryScanNumber) != 1)
                {
                    continue;
                }

                sw.Reset();
                timingResult timeresult = new timingResult();
                timeresult.frameNum = -1;
                timeresult.scanNum  = scanset.PrimaryScanNumber;
                sw.Start();

                run.CurrentScanSet = scanset;
                Task msgen = new GenericMSGenerator();
                msgen.Execute(results);

                timeresult.msGenTime = sw.ElapsedMilliseconds;

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

                sw.Reset();
                sw.Start();
                Task rapid = new RapidDeconvolutor();
                rapid.Execute(results);
                timeresult.deconTime = sw.ElapsedMilliseconds;

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

                timingResults.Add(timeresult);
            }
            reportTimingEachScan(timingResults);
        }
예제 #15
0
        public void uimf_data_not_preLoaded()        // in this case the drift time is calculated every time by looking up sqlite data from uimf file
        {
            Run run = new UIMFRun(uimfFilepath);

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

            fscc.Create();

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

            sscc.Create();



            UIMF_MSGenerator       msgen   = new UIMF_MSGenerator();
            DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector();

            peakDet.PeakBackgroundRatio = 6;
            peakDet.SigNoiseThreshold   = 3;

            HornDeconvolutor       decon = new HornDeconvolutor();
            UIMFDriftTimeExtractor driftTimeExtractor = new UIMFDriftTimeExtractor();

            StringBuilder sb = new StringBuilder();

            foreach (var frame in ((UIMFRun)run).FrameSetCollection.FrameSetList)
            {
                ((UIMFRun)run).CurrentFrameSet = frame;

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

                    msgen.Execute(run.ResultCollection);
                    peakDet.Execute(run.ResultCollection);
                    decon.Execute(run.ResultCollection);
                    driftTimeExtractor.Execute(run.ResultCollection);
                }
            }

            foreach (var item in run.ResultCollection.ResultList)
            {
                UIMFIsosResult isosresult = (UIMFIsosResult)item;

                sb.Append(isosresult.FrameSet.PrimaryFrame);
                sb.Append("\t");
                sb.Append(isosresult.ScanSet.PrimaryScanNumber);
                sb.Append("\t");
                sb.Append(isosresult.IsotopicProfile.MonoPeakMZ.ToString("0.000"));
                sb.Append("\t");
                sb.Append(isosresult.DriftTime.ToString("0.000"));
                sb.Append(Environment.NewLine);
            }

            Console.Write(sb.ToString());
        }
        public void uimfTest1()       //ScanSets are created based on the number of scans per frame
        {
            Run run = new UIMFRun(uimfFilepath);

            ScanSetCollectionCreator creator = new ScanSetCollectionCreator(run, 3, 1);

            creator.Create();

            Assert.AreEqual(600, run.ScanSetCollection.ScanSetList.Count);
        }
        public void test1_summing()
        {
            Project.Reset();
            Project project = Project.getInstance();

            UIMFRun run = new UIMFRun(uimfFilepath, 1201, 1201);

            project.RunCollection.Add(run);

            int numFramesSummed = 3;
            int numScansSummed  = 3;

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 250, 270, numScansSummed, 1);

            sscc.Create();

            FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, numFramesSummed, 1);

            fscc.Create();

            Task msGen = new UIMF_MSGenerator(200, 2000);

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task decon = new HornDeconvolutor();

            Task scanResultsUpdater = new ScanResultUpdater();

            Task originalIntensitiesExtractor = new OriginalIntensitiesExtractor();


            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(decon);
            project.TaskCollection.TaskList.Add(scanResultsUpdater);
            project.TaskCollection.TaskList.Add(originalIntensitiesExtractor);

            TaskController controller = new UIMF_TaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);

            ResultCollection rc = project.RunCollection[0].ResultCollection;

            Assert.AreEqual(180, rc.ResultList.Count);

            StringBuilder sb = new StringBuilder();

            IsosResultUtilities.DisplayResults(sb, rc.ResultList);
            Console.Write(sb.ToString());
        }
        public void basicCreatorTestWithAlternateConstructorTest4()
        {
            Run run = new XCaliburRun(xcaliburTestfile);

            ScanSetCollectionCreator creator = new ScanSetCollectionCreator(run, 1, 19000, 1, 1, false);     //get all MS-Level scans

            creator.Create();

            Assert.AreEqual(2695, run.ScanSetCollection.ScanSetList.Count);
            Assert.AreEqual(new int[] { 1 }, run.ScanSetCollection.ScanSetList[0].IndexValues.ToArray());
        }
        public void basicCreatorTestWithAlternateConstructorTest2()
        {
            Run run = new XCaliburRun(xcaliburTestfile);

            ScanSetCollectionCreator creator = new ScanSetCollectionCreator(run, 6000, 7000, 1, 1, false);

            creator.Create();

            Assert.AreEqual(145, run.ScanSetCollection.ScanSetList.Count);
            Assert.AreEqual(new int[] { 6005 }, run.ScanSetCollection.ScanSetList[0].IndexValues.ToArray());     //first scan is 6005, a MS-level scan
        }
        public void multipleFrames_horn_test1()
        {
            Project.Reset();
            Project project = Project.getInstance();

            project.LoadOldDecon2LSParameters(uimfParameters1);

            UIMFRun run = new UIMFRun(uimfFilepath, 1201, 1203);

            project.RunCollection.Add(run);

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

            sscc.Create();

            FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, 1, 1);

            fscc.Create();

            Task msGen      = new UIMF_MSGenerator(0, 5000);
            Task zeroFiller = new DeconToolsZeroFiller(3);

            Task peakDetector = new DeconToolsPeakDetector(project.Parameters.OldDecon2LSParameters.PeakProcessorParameters);

            Task decon = new HornDeconvolutor(project.Parameters.OldDecon2LSParameters.HornTransformParameters);

            Task scanResultsUpdater = new ScanResultUpdater();

            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(zeroFiller);

            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(decon);
            project.TaskCollection.TaskList.Add(scanResultsUpdater);

            Stopwatch sw = new Stopwatch();

            sw.Start();
            TaskController controller = new UIMF_TaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);
            sw.Stop();

            Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds);
            Console.WriteLine("Scans analyzed = " + project.RunCollection[0].ScanSetCollection.ScanSetList.Count);
            Console.WriteLine("Features found = " + project.RunCollection[0].ResultCollection.ResultList.Count);
            Console.WriteLine("Peaks found = " + project.RunCollection[0].ResultCollection.ScanResultList[0].NumPeaks);



            StringBuilder sb = new StringBuilder();
        }
        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 basicCreatorTest1()
        {
            Run run = new XCaliburRun(xcaliburTestfile);

            ScanSetCollectionCreator creator = new ScanSetCollectionCreator(run, 3, 1);

            creator.Create();

            Assert.AreEqual(2695, run.ScanSetCollection.ScanSetList.Count);

            TestUtilities.DisplayScanSetData(run.ScanSetCollection.ScanSetList);
            //Assert.AreEqual(new int[] { 0, 1, 2 }, run.ScanSetCollection.ScanSetList[0].IndexValues.ToArray());
            //Assert.AreEqual(new int[] { 18504, 18505 }, run.ScanSetCollection.ScanSetList[18504].IndexValues.ToArray());
        }
예제 #23
0
        public void outputToText_xcaliburData_Test1()
        {
            List <Run> runcoll = new List <Run>();
            Run        run     = new XCaliburRun(xcaliburFile1);

            runcoll.Add(run);

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 6000, 6100, 1, 1);

            sscc.Create();

            Task msgen                  = new GenericMSGenerator();
            Task peakDetector           = new DeconToolsPeakDetector();
            Task decon                  = new RapidDeconvolutor();
            Task textScanResultExporter = new DeconTools.Backend.ProcessingTasks.ResultExporters.ScanResultExporters.BasicScanResult_TextFileExporter(xcalibur_text_ScanResultOutputFile1);
            Task scanResultUpdater      = new ScanResultUpdater();

            Stopwatch sw;

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

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

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



            //TaskCollection taskColl=new TaskCollection();
            //taskColl.TaskList.Add(msgen);
            //taskColl.TaskList.Add(peakDetector);
            //taskColl.TaskList.Add(decon);
            //taskColl.TaskList.Add(sqliteExporter);

            //TaskController controller = new BasicTaskController(taskColl);
            //controller.Execute(runcoll);
        }
예제 #24
0
        public void xcaliburFileMSMSDataTest1()
        {
            //exploring how only MSMS data is processed...

            Project.Reset();

            Run run = new XCaliburRun(xcaliburTestfile, 6000, 6004);    //only MS/MS data here
            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, run.MinScan, run.MaxScan, 1, 1);

            sscc.Create();

            Project project = Project.getInstance();

            project.RunCollection.Add(run);

            Task msGen = new GenericMSGenerator();

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 1.3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 2;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            DeconToolsV2.HornTransform.clsHornTransformParameters hornparams = new DeconToolsV2.HornTransform.clsHornTransformParameters();
            hornparams.PeptideMinBackgroundRatio = 2;
            Task hornDecon = new HornDeconvolutor(hornparams);

            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(hornDecon);

            Stopwatch sw = new Stopwatch();

            sw.Start();
            TaskController controller = new BasicTaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);
            sw.Stop();

            Assert.AreEqual(1, Project.getInstance().RunCollection.Count);
            Assert.AreEqual(3, project.TaskCollection.TaskList.Count);

//            Assert.AreEqual(21, project.RunCollection[0].ScanSetCollection.ScanSetList.Count);
            Assert.AreEqual(0, project.RunCollection[0].ResultCollection.ResultList.Count);

            Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds);
            Console.WriteLine("Scans analyzed = " + project.RunCollection[0].ScanSetCollection.ScanSetList.Count);
            Console.WriteLine("Features found = " + project.RunCollection[0].ResultCollection.ResultList.Count);
        }
예제 #25
0
        public void xcaliburFile100ScanRAPIDTest1()
        {
            Project.Reset();

            Run run = new XCaliburRun(xcaliburTestfile, 6000, 6999);

            Project project = Project.getInstance();

            project.RunCollection.Add(run);

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, run.MinScan, run.MaxScan, 1, 1);

            sscc.Create();



            Task msGen = new GenericMSGenerator();

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            detectorParams.ThresholdedData        = false;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task rapidDecon = new RapidDeconvolutor();

            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(rapidDecon);

            Stopwatch sw = new Stopwatch();

            sw.Start();
            TaskController controller = new BasicTaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);
            sw.Stop();

            Assert.AreEqual(1, Project.getInstance().RunCollection.Count);
            Assert.AreEqual(3, project.TaskCollection.TaskList.Count);

            Assert.AreEqual(1000, project.RunCollection[0].ScanSetCollection.ScanSetList.Count);
            Assert.AreEqual(12762, project.RunCollection[0].ResultCollection.ResultList.Count);

            Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds);
            Console.WriteLine("Scans analyzed = " + project.RunCollection[0].ScanSetCollection.ScanSetList.Count);
            Console.WriteLine("Features found = " + project.RunCollection[0].ResultCollection.ResultList.Count);
        }
        public void basicCreatorTestWithAlternateConstructor_MSMSIncludedTest1()
        {
            Run run = new XCaliburRun(xcaliburTestfile);

            ScanSetCollectionCreator creator = new ScanSetCollectionCreator(run, 6000, 7000, 3, 1, true);

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();
            creator.Create();
            sw.Stop();
            Console.WriteLine(sw.ElapsedMilliseconds);

            //Assert.AreEqual(1001, run.ScanSetCollection.ScanSetList.Count);
            Assert.AreEqual(new int[] { 5999, 6000, 6001 }, run.ScanSetCollection.ScanSetList[0].IndexValues.ToArray());
        }
예제 #27
0
        public void test1()
        {
            Run run0 = new XCaliburRun(c2_blankfilePath);
            Run run1 = new XCaliburRun(c2_6FilePath);
            Run run2 = new XCaliburRun(c2_7FilePath);
            Run run3 = new XCaliburRun(c2_8FilePath);
            Run run4 = new XCaliburRun(c2_9FilePath);
            Run run5 = new XCaliburRun(c2_10FilePath);



            Project.getInstance().RunCollection.Add(run0);
            Project.getInstance().RunCollection.Add(run1);
            Project.getInstance().RunCollection.Add(run2);
            Project.getInstance().RunCollection.Add(run3);
            Project.getInstance().RunCollection.Add(run4);
            Project.getInstance().RunCollection.Add(run5);

            foreach (Run run in Project.getInstance().RunCollection)
            {
                ScanSetCollectionCreator scansetCreator = new ScanSetCollectionCreator(run, 1, 1);
                scansetCreator.Create();
            }

            Task msgen               = new GenericMSGenerator();
            Task peakDetector        = new DeconToolsPeakDetector();
            Task decon               = new SimpleDecon();
            Task isosMergerExporter  = new BasicIsosMergerExporter("..\\..\\TestFiles\\MergeTestFiles\\BasicIsosMergerExporterTest1Output_isos.csv");
            Task scansupdater        = new ScanResultUpdater();
            Task scansMergerExporter = new BasicScansMergerExporter("..\\..\\TestFiles\\MergeTestFiles\\BasicIsosMergerExporterTest1Output_scans.csv");



            Project.getInstance().TaskCollection.TaskList.Add(msgen);
            Project.getInstance().TaskCollection.TaskList.Add(peakDetector);
            Project.getInstance().TaskCollection.TaskList.Add(decon);
            Project.getInstance().TaskCollection.TaskList.Add(isosMergerExporter);
            Project.getInstance().TaskCollection.TaskList.Add(scansupdater);
            Project.getInstance().TaskCollection.TaskList.Add(scansMergerExporter);

            BasicTaskController taskController = new BasicTaskController(Project.getInstance().TaskCollection);

            taskController.Execute(Project.getInstance().RunCollection);

            TaskCleaner cleaner = new TaskCleaner(Project.getInstance().TaskCollection);

            cleaner.CleanTasks();
        }
예제 #28
0
        public void examineEffectOfIntensityCutoffOnRapidTest1()
        {
            Project project = Project.getInstance();

            project.Parameters.OldDecon2LSParameters = new OldDecon2LSParameters();


            Run run = new XCaliburRun(xcaliburTestfile, 6000, 7000);

            project.RunCollection.Add(run);

            ScanSetCollectionCreator scansetCreator = new ScanSetCollectionCreator(run, run.MinScan, run.MaxScan, 1, 1);

            scansetCreator.Create();

            ResultCollection results = new ResultCollection(run);


            foreach (ScanSet scanset in run.ScanSetCollection.ScanSetList)
            {
                run.CurrentScanSet = scanset;


                Task msgen = new GenericMSGenerator();
                msgen.Execute(results);


                DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
                detectorParams.PeakBackgroundRatio    = 3;
                detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
                detectorParams.SignalToNoiseThreshold = 3;
                detectorParams.ThresholdedData        = false;

                Task peakDetector = new DeconToolsPeakDetector(detectorParams);
                peakDetector.Execute(results);

                for (int i = 1; i < 6; i++)
                {
                    results.ResultList.Clear();

                    Task rapidDecon = new RapidDeconvolutor(i, DeconTools.Backend.ProcessingTasks.IDeconvolutor.DeconResultComboMode.simplyAddIt);
                    rapidDecon.Execute(results);

                    //Console.WriteLine(scanset.PrimaryScanNumber + "\t" + i + "\t" +
                    //     results.ResultList.Count + "\t" + results.Run.CurrentScanSet.BackgroundIntensity);
                }
            }
        }
        public void examineFPGAFileTest1()
        {
            UIMFRun run = new UIMFRun(uimfFPGAFilePath);

            Task msGen = new UIMF_MSGenerator(200, 2000);

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task decon = new HornDeconvolutor();

            Task scanResultsUpdater = new ScanResultUpdater();

            Task originalIntensitiesExtractor = new OriginalIntensitiesExtractor();



            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 300, 300, 1, 1);

            sscc.Create();


            FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, 5, 5, 1, 1);

            fscc.Create();

            foreach (var frame in run.FrameSetCollection.FrameSetList)
            {
                run.CurrentFrameSet = frame;

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

                    msGen.Execute(run.ResultCollection);

                    //TestUtilities.DisplayXYValues(run.XYData);

                    originalIntensitiesExtractor.Execute(run.ResultCollection);
                    TestUtilities.DisplayXYValues(run.XYData);
                }
            }
        }
예제 #30
0
        public void outputToSqlite_xcaliburData_Test1()
        {
            List <Run> runcoll = new List <Run>();
            Run        run     = new XCaliburRun(xcaliburFile1);

            runcoll.Add(run);

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

            sscc.Create();

            Task msgen                    = new GenericMSGenerator();
            Task peakDetector             = new DeconToolsPeakDetector();
            Task decon                    = new RapidDeconvolutor();
            Task sqliteScanResultExporter = new DeconTools.Backend.ProcessingTasks.ResultExporters.ScanResultExporters.BasicScanResult_SqliteExporter(xcalibur_sqlite_ScanResultOutputFile1);

            Task peakExporter      = new DeconTools.Backend.ProcessingTasks.PeakListExporters.PeakListSQLiteExporter(100000, peakExporter1);
            Task scanResultUpdater = new ScanResultUpdater();

            Stopwatch sw;

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

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

                sqliteScanResultExporter.Execute(run.ResultCollection);
                sw.Stop();


                if (sw.ElapsedMilliseconds > 10)
                {
                    Console.WriteLine("SqliteExporter execution time = \t" + sw.ElapsedMilliseconds);
                }

                peakExporter.Execute(run.ResultCollection);
            }
        }