コード例 #1
0
        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);
        }
コード例 #2
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);
                    }
                }
            }
        }
コード例 #3
0
        public void deconvoluteXCalibur_MS_DataTest1()    //good ms data...  expect to find isotopic profiles...
        {
            Run run = new XCaliburRun(xcaliburTestfile);

            run.MSParameters   = new DeconTools.Backend.Parameters.MSParameters();
            run.CurrentScanSet = new ScanSet(6067);

            ResultCollection rc = new ResultCollection(run);

            Task msGen = new GenericMSGenerator();

            msGen.Execute(rc);

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

            peakdetector.Execute(rc);

            Task rapid = new RapidDeconvolutor();

            rapid.Execute(rc);

            Assert.AreEqual(95, rc.ResultList.Count);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
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);
        }
コード例 #7
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);
        }
コード例 #8
0
        public void examineIMFFile_Scan233MZ630()
        {
            Run run = new IMFRun(imfFilepath);

            run.MSParameters       = new DeconTools.Backend.Parameters.MSParameters();
            run.CurrentScanSet     = new ScanSet(233, 229, 237);
            run.MSParameters.MinMZ = 100;
            run.MSParameters.MaxMZ = 631.5;

            int numPeaks = 0;

            for (double n = 629; n < 630; n = n + 0.01)
            {
                ResultCollection rc = new ResultCollection(run);

                Task msGen = new GenericMSGenerator(n, run.MSParameters.MaxMZ);
                msGen.Execute(rc);

                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 zeroFiller = new DeconToolsZeroFiller(3);
                //zeroFiller.Execute(rc);

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

                Task decon = new RapidDeconvolutor();
                decon.Execute(rc);


                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < rc.ResultList.Count; i++)
                {
                    IsosResult result = rc.ResultList[i];
                    if (result.IsotopicProfile.Peaklist[0].XValue > 629 && result.IsotopicProfile.Peaklist[0].XValue < 631)
                    {
                        sb.Append(n.ToString("0.00"));
                        sb.Append("\t");
                        sb.Append(result.IsotopicProfile.Peaklist[0].XValue.ToString("0.00"));
                        sb.Append("\t");
                        sb.Append(result.IsotopicProfile.Score.ToString("0.00"));
                        sb.Append("\t");
                        sb.Append(result.Run.PeakList.Count);
                        sb.Append("\t");
                        sb.Append(result.Run.XYData.Xvalues.Length);

                        sb.Append("\n");
                    }
                }
                Console.Write(sb.ToString());
            }
        }
コード例 #9
0
ファイル: FitterTests.cs プロジェクト: trishorts/DeconTools
        public void fitterOnRapidDataTest1()
        {
            Run run = new XCaliburRun(xcaliburTestfile);

            ResultCollection results = new ResultCollection(run);

            run.CurrentScanSet = new ScanSet(6067);


            Task msGen = new GenericMSGenerator(1154, 1158);

            msGen.Execute(results);

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

            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            peakDetector.Execute(results);


            Task decon = new RapidDeconvolutor();

            decon.Execute(results);


            IsosResult result1    = results.ResultList[0];
            double     resolution = result1.IsotopicProfile.GetMZofMostAbundantPeak() / result1.IsotopicProfile.GetFWHM();


            MercuryDistributionCreator distcreator = new MercuryDistributionCreator();

            distcreator.CreateDistribution(result1.IsotopicProfile.MonoIsotopicMass, result1.IsotopicProfile.ChargeState, resolution);
            distcreator.OffsetDistribution(result1.IsotopicProfile);



            XYData theorXYData = distcreator.Data;

            StringBuilder sb = new StringBuilder();

            TestUtilities.GetXYValuesToStringBuilder(sb, theorXYData.Xvalues, theorXYData.Yvalues);

            Console.WriteLine(sb.ToString());

            AreaFitter areafitter = new AreaFitter(theorXYData, run.XYData, 10);
            double     fitval     = areafitter.getFit();

            Console.WriteLine(result1.IsotopicProfile.Score + "\t" + fitval);
            Console.WriteLine((result1.IsotopicProfile.Score - fitval) / result1.IsotopicProfile.Score * 100);

            Assert.AreEqual(0.021245316579128, (decimal)fitval);
        }
コード例 #10
0
        public void test1()
        {
            Run run = new MSScanFromTextFileRun(imfMSScanTextfile);
            ResultCollection resultcollection = new ResultCollection(run);

            Task msgen = new GenericMSGenerator();

            msgen.Execute(resultcollection);

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

            Task rapidDecon = new RapidDeconvolutor();

            rapidDecon.Execute(resultcollection);

            int counter = 0;

            foreach (StandardIsosResult result in resultcollection.ResultList)
            {
                IsotopicProfile profile = result.IsotopicProfile;
                Console.Write("------------ profile" + counter + "; Charge state = " + profile.ChargeState
                              + "; Score= " + profile.Score.ToString("0.00") + " ----------------\n");
                int peakcounter = 0;
                Console.Write("idx" + "\t" + "mz" + "\t" + "intensity" + "\t" + "SN" + "\t" + "FWHM" + "\n");
                foreach (MSPeak peak in profile.Peaklist)
                {
                    Console.Write(peakcounter + "\t" + peak.XValue + "\t" + peak.Height + "\t" + peak.SN + "\t" + peak.Width + "\n");
                    peakcounter++;
                }
                counter++;
            }

            Assert.AreEqual(9, resultcollection.ResultList.Count);
            Assert.AreEqual(582.820684517665, Convert.ToDecimal(resultcollection.ResultList[0].IsotopicProfile.Peaklist[0].XValue));
            Assert.AreEqual(2984.0, resultcollection.ResultList[0].IsotopicProfile.Peaklist[0].Height);
            Assert.AreEqual(0.05905123, (decimal)resultcollection.ResultList[0].IsotopicProfile.Peaklist[0].Width);
            Assert.AreEqual(157.0526, (decimal)resultcollection.ResultList[0].IsotopicProfile.Peaklist[0].SN);


            Assert.AreEqual(4593, resultcollection.ResultList[0].IsotopicProfile.GetAbundance());

            Assert.AreEqual(1, resultcollection.ResultList[8].IsotopicProfile.GetNumOfIsotopesInProfile());
            Assert.AreEqual(2488.07303881522, Convert.ToDecimal(resultcollection.ResultList[8].IsotopicProfile.AverageMass));
            Assert.AreEqual(3, resultcollection.ResultList[8].IsotopicProfile.ChargeState);
            Assert.AreEqual(18802, Convert.ToDecimal(resultcollection.ResultList[8].IsotopicProfile.IntensityAggregate));
            Assert.AreEqual(2486.09777364184, Convert.ToDecimal(resultcollection.ResultList[8].IsotopicProfile.MonoIsotopicMass));
        }
コード例 #11
0
        public void examineRAWFile_Scan6757()
        {
            Run run = new XCaliburRun(xcaliburTestfile);

            run.MSParameters       = new DeconTools.Backend.Parameters.MSParameters();
            run.CurrentScanSet     = new ScanSet(6757);
            run.MSParameters.MinMZ = 0;
            run.MSParameters.MaxMZ = 10000;

            ResultCollection rc = new ResultCollection(run);

            Task msGen = new GenericMSGenerator(run.MSParameters.MinMZ, run.MSParameters.MaxMZ);

            msGen.Execute(rc);

            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 zeroFiller = new DeconToolsZeroFiller(3);
            //zeroFiller.Execute(rc);

            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            peakDetector.Execute(rc);

            Task decon = new RapidDeconvolutor();

            decon.Execute(rc);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < rc.ResultList.Count; i++)
            {
                IsosResult result = rc.ResultList[i];
                if (result.IsotopicProfile.Peaklist[0].XValue > 0 && result.IsotopicProfile.Peaklist[0].XValue < 10000)
                {
                    sb.Append(result.IsotopicProfile.Peaklist[0].XValue.ToString("0.00"));
                    sb.Append("\t");
                    sb.Append(result.IsotopicProfile.Score.ToString("0.00"));
                    sb.Append("\t");
                    sb.Append(result.IsotopicProfile.Peaklist[0].SN.ToString("0.0"));
                    sb.Append("\t");
                    sb.Append(result.Run.PeakList.Count);
                    sb.Append("\t");
                    sb.Append(result.Run.XYData.Xvalues.Length);

                    sb.Append("\n");
                }
            }
            Console.Write(sb.ToString());
        }
コード例 #12
0
        public void ExportMultipleScansTest1()
        {
            Run run = new IMFRun(imfFilepath);

            ScanSetCollection scanSetCollection = new ScanSetCollection();

            scanSetCollection.ScanSetList.Add(new ScanSet(232));
            scanSetCollection.ScanSetList.Add(new ScanSet(233));
            scanSetCollection.ScanSetList.Add(new ScanSet(234));

            ResultCollection results = new ResultCollection(run);

            foreach (ScanSet scanset in 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);

                Task decon = new RapidDeconvolutor();
                decon.Execute(results);

                Task scanResultUpdater = new ScanResultUpdater();
                scanResultUpdater.Execute(results);
            }

            Assert.AreEqual(3, results.ScanResultList.Count);

            Assert.AreEqual(92, results.ScanResultList[0].NumPeaks);
            Assert.AreEqual(82, results.ScanResultList[1].NumPeaks);
            Assert.AreEqual(72, results.ScanResultList[2].NumPeaks);

            Assert.AreEqual(11, results.ScanResultList[0].NumIsotopicProfiles);
            Assert.AreEqual(9, results.ScanResultList[1].NumIsotopicProfiles);
            Assert.AreEqual(9, results.ScanResultList[2].NumIsotopicProfiles);

            Assert.AreEqual(830.045752112968, (Decimal)results.ScanResultList[0].BasePeak.XValue);
            Assert.AreEqual(10438, results.ScanResultList[0].BasePeak.Height);
            Assert.AreEqual(0.09454554, (Decimal)results.ScanResultList[0].BasePeak.Width);
            Assert.AreEqual(434.9167, (Decimal)results.ScanResultList[0].BasePeak.SN);

            Exporter <ResultCollection> exporter = new BasicScansExporter(scansExporterTest1output);

            exporter.Export(results);
        }
コード例 #13
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);
        }
コード例 #14
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);
        }
コード例 #15
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);
                }
            }
        }
コード例 #16
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);
            }
        }
コード例 #17
0
        public void test1()
        {
            Project project = Project.getInstance();
            //TODO:  add project parameters  (for summing)

            Run run = new UIMFRun(uimfFilepath, 1200, 1202, 300, 400);

            project.RunCollection.Add(run);

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

            framesetCreator.Create();

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

            scanSetcreator.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;
            detectorParams.ThresholdedData        = false;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task rapidDecon = new RapidDeconvolutor();

            Task scanresultUpdater = new ScanResultUpdater();


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

            TaskController controller = new UIMF_TaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);

            UIMFScansExporter scansExporter = new UIMFScansExporter(uimfScansExporterTest1output);

            scansExporter.Export(project.RunCollection[0].ResultCollection);
        }
コード例 #18
0
        public void deconvoluteIMFDataTest1()
        {
            Run run = new IMFRun(imfFilepath);

            run.MSParameters   = new DeconTools.Backend.Parameters.MSParameters();
            run.CurrentScanSet = new ScanSet(233);

            ResultCollection results = new ResultCollection(run);

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

            Task rapid = new RapidDeconvolutor();

            rapid.Execute(results);

            Assert.AreEqual(9, results.ResultList.Count);
            Assert.AreEqual(582.820684517665, Convert.ToDecimal(results.ResultList[0].IsotopicProfile.Peaklist[0].XValue));
            Assert.AreEqual(2984.0, results.ResultList[0].IsotopicProfile.Peaklist[0].Height);
            Assert.AreEqual(0.05905123, (decimal)results.ResultList[0].IsotopicProfile.Peaklist[0].Width);
            Assert.AreEqual(157.0526, (decimal)results.ResultList[0].IsotopicProfile.Peaklist[0].SN);


            Assert.AreEqual(4593, results.ResultList[0].IsotopicProfile.GetAbundance());

            Assert.AreEqual(1, results.ResultList[8].IsotopicProfile.GetNumOfIsotopesInProfile());
            Assert.AreEqual(2488.07303881522, Convert.ToDecimal(results.ResultList[8].IsotopicProfile.AverageMass));
            Assert.AreEqual(3, results.ResultList[8].IsotopicProfile.ChargeState);
            Assert.AreEqual(18802, Convert.ToDecimal(results.ResultList[8].IsotopicProfile.IntensityAggregate));
            Assert.AreEqual(2486.09777364184, Convert.ToDecimal(results.ResultList[8].IsotopicProfile.MonoIsotopicMass));
            Assert.AreEqual(829.711934128853, Convert.ToDecimal(results.ResultList[8].IsotopicProfile.MonoPeakMZ));
        }
コード例 #19
0
        public void updateScanResultsOnXCaliburFileTest1()
        {
            Run run = new XCaliburRun(xcaliburTestfile, 6000, 7000);

            ScanSetCollection scansetCollection = new ScanSetCollection();

            for (int i = 6000; i < 6015; i++)
            {
                scansetCollection.ScanSetList.Add(new ScanSet(i));
            }

            ResultCollection results = new ResultCollection(run);

            foreach (ScanSet scanset in scansetCollection.ScanSetList)
            {
                run.CurrentScanSet = scanset;
                Task msgen = new GenericMSGenerator(0, 2000);
                msgen.Execute(results);

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

                Task rapid = new RapidDeconvolutor();
                rapid.Execute(results);

                Task scanResultUpdater = new ScanResultUpdater();
                scanResultUpdater.Execute(results);
            }

            Assert.AreEqual(2, results.ScanResultList.Count);
            Assert.AreEqual(1, results.ScanResultList[0].SpectrumType);
            Assert.AreEqual(481.274105402604, (decimal)results.ScanResultList[0].BasePeak.XValue);
            Assert.AreEqual(353, results.ScanResultList[0].NumIsotopicProfiles);

            Assert.AreEqual(2052, results.ScanResultList[0].NumPeaks);
            //Assert.AreEqual(2132, results.ScanResultList[0].NumPeaks);
            Assert.AreEqual(32.6941466666667, (decimal)results.ScanResultList[0].ScanTime);
            Assert.AreEqual(6005, results.ScanResultList[0].ScanSet.PrimaryScanNumber);

            Assert.AreEqual(362, results.ScanResultList[1].NumIsotopicProfiles);
            //Assert.AreEqual(370, results.ScanResultList[1].NumIsotopicProfiles);
            Assert.AreEqual(715, results.ResultList.Count);
        }
コード例 #20
0
        public void findMSFeaturesInOrbitrapData_Test1()
        {
            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);

            peakDetector.IsDataThresholded = true;

            RapidDeconvolutor decon = new RapidDeconvolutor();

            decon.IsNewFitCalculationPerformed = true;


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

            Assert.AreEqual(192, run.ResultCollection.ResultList.Count);

            //order and get the most intense msfeature
            run.ResultCollection.ResultList = run.ResultCollection.ResultList.OrderByDescending(p => p.IntensityAggregate).ToList();
            IsosResult testIso = run.ResultCollection.ResultList[0];

            Assert.AreEqual(20986588.375, testIso.IntensityAggregate);
            Assert.AreEqual(2, testIso.IsotopicProfile.ChargeState);
            Assert.AreEqual(0.00548633562231413m, (decimal)testIso.IsotopicProfile.Score);
            Assert.AreEqual(3, testIso.IsotopicProfile.Peaklist.Count);
            Assert.AreEqual(481.274105402604m, (decimal)testIso.IsotopicProfile.Peaklist[0].XValue);
            Assert.AreEqual(481.775412188198m, (decimal)testIso.IsotopicProfile.Peaklist[1].XValue);
            Assert.AreEqual(482.276820274024m, (decimal)testIso.IsotopicProfile.Peaklist[2].XValue);

            TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);
        }
コード例 #21
0
        public void updateScanResultsUIMFFileTest1()
        {
            UIMFRun run = new UIMFRun(uimfFilepath);

            run.FrameSetCollection = new FrameSetCollection();
            for (int i = 1200; i < 1203; i++)
            {
                run.FrameSetCollection.FrameSetList.Add(new FrameSet(i));
            }

            run.ScanSetCollection = new ScanSetCollection();
            for (int i = 200; i < 304; i++)
            {
                run.ScanSetCollection.ScanSetList.Add(new ScanSet(i));
            }
            StreamWriter     sw;
            ResultCollection results = new ResultCollection(run);

            Task msgen             = new UIMF_MSGenerator();
            Task peakDetector      = new DeconToolsPeakDetector();
            Task rapid             = new RapidDeconvolutor();
            Task scanResultUpdater = new ScanResultUpdater();
            Task peakListExporter  = new PeakListTextExporter(run.MSFileType, peakListoutputPath);


            foreach (FrameSet frameset in run.FrameSetCollection.FrameSetList)
            {
                ((UIMFRun)run).CurrentFrameSet = frameset;

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

                    peakDetector.Execute(results);

                    rapid.Execute(results);

                    scanResultUpdater.Execute(results);

                    peakListExporter.Execute(results);
                }
            }
            peakListExporter.Cleanup();

            Assert.AreEqual(3, results.ScanResultList.Count);
            Assert.AreEqual(1, results.ScanResultList[0].SpectrumType);
            Assert.AreEqual(670.990710325132, (decimal)results.ScanResultList[0].BasePeak.XValue);
            Assert.AreEqual(183, results.ScanResultList[0].NumIsotopicProfiles);

            Assert.AreEqual(7097, results.ScanResultList[0].NumPeaks);
            Assert.AreEqual(-1, (decimal)results.ScanResultList[0].ScanTime);

            UIMFScanResult uimfScanresult1 = (UIMFScanResult)(results.ScanResultList[0]);


            Assert.AreEqual(4.0, uimfScanresult1.FramePressureFront);
            Assert.AreEqual(4.016, uimfScanresult1.FramePressureBack);
            Assert.AreEqual(1200, uimfScanresult1.Frameset.PrimaryFrame);

            Assert.AreEqual(504, results.ResultList.Count);
        }
コード例 #22
0
        public void compareThrashRapidTest2()
        {
            IsosResultComparer comparer = new IsosResultComparer();
            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);

            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);
            List <IsosResult> thrashResults = new List <IsosResult>(Project.getInstance().RunCollection[0].ResultCollection.ResultList);


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



            List <IsosResult> rapidResults = new List <IsosResult>(Project.getInstance().RunCollection[0].ResultCollection.ResultList);

            Console.WriteLine("Thrash result count = " + thrashResults.Count);
            Console.WriteLine("RAPID result count = " + rapidResults.Count);


            List <IsosResult> intersectedResults  = comparer.GetIntersectionBetweenTwoIsosResultSets(thrashResults, rapidResults);
            List <IsosResult> intersectedResults2 = comparer.GetIntersectionTheManualWay(thrashResults, rapidResults);
            //List<IsosResult> intersectedResults3 = comparer.GetIntersectionTheManualWay(rapidResults, thrashResults);

            List <IsosResult> unmatchedResults1 = comparer.GetUniqueBetweenTwoIsosResultSets(rapidResults, thrashResults);
            List <IsosResult> unmatchedResults2 = comparer.GetUniqueBetweenTwoIsosResultSets(thrashResults, rapidResults);

            Console.WriteLine("Intersected result count = " + intersectedResults.Count);
            Console.WriteLine("Manual Intersected result count = " + intersectedResults2.Count);
            //Console.WriteLine("Manual Intersected result count = " + intersectedResults3.Count);

            Console.WriteLine("unmatched result count = " + unmatchedResults1.Count);
            Console.WriteLine("unmatched result count2 = " + unmatchedResults2.Count);
        }
コード例 #23
0
        public void test1()
        {
            Project.Reset();
            Project project = Project.getInstance();

            UIMFRun run = new UIMFRun(uimfFilepath, 1200, 1202);

            project.RunCollection.Add(run);

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

            sscc.Create();

            FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, 1, 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;
            detectorParams.ThresholdedData        = false;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task rapidDecon = new RapidDeconvolutor();

            Task scanResultsUpdater = new ScanResultUpdater();

            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(rapidDecon);
            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);



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

            Assert.AreEqual(600, project.RunCollection[0].ScanSetCollection.ScanSetList.Count);

            UIMFRun uimfRun = (UIMFRun)(project.RunCollection[0]);

            Assert.AreEqual(3, uimfRun.FrameSetCollection.FrameSetList.Count);


            StringBuilder sb = new StringBuilder();

            foreach (IsosResult result in project.RunCollection[0].ResultCollection.ResultList)
            {
                Assert.IsInstanceOfType(typeof(UIMFIsosResult), result);
                UIMFIsosResult uimfResult = (UIMFIsosResult)result;
                sb.Append(uimfResult.FrameSet.PrimaryFrame);
                sb.Append("\t");
                sb.Append(uimfResult.ScanSet.PrimaryScanNumber);
                sb.Append("\t");
                sb.Append(uimfResult.IsotopicProfile.Peaklist[0].XValue);
                sb.Append("\t");
                sb.Append(uimfResult.IsotopicProfile.GetAbundance());
                sb.Append("\t");
                //sb.Append(uimfResult.IsotopicProfile.
                sb.Append(Environment.NewLine);
            }
            Console.Write(sb.ToString());
        }
コード例 #24
0
        public void UIMF_and_IMF_Nosumming_Test1()
        {
            Run uimfrun = new UIMFRun(uimfFilepath);
            Run imfRun  = new IMFRun(imfFrame1200filepath);

            int startFrame = 1200;
            int stopFrame  = 1200;

            int numFramesSummed = 1;
            int numScansSummed  = 1;

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

            framesetCreator.Create();

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

            scanSetCreator.Create();

            ResultCollection uimfResults = new ResultCollection(uimfrun);

            //first analyze the UIMF file....
            foreach (FrameSet frameset in ((UIMFRun)uimfrun).FrameSetCollection.FrameSetList)
            {
                System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();

                ((UIMFRun)uimfrun).CurrentFrameSet = frameset;
                foreach (ScanSet scanset in uimfrun.ScanSetCollection.ScanSetList)
                {
                    uimfrun.CurrentScanSet = scanset;
                    Task msgen = new UIMF_MSGenerator(0, 2000);
                    msgen.Execute(uimfResults);

                    Task peakDetector = new DeconToolsPeakDetector();
                    peakDetector.Execute(uimfResults);

                    Task rapid = new RapidDeconvolutor();
                    rapid.Execute(uimfResults);

                    Task scanResultUpdater = new ScanResultUpdater();
                    scanResultUpdater.Execute(uimfResults);
                }
            }

            //next analyze the IMF file for the corresponding frame
            scanSetCreator = new ScanSetCollectionCreator(imfRun, 0, 599, numScansSummed, 1);
            scanSetCreator.Create();

            ResultCollection imfResults = new ResultCollection(imfRun);

            foreach (ScanSet scanset in imfRun.ScanSetCollection.ScanSetList)
            {
                imfRun.CurrentScanSet = scanset;
                Task msgen = new GenericMSGenerator(0, 2000);
                msgen.Execute(imfResults);

                Task peakDetector = new DeconToolsPeakDetector();
                peakDetector.Execute(imfResults);

                Task rapid = new RapidDeconvolutor();
                rapid.Execute(imfResults);

                Task scanResultUpdater = new ScanResultUpdater();
                scanResultUpdater.Execute(imfResults);
            }

            Console.WriteLine("imfScanSetCount = " + imfResults.Run.ScanSetCollection.ScanSetList.Count);
            Console.WriteLine("UIMFScanSetCount = " + uimfResults.Run.ScanSetCollection.ScanSetList.Count);

            Console.WriteLine("IMF scan0 peaks = " + imfResults.ScanResultList.Sum(p => p.NumPeaks));
            Console.WriteLine("UIMF scan0 peaks = " + uimfResults.ScanResultList[0].NumPeaks);

            Console.WriteLine("imfResultCount = " + imfResults.ResultList.Count);
            Console.WriteLine("UIMFResultCount = " + uimfResults.ResultList.Count);


            for (int i = 0; i < uimfResults.ResultList.Count; i++)
            {
                Console.Write(getResultSummary(uimfResults.ResultList[i]));
                Console.Write(getResultSummary(imfResults.ResultList[i]));
                Console.Write("\n");
            }
        }
コード例 #25
0
        public void serializerWriteAllResultsTest1()
        {
            Run run = new XCaliburRun(xcaliburTestfile1, 4000, 5000);

            const int RESULTTHRESHOLD = 10000000;

            if (File.Exists(serializedResultFilename1))
            {
                File.Delete(serializedResultFilename1);
            }

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

            scansetCreator.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        = 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);

            IsosResultSerializer serializer = new IsosResultSerializer(serializedResultFilename1, System.IO.FileMode.Append, true);

            for (int i = 0; i < run.ScanSetCollection.ScanSetList.Count; i++)
            {
                run.CurrentScanSet = run.ScanSetCollection.ScanSetList[i];

                foreach (Task task in taskcollection.TaskList)
                {
                    task.Execute(run.ResultCollection);
                }


                //if (run.ResultCollection.ResultList.Count > RESULTTHRESHOLD)
                //{
                //    serializer.Serialize();

                //}
            }
            serializer.Serialize(run.ResultCollection);
            serializer.Close();
            Console.WriteLine(run.ResultCollection.ResultList.Count);

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

            FileInfo fi = new FileInfo(serializedResultFilename1);

            Assert.AreEqual(2355525, fi.Length);
            Assert.AreEqual(11147, run.ResultCollection.ResultList.Count);
        }
コード例 #26
0
        public void multiIMFFileRAPIDDTest1()
        {
            imfFileList.Clear();
            imfFileList.Add("..\\..\\TestFiles\\50ugpmlBSA_CID_QS_16V_0000.Accum_1.IMF");
            imfFileList.Add("..\\..\\TestFiles\\50ugpmlBSA_CID_QS_16V_0000.Accum_2.IMF");
            imfFileList.Add("..\\..\\TestFiles\\50ugpmlBSA_CID_SQ_14V_0000.Accum_1.IMF");

            Project.Reset();

            Project project = Project.getInstance();

            foreach (string strItem in imfFileList)
            {
                Run run = new IMFRun(strItem, 200, 299);

                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(3, project.RunCollection.Count);
            Assert.AreEqual(3, project.TaskCollection.TaskList.Count);

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


            int totalScans    = 0;
            int totalFeatures = 0;

            for (int i = 0; i < project.RunCollection.Count; i++)
            {
                Console.WriteLine("Run name = " + project.RunCollection[i].Filename);
                Console.WriteLine("Scans analyzed = " + project.RunCollection[i].ScanSetCollection.ScanSetList.Count);
                Console.WriteLine("Features found = " + project.RunCollection[i].ResultCollection.ResultList.Count);

                totalFeatures += project.RunCollection[i].ResultCollection.ResultList.Count;
                totalScans    += project.RunCollection[i].ScanSetCollection.ScanSetList.Count;
            }
            Console.WriteLine("------------------------------------------------");
            Console.WriteLine("Total Features found = " + totalFeatures);
            Console.WriteLine("Total Scans = " + totalScans);
            Console.WriteLine("Total Time required (ms) = " + sw.ElapsedMilliseconds);
        }