Пример #1
0
        public void test1()
        {
            Run run = new XCaliburRun(lowmwRawfile);

            ResultCollection results = new ResultCollection(run);

            run.CurrentScanSet = new ScanSet(1);
            Task msgen = new GenericMSGenerator(0, 1000);

            msgen.Execute(results);

            DeconToolsPeakDetector peakdetector = new DeconToolsPeakDetector();

            peakdetector.PeakBackgroundRatio = 0.5;
            peakdetector.PeakFitType         = DeconTools.Backend.Globals.PeakFitType.QUADRATIC;
            peakdetector.SigNoiseThreshold   = 3;
            peakdetector.IsDataThresholded   = true;
            peakdetector.Execute(results);

            //Task rapidDecon = new RapidDeconvolutor();
            //rapidDecon.Execute(results);

            Task simpleDecon = new SimpleDecon(0.0005);

            simpleDecon.Execute(results);

            Console.WriteLine(results.Run.PeakList.Count);
            Console.WriteLine(results.ResultList.Count);


            string reportedResults = reportResults(results.ResultList);

            Console.WriteLine(reportedResults);
        }
Пример #2
0
        public void test1()
        {
            Run run = new ICR2LSRun(icr2LSRawDatafile1);

            run.CurrentScanSet = new ScanSet(2210);

            Task msGen = new GenericMSGenerator(732, 746);

            msGen.Execute(run.ResultCollection);

            Task peakdetector = new DeconToolsPeakDetector();

            ((DeconToolsPeakDetector)peakdetector).PeakBackgroundRatio = 5;
            ((DeconToolsPeakDetector)peakdetector).SigNoiseThreshold   = 2;

            peakdetector.Execute(run.ResultCollection);

            Console.WriteLine("Peaks detected = " + run.PeakList.Count);

            TomN14N15Analyzer analyzer = new TomN14N15Analyzer();

            analyzer.ExtractN14N15Values(run.ResultCollection);

            Console.WriteLine("Peaks detected = " + run.PeakList.Count);

            Assert.AreEqual(14, run.PeakList.Count);
        }
Пример #3
0
        public void effectOfFWHMOnFitTest()
        {
            Run run = new XCaliburRun2(xcaliburTestfile);

            var results = new ResultCollection(run);

            run.CurrentScanSet = new ScanSet(6005);

            var  isTicRequested = false;
            Task msGen          = new GenericMSGenerator(1154, 1160, isTicRequested);

            msGen.Execute(results);

            Task peakDetector = new DeconToolsPeakDetectorV2(0.5, 3, Globals.PeakFitType.QUADRATIC, false);

            peakDetector.Execute(results);


            Task decon = new HornDeconvolutor();

            decon.Execute(results);

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



            var distcreator = new MercuryDistributionCreator();

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

            var sb = new StringBuilder();

            var areafitter = new AreaFitter();
            var fitval     = areafitter.GetFit(distcreator.Data, run.XYData, 10);

            sb.Append(resolution);
            sb.Append("\t");
            sb.Append(fitval);
            sb.Append("\n");

            for (var fwhm = 0.001; fwhm < 0.050; fwhm = fwhm + 0.0005)
            {
                distcreator = new MercuryDistributionCreator();
                resolution  = result1.IsotopicProfile.GetMZofMostAbundantPeak() / fwhm;

                distcreator.CreateDistribution(result1.IsotopicProfile.MonoIsotopicMass, result1.IsotopicProfile.ChargeState, resolution);
                distcreator.OffsetDistribution(result1.IsotopicProfile);
                areafitter = new AreaFitter();
                fitval     = areafitter.GetFit(distcreator.Data, run.XYData, 10);

                sb.Append(resolution);
                sb.Append("\t");
                sb.Append(fitval);
                sb.Append("\n");
            }

            //Console.Write(sb.ToString());
        }
Пример #4
0
        public void fitterOnHornDataTest1()
        {
            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);


            DeconToolsV2.HornTransform.clsHornTransformParameters hornParameters = new DeconToolsV2.HornTransform.clsHornTransformParameters();
            hornParameters.PeptideMinBackgroundRatio = 2;

            Task decon = new HornDeconvolutor(hornParameters);

            decon.Execute(results);


            IsosResult result1 = results.ResultList[0];


            MercuryDistributionCreator distcreator = new MercuryDistributionCreator();
            double resolution = result1.IsotopicProfile.GetMZofMostAbundantPeak() / result1.IsotopicProfile.GetFWHM();

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

            Assert.AreEqual(0.0209385414928986, (decimal)fitval);    //TODO: fix this test... i'm getting 0.0207350903681061m
        }
        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 fitterOnHornDataTest2()
        {
            Run run = new XCaliburRun(xcaliburTestfile);

            ResultCollection results = new ResultCollection(run);

            run.CurrentScanSet = new ScanSet(6005);


            Task msGen = new GenericMSGenerator(579, 582);

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

            decon.Execute(results);


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

            MercuryDistributionCreator distcreator = new MercuryDistributionCreator();

            distcreator.CreateDistribution(result1.IsotopicProfile.MonoIsotopicMass, result1.IsotopicProfile.ChargeState, resolution);
            StringBuilder sb          = new StringBuilder();
            XYData        theorXYData = distcreator.Data;

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



            distcreator.OffsetDistribution(result1.IsotopicProfile);



            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.0704215577242672, (decimal)fitval);
        }
Пример #7
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);
        }
Пример #8
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);
        }
        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());
            }
        }
Пример #10
0
        public void MSGeneratorOnAgilentDFileTest1()
        {
            Run run = new AgilentD_Run(agilentDTestFile);

            run.CurrentScanSet = new ScanSet(25);

            Task msGen = new GenericMSGenerator();

            msGen.Execute(run.ResultCollection);
        }
Пример #11
0
        public void MSGeneratoronTextFileTest2()
        {
            Run run = new MSScanFromTextFileRun(textFile1);

            Task msgen = new GenericMSGenerator();

            msgen.Execute(run.ResultCollection);

            Assert.AreEqual(19716, run.XYData.Xvalues.Length);
        }
Пример #12
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));
        }
Пример #13
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());
        }
        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);
        }
Пример #15
0
        public void MSGeneratorOnTextfileTest1()
        {
            Run run = new MSScanFromTextFileRun(imfMSScanTextfile, Globals.XYDataFileType.Textfile);
            ResultCollection resultcollection = new ResultCollection(run);

            Task msgen = new GenericMSGenerator();

            msgen.Execute(resultcollection);

            Assert.AreEqual(2596, resultcollection.Run.XYData.Xvalues.Length);
        }
Пример #16
0
        public void fitterOnHornDataTest1()
        {
            Run run = new XCaliburRun2(xcaliburTestfile);

            var results = new ResultCollection(run);

            run.CurrentScanSet = new ScanSet(6067);

            var  isTicRequested = false;
            Task msGen          = new GenericMSGenerator(1154, 1158, isTicRequested);

            msGen.Execute(results);

            Task peakDetector = new DeconToolsPeakDetectorV2(0.5, 3, Globals.PeakFitType.QUADRATIC, false);

            peakDetector.Execute(results);

            var deconParameters = new DeconToolsParameters();

            deconParameters.ThrashParameters.MinMSFeatureToBackgroundRatio = 2;     // PeptideMinBackgroundRatio

            Task decon = new HornDeconvolutor(deconParameters);

            decon.Execute(results);


            var result1 = results.ResultList[0];


            var distcreator = new MercuryDistributionCreator();
            var resolution  = result1.IsotopicProfile.GetMZofMostAbundantPeak() / result1.IsotopicProfile.GetFWHM();

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



            var theorXYData = distcreator.Data;

            //StringBuilder sb = new StringBuilder();
            //TestUtilities.GetXYValuesToStringBuilder(sb, theorXYData.Xvalues, theorXYData.Yvalues);

            //Console.WriteLine(sb.ToString());

            var areafitter = new AreaFitter();
            var fitval     = areafitter.GetFit(theorXYData, run.XYData, 10);

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

            Assert.AreEqual(0.0207350903681061m, (decimal)fitval);    //TODO: fix this test... i'm getting 0.0207350903681061m
        }
Пример #17
0
        public void fitterOnHornDataTest2()
        {
            Run run = new XCaliburRun2(xcaliburTestfile);

            var results = new ResultCollection(run);

            run.CurrentScanSet = new ScanSet(6005);

            var  isTicRequested = false;
            Task msGen          = new GenericMSGenerator(579, 582, isTicRequested);

            msGen.Execute(results);

            Task peakDetector = new DeconToolsPeakDetectorV2(0.5, 3, Globals.PeakFitType.QUADRATIC, false);

            peakDetector.Execute(results);


            Task decon = new HornDeconvolutor();

            decon.Execute(results);


            var result1    = results.ResultList[1];
            var resolution = result1.IsotopicProfile.GetMZofMostAbundantPeak() / result1.IsotopicProfile.GetFWHM();

            var distcreator = new MercuryDistributionCreator();

            distcreator.CreateDistribution(result1.IsotopicProfile.MonoIsotopicMass, result1.IsotopicProfile.ChargeState, resolution);
            var sb          = new StringBuilder();
            var theorXYData = distcreator.Data;

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



            distcreator.OffsetDistribution(result1.IsotopicProfile);



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

            //Console.WriteLine(sb.ToString());

            var areafitter = new AreaFitter();
            var fitval     = areafitter.GetFit(theorXYData, run.XYData, 10);

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

            Assert.AreEqual(0.0763818319332606m, (decimal)fitval);
        }
Пример #18
0
        public void fitterOnRapidDataTest1()
        {
            Run run = new XCaliburRun2(xcaliburTestfile);

            ResultCollection results = new ResultCollection(run);

            run.CurrentScanSet = new ScanSet(6067);

            bool isTicRequested = false;
            Task msGen          = new GenericMSGenerator(1154, 1158, isTicRequested);

            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 DeconToolsPeakDetectorV2(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;

            // theorXYData.Display();

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

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

            Assert.AreEqual(0.0207350903681061m, (decimal)fitval);
        }
        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);
        }
Пример #20
0
        public void MSGeneratorOnIMFFileTest2()
        {
            Run run = new IMFRun(imfFilepath);

            run.CurrentScanSet = new ScanSet(233, 229, 237);

            Task msgen = new GenericMSGenerator();

            msgen.Execute(run.ResultCollection);

            Assert.AreEqual(9917, run.XYData.Xvalues.Length);
            Assert.AreEqual(1, run.GetMSLevel(run.CurrentScanSet.PrimaryScanNumber));
        }
Пример #21
0
        public void DeconToolsPeakDetectionTest1()
        {
            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);

            Assert.AreEqual(82, resultcollection.Run.PeakList.Count);
            Assert.AreEqual(167.243318707619, Convert.ToDecimal(resultcollection.Run.CurrentScanSet.BackgroundIntensity));

            detectorParams.PeakBackgroundRatio = 2;
            peakdetector = new DeconToolsPeakDetector(detectorParams);
            peakdetector.Execute(resultcollection);
            Assert.AreEqual(154, resultcollection.Run.PeakList.Count);
            Assert.AreEqual(167.243318707619, Convert.ToDecimal(resultcollection.Run.CurrentScanSet.BackgroundIntensity));

            detectorParams.PeakBackgroundRatio    = 2;
            detectorParams.SignalToNoiseThreshold = 1;
            peakdetector = new DeconToolsPeakDetector(detectorParams);
            peakdetector.Execute(resultcollection);
            Assert.AreEqual(156, resultcollection.Run.PeakList.Count);
            Assert.AreEqual(167.243318707619, Convert.ToDecimal(resultcollection.Run.CurrentScanSet.BackgroundIntensity));

            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.SignalToNoiseThreshold = 3;
            detectorParams.ThresholdedData        = true;
            peakdetector = new DeconToolsPeakDetector(detectorParams);
            peakdetector.Execute(resultcollection);

            Task scanresultUpdater = new ScanResultUpdater();

            scanresultUpdater.Execute(resultcollection);

            Assert.AreEqual(82, resultcollection.Run.PeakList.Count);
            Assert.AreEqual(1, resultcollection.ScanResultList.Count);
            Assert.AreEqual(82, resultcollection.ScanResultList[0].NumPeaks);
            Assert.AreEqual(167.243318707619, Convert.ToDecimal(resultcollection.Run.CurrentScanSet.BackgroundIntensity));
        }
Пример #22
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);
        }
Пример #23
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);
        }
Пример #24
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);
        }
Пример #25
0
        public void MSGeneratorOnXCaliburFileTest1()
        {
            Run run = new XCaliburRun(xcaliburTestfile);

            run.CurrentScanSet = new ScanSet(6067);

            ResultCollection resultcollection = new ResultCollection(run);
            Task             msgen            = new GenericMSGenerator();

            msgen.Execute(resultcollection);

            Assert.AreEqual(27053, run.XYData.Xvalues.Length);
            Assert.AreEqual(1, run.GetMSLevel(run.CurrentScanSet.PrimaryScanNumber));
            Assert.AreEqual(3558996224, (long)run.CurrentScanSet.TICValue);
        }
Пример #26
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();
        }
Пример #27
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);
                }
            }
        }
Пример #28
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);
            }
        }
Пример #29
0
        public void exportToSqliteTest1()
        {
            if (File.Exists(sqliteOutfileName))
            {
                File.Delete(sqliteOutfileName);
            }

            Run run = new XCaliburRun(xcaliburTestfile);

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

            scansetCreator.Create();

            Task msgen        = new GenericMSGenerator();
            Task peakDetector = new DeconToolsPeakDetector();

            ((DeconToolsPeakDetector)peakDetector).StorePeakData = true;

            Task exporter = new PeakListSQLiteExporter(1000000, sqliteOutfileName);     //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);

                Stopwatch sw = new Stopwatch();
                sw.Start();
                exporter.Execute(run.ResultCollection);
                sw.Stop();
                if (sw.ElapsedMilliseconds > 5)
                {
                    Console.WriteLine("PeakListExporter execution time = " + sw.ElapsedMilliseconds);
                }
            }

            exporter.Cleanup();
            Assert.AreEqual(true, File.Exists(sqliteOutfileName));

            FileInfo fi = new FileInfo(sqliteOutfileName);

            Assert.AreEqual(81920, fi.Length);
            Console.Write(fi.Length);
        }
Пример #30
0
        public void FindMSPeaksTest1()
        {
            ParameterLoader loader = new ParameterLoader();

            loader.LoadParametersFromFile(parameterFilename);

            Run run = new IMFRun(imfFilepath);


            run.CurrentScanSet = new ScanSet(1, 1, 100000);

            ResultCollection resultcollection = new ResultCollection(run);

            Task msgen = new GenericMSGenerator();

            msgen.Execute(resultcollection);

            DeconToolsPeakDetector peakfinder = new DeconToolsPeakDetector(loader.PeakParameters);

            peakfinder.Execute(resultcollection);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < resultcollection.Run.PeakList.Count; i++)
            {
                MSPeak mspeak = (MSPeak)resultcollection.Run.PeakList[i];


                sb.Append(resultcollection.Run.PeakList[i].XValue);
                sb.Append("\t");
                sb.Append(resultcollection.Run.PeakList[i].Height);
                sb.Append("\t");
                sb.Append(mspeak.SN);
                sb.Append("\t");
                sb.Append(resultcollection.Run.PeakList[i].Width);
                sb.Append("\t");
                sb.Append(Environment.NewLine);
            }
            Console.Write(sb.ToString());

            Assert.AreEqual(2438, resultcollection.Run.PeakList.Count);
            Assert.AreEqual(547.316411323136, Convert.ToDecimal(resultcollection.Run.PeakList[982].XValue));
            Assert.AreEqual(100385, resultcollection.Run.PeakList[982].Height);
        }