public void findMSFeaturesInOrbitrapData_Test1()
        {
            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            var scanSet = new ScanSet(6005);

            run.CurrentScanSet = scanSet;


            var msgen        = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);
            var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true);
            var decon        = new HornDeconvolutor();

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

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

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

            Assert.AreEqual(13084442, testIso.IntensityAggregate);
            Assert.AreEqual(2, testIso.IsotopicProfile.ChargeState);
            Assert.AreEqual(0.01012m, (decimal)Math.Round(testIso.IsotopicProfile.Score, 5));
            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);
            // TestUtilities.DisplayPeaks(run.PeakList);
        }
Ejemplo n.º 2
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());
        }
        public void deconWithTHRASH_Then_ValidateTest1()
        {
            Run run     = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);
            var scanSet = new ScanSet(6005);

            run.CurrentScanSet = scanSet;

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

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

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

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

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

            //TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);
        }
        public void 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);
        }
Ejemplo n.º 5
0
        public void OldDeconvolutorTest_temp1()
        {
            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

#if !Disable_DeconToolsV2
            var parameters = new DeconEngineClasses.OldDecon2LSParameters();
            var paramFile  =
                @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\ParameterFiles\LTQ_Orb_SN2_PeakBR1pt3_PeptideBR1_Thrash_MaxFit1.xml";
            parameters.Load(paramFile);

            var scanSet = new ScanSetFactory().CreateScanSet(run, 6005, 1);

            var msgen        = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);
            var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true);

            var deconvolutor = new HornDeconvolutor(parameters.GetDeconToolsParameters());
            run.CurrentScanSet = scanSet;
            msgen.Execute(run.ResultCollection);
            peakDetector.Execute(run.ResultCollection);
            deconvolutor.Execute(run.ResultCollection);

            run.ResultCollection.ResultList = run.ResultCollection.ResultList.OrderByDescending(p => p.IntensityAggregate).ToList();

            TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);

            //IsosResult testIso = run.ResultCollection.ResultList[0];

            //TestUtilities.DisplayIsotopicProfileData(testIso.IsotopicProfile);

            //TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);
            //TestUtilities.DisplayPeaks(run.PeakList);
#endif
        }
Ejemplo n.º 6
0
        public void getMSMSDataTest1()
        {
            //Create the run
            var runFactory = new RunFactory();
            var run        = runFactory.CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            //Create the task
            Task msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);

            var peakdetector = new DeconToolsPeakDetectorV2();

            var startScan = 6000;
            var stopScan  = 7000;

            for (var i = startScan; i < stopScan; i++)
            {
                if (run.GetMSLevel(i) == 2)
                {
                    var scanset = new ScanSet(i);
                    run.CurrentScanSet = scanset;
                    msgen.Execute(run.ResultCollection);
                    peakdetector.Execute(run.ResultCollection);

                    Console.Write("Working on Scan " + scanset.PrimaryScanNumber);
                    Console.WriteLine("; XYPair count = " + run.XYData.Xvalues.Length);

                    Console.WriteLine("num peaks= " + run.PeakList.Count);
                }
            }
        }
Ejemplo n.º 7
0
        public void PeakDetectorDemo1()
        {
            //In this list on Scan 6005 we can see what the peak of the parent is. Slide 4 1059.45898 is the Monoisotopic peak of Scan 6009
            var run = new RunFactory().CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            var testScan = new ScanSet(6009);

            run.CurrentScanSet = testScan;

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

            var peakDetector = new DeconToolsPeakDetectorV2();

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

            var sb = new StringBuilder();

            foreach (var peak in run.PeakList)
            {
                sb.Append(peak.XValue + "\t" + peak.Height + "\t" + peak.Width + "\n");
            }

            Console.WriteLine("----------------------PeakList---------------");
            Console.WriteLine("m/z\tintensity\twidth");
            Console.WriteLine(sb.ToString());
        }
        public void peak_interference_UIMF_expectInterference_test1()
        {
            var uimfFrame1200_142 = FileRefs.RawDataBasePath + @"\UIMF\Sarc_MS_90_21Aug10_Cheetah_10-08-02_0000_frame1200_scan142.txt";

            Run run = new DeconTools.Backend.Runs.MSScanFromTextFileRun(uimfFrame1200_142);

            var scanSet = new ScanSet(0);

            run.CurrentScanSet = scanSet;

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

            msgen.MinMZ = 200;
            msgen.MaxMZ = 2000;

            var peakDetector = new DeconToolsPeakDetectorV2(4, 3, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true);

            var decon = new HornDeconvolutor();

            decon.MinIntensityForScore     = 10;
            decon.DeleteIntensityThreshold = 10;
            decon.MaxFitAllowed            = 0.4;
            decon.MinMZ         = 200;
            decon.MaxMZ         = 2000;
            decon.IsMZRangeUsed = false;


            var zeroFiller = new DeconToolsZeroFiller();

            msgen.Execute(run.ResultCollection);
            zeroFiller.Execute(run.ResultCollection);

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

            //Assert.AreEqual(93, run.ResultCollection.ResultList.Count);

            var testResult = run.ResultCollection.ResultList.Where(p => p.IsotopicProfile.MonoPeakMZ > 428 && p.IsotopicProfile.MonoPeakMZ < 430).First();

            var monoPeak = testResult.IsotopicProfile.getMonoPeak();
            var lastPeak = testResult.IsotopicProfile.Peaklist[testResult.IsotopicProfile.Peaklist.Count - 1];

            var startIndexOfXYData = MathUtils.BinarySearchWithTolerance(run.XYData.Xvalues, monoPeak.XValue - 3, 0, (run.XYData.Xvalues.Length - 1), 2);

            //interference scorer

            var interferenceScorer = new InterferenceScorer();

            var stopwatch = new Stopwatch();

            stopwatch.Start();
            var scanPeaks         = run.PeakList.Select <Peak, MSPeak>(i => (MSPeak)i).ToList();
            var interferenceScore = interferenceScorer.GetInterferenceScore(scanPeaks, testResult.IsotopicProfile.Peaklist, monoPeak.XValue - 1.1,
                                                                            lastPeak.XValue + lastPeak.Width);

            stopwatch.Stop();

            Console.WriteLine("interference= " + interferenceScore);
            Console.WriteLine("Time taken = " + stopwatch.ElapsedMilliseconds);
        }
        public void PeakDetectorOnCentroidedDataTest1()
        {
            var run = new RunFactory().CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            var scan = new ScanSet(6006);   //this is a centroided MS2 scan


            var msgen        = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);
            var peakDetector = new DeconToolsPeakDetectorV2(0, 0, Globals.PeakFitType.QUADRATIC, true);

            peakDetector.RawDataType       = Globals.RawDataType.Centroided;
            peakDetector.IsDataThresholded = true;

            run.CurrentScanSet = scan;

            msgen.Execute(run.ResultCollection);

            peakDetector.Execute(run.ResultCollection);

            Console.WriteLine("Num XY datapoints in mass spectrum= " + run.XYData.Xvalues.Length);
            Console.WriteLine("numPeaks = " + run.PeakList.Count);

            Assert.AreEqual(run.XYData.Xvalues.Length, run.PeakList.Count);
            //TestUtilities.DisplayXYValues(run.XYData);
            //TestUtilities.DisplayPeaks(run.PeakList);
        }
        public void PeakDetectorOnCentroidedDataTest2()
        {
            var run = new RunFactory().CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            var scan = new ScanSet(6006);   //this is a MS2 scan


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

            // Note that setting the PeakFitType to Apex will not matter since RawDataType is Centroided
            // It would only matter if the RawDataType was Profile

            var peakDetector = new DeconToolsPeakDetectorV2(0, 0, Globals.PeakFitType.APEX, true);

            peakDetector.RawDataType            = Globals.RawDataType.Centroided;
            peakDetector.SignalToNoiseThreshold = 0;
            peakDetector.PeakToBackgroundRatio  = 0;
            peakDetector.IsDataThresholded      = true;

            run.CurrentScanSet = scan;

            msgen.Execute(run.ResultCollection);

            peakDetector.Execute(run.ResultCollection);

            Console.WriteLine("Num XY datapoints in mass spectrum= " + run.XYData.Xvalues.Length);
            Console.WriteLine("numPeaks = " + run.PeakList.Count);

            Assert.AreEqual(run.XYData.Xvalues.Length, run.PeakList.Count);
            //TestUtilities.DisplayXYValues(run.XYData);
            //TestUtilities.DisplayPeaks(run.PeakList);
        }
        public void CheckBackgroundIntensityTest1()
        {
            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            var scan = new ScanSet(6005);

            var msgen        = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);
            var peakDetector = new DeconToolsPeakDetectorV2();

            peakDetector.PeakToBackgroundRatio  = 1.3;
            peakDetector.SignalToNoiseThreshold = 2;
            peakDetector.PeakFitType            = Globals.PeakFitType.QUADRATIC;
            peakDetector.IsDataThresholded      = true;


            var oldPeakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true);

            peakDetector.IsDataThresholded = true;

            run.CurrentScanSet = scan;
            msgen.Execute(run.ResultCollection);

            peakDetector.Execute(run.ResultCollection);
            oldPeakDetector.Execute(run.ResultCollection);

            //Assert.AreEqual(peakDetector.BackgroundIntensity, oldPeakDetector.BackgroundIntensity);
        }
Ejemplo n.º 12
0
        public void DetectPeaksInOrbitrapData()
        {
            var    peakBR        = 1.3;
            double sigNoise      = 2;
            var    isThresholded = true;
            var    peakfitType   = DeconTools.Backend.Globals.PeakFitType.QUADRATIC;

            var testFile = FileRefs.RawDataMSFiles.OrbitrapStdFile1;

            Run run = new XCaliburRun2(testFile);

            //create list of target scansets
            run.ScanSetCollection.Create(run, 6000, 6015, 1, 1);


            //in the 'run' object there is now a list of scans : run.ScanSetCollection
            var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);


            var peakDet = new DeconToolsPeakDetectorV2(peakBR, sigNoise, peakfitType, isThresholded);

            peakDet.PeaksAreStored = true;

            foreach (var scan in run.ScanSetCollection.ScanSetList)
            {
                //set the target scan:
                run.CurrentScanSet = scan;

                msgen.Execute(run.ResultCollection);
                peakDet.Execute(run.ResultCollection);
            }
        }
Ejemplo n.º 13
0
        public void SpeedTest1()
        {
            var fileName = FileRefs.RawDataMSFiles.OrbitrapStdFile1;
            var run      = new RunFactory().CreateRun(fileName);

            run.ScanSetCollection.Create(run, 5500, 5550, 1, 1, false);
            var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);

            var peakBr       = 1.3;//0.25;
            var peakDetector = new DeconToolsPeakDetectorV2(peakBr, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true);

            var thrashParameters = new ThrashParameters();

            thrashParameters.MinMSFeatureToBackgroundRatio = peakBr;
            thrashParameters.MaxFit = 0.4;

            var newDeconvolutor = new InformedThrashDeconvolutor(thrashParameters);

            var watch = new Stopwatch();

            watch.Start();
            foreach (var scanSet in run.ScanSetCollection.ScanSetList)
            {
                run.CurrentScanSet = scanSet;
                msgen.Execute(run.ResultCollection);
                peakDetector.Execute(run.ResultCollection);
                run.CurrentScanSet.BackgroundIntensity = peakDetector.BackgroundIntensity;
                newDeconvolutor.Execute(run.ResultCollection);
            }
            watch.Stop();

            Console.WriteLine("Time per scan (INFORMED) = " + watch.ElapsedMilliseconds / run.ScanSetCollection.ScanSetList.Count);
        }
Ejemplo n.º 14
0
        public void Test1()
        {
            string testfile = @"D:\Data\From_Nicola\AC2_Neg_highpH_14Apr13_Sauron_13-04-03.raw";

            Run run = new RunFactory().CreateRun(testfile);

            TestUtilities.DisplayRunInformation(run);

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

            ScanSet scanSet = new ScanSet(4100);

            run.CurrentScanSet = scanSet;

            msgen.Execute(run.ResultCollection);

            DeconToolsPeakDetectorV2 peakDetector = new DeconToolsPeakDetectorV2();

            peakDetector.Execute(run.ResultCollection);

            run.PeakList = run.PeakList.Where(p => p.XValue > 742 && p.XValue < 749).ToList();

            HornDeconvolutor hornDeconvolutor = new HornDeconvolutor();

            hornDeconvolutor.ChargeCarrierMass = -1.00727649;

            hornDeconvolutor.Execute(run.ResultCollection);

            TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);
        }
        public static Run CreateResultsFromThreeScansOfStandardOrbitrapData()
        {
            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

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

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

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

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

            return(run);
        }
Ejemplo n.º 16
0
        public void Test1()
        {
            var peakAssociator = new PeakToMSFeatureAssociator();


            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            var scanSet = new ScanSet(6005);

            run.CurrentScanSet = scanSet;


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

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

            var decon = new HornDeconvolutor();


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

            peakAssociator.Execute(run.ResultCollection);

            var numPeaksAssociatedWithFeatures = 0;

            foreach (var msfeature in run.ResultCollection.ResultList)
            {
                foreach (var peak in msfeature.IsotopicProfile.Peaklist)
                {
                    numPeaksAssociatedWithFeatures++;
                }
            }


            var numPeaksInPeakListWithAssociations = 0;

            foreach (MSPeak peak in run.PeakList)
            {
                Console.WriteLine(peak.MSFeatureID + "\t" + peak.XValue + "\t" + peak.Height + "\t");

                if (peak.MSFeatureID != -1)
                {
                    numPeaksInPeakListWithAssociations++;
                }
            }

            //I don't think I can assume this...  msfeature1 might overlap and share a peak with msfeature2
            //Assert.AreEqual(numPeaksAssociatedWithFeatures, numPeaksInPeakListWithAssociations);

            Console.WriteLine("total peaks associated with MSFeatures = " + numPeaksAssociatedWithFeatures);
            Console.WriteLine("total peaks in original peaklist that were associated = " + numPeaksInPeakListWithAssociations);
            Console.WriteLine("fraction peaks assigned = " + (double)(numPeaksInPeakListWithAssociations / (double)run.PeakList.Count));
        }
Ejemplo n.º 17
0
        public void OldDeconvolutorOrbitrapTest1()
        {
            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            run.ScanSetCollection.Create(run, 6005, 6200, 1, 1, false);


            var msgen        = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);
            var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true);

            var deconvolutor = new HornDeconvolutor();

            deconvolutor.MinPeptideBackgroundRatio = 3;


            //deconvolutor.IsMZRangeUsed = true;
            //deconvolutor.MinMZ = 575;
            //deconvolutor.MaxMZ = 585;


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

                run.CurrentScanSet.BackgroundIntensity = peakDetector.BackgroundIntensity;

                var stopwatch = new Stopwatch();
                stopwatch.Start();
                deconvolutor.Execute(run.ResultCollection);
                stopwatch.Stop();

                Console.WriteLine("Time for decon= \t" + stopwatch.ElapsedMilliseconds);
            }
            //Assert.AreEqual(93, run.ResultCollection.ResultList.Count);

            ////order and get the most intense msfeature
            //run.ResultCollection.ResultList = run.ResultCollection.ResultList.OrderByDescending(p => p.IsotopicProfile.IntensityAggregate).ToList();
            //IsosResult testIso = run.ResultCollection.ResultList[0];
            //Assert.AreEqual(13084442, testIso.IsotopicProfile.IntensityAggregate);
            //Assert.AreEqual(2, testIso.IsotopicProfile.ChargeState);
            //Assert.AreEqual(0.01012m, (decimal)Math.Round(testIso.IsotopicProfile.Score, 5));
            //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.DisplayIsotopicProfileData(testIso.IsotopicProfile);

            //TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);
            //TestUtilities.DisplayPeaks(run.PeakList);
        }
        public void ComparePeakFitterVsAreaFitter()
        {
            var massTagFile1 = Path.Combine(FileRefs.RawDataBasePath, "TargetedWorkflowStandards", "QCShew_peptidesWithObsCountGreaterThan1000.txt");

            //load target
            var masstagImporter = new MassTagFromTextFileImporter(massTagFile1);
            var targets         = masstagImporter.Import().TargetList;


            var run = new RunFactory().CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            var msgen        = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);
            var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, Globals.PeakFitType.QUADRATIC, true);



            var scanSet = new ScanSet(9575);

            run.CurrentScanSet = scanSet;

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

            var selectedTarget = targets.First(p => p.ID == 635428 && p.ChargeState == 3);

            var theorFeatureGen = new JoshTheorFeatureGenerator(Backend.Globals.LabellingType.NONE, 0.005);

            theorFeatureGen.GenerateTheorFeature(selectedTarget);


            var peakForFWHM = run.PeakList.First(p => p.XValue > 768.38 && p.XValue < 768.39);



            var theorXYdata =
                TheorXYDataCalculationUtilities.GetTheoreticalIsotopicProfileXYData(selectedTarget.IsotopicProfile,
                                                                                    peakForFWHM.Width);

            theorXYdata.NormalizeYData();

            var areaFitter   = new AreaFitter();
            var areaFitScore = areaFitter.GetFit(theorXYdata, run.XYData, 0.1);


            var peakLeastSquaresFitter = new PeakLeastSquaresFitter();
            var peakBasedFitScore      = peakLeastSquaresFitter.GetFit(new List <Peak>(selectedTarget.IsotopicProfile.Peaklist), run.PeakList, 0.1, 25);


            Console.WriteLine("fit score based on XYData = " + areaFitScore);
            Console.WriteLine("fit score based on Peaks= " + peakBasedFitScore);

            Assert.IsTrue(peakBasedFitScore < 0.1);
        }
Ejemplo n.º 19
0
        public void ThrashPreferPlusOneChargeStateTest1()
        {
            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            run.ScanSetCollection.Create(run, 6005, 6005, 1, 1, false);

            var msgen        = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);
            var peakDetector = new DeconToolsPeakDetectorV2(0.5, 2, Globals.PeakFitType.QUADRATIC, true);

            peakDetector.IsDataThresholded = true;

            var parameters = new ThrashParameters();

            parameters.MinMSFeatureToBackgroundRatio = 1;
            parameters.MaxFit = 0.3;
            parameters.CheckAllPatternsAgainstChargeState1 = true;

            var deconvolutor = new ThrashDeconvolutorV2(parameters);

            var scan = new ScanSet(6005);

            run.CurrentScanSet = scan;
            msgen.Execute(run.ResultCollection);
            peakDetector.Execute(run.ResultCollection);

            run.PeakList = run.PeakList.Where(p => p.XValue > 750 && p.XValue < 753).ToList();


            deconvolutor.Execute(run.ResultCollection);

            Assert.IsTrue(run.ResultCollection.ResultList.Count > 0);
            var result1 = run.ResultCollection.ResultList.First();

            Assert.AreEqual(1, result1.IsotopicProfile.ChargeState);

            Console.WriteLine("--------- Prefer +1 charge state ----------------");
            TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);

            run.ResultCollection.ResultList.Clear();
            run.ResultCollection.IsosResultBin.Clear();

            deconvolutor.Parameters.CheckAllPatternsAgainstChargeState1 = false;
            deconvolutor.Execute(run.ResultCollection);


            Console.WriteLine("\n--------- No charge state bias ----------------");
            TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);

            Assert.IsTrue(run.ResultCollection.ResultList.Count > 0);
            result1 = run.ResultCollection.ResultList.First();

            Assert.AreEqual(3, result1.IsotopicProfile.ChargeState);
        }
Ejemplo n.º 20
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
        }
Ejemplo n.º 21
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);
        }
Ejemplo n.º 22
0
        public void ValidateDataTest_temp()    //purpose is to compare
        {
            var testMz5File    = @"C:\Sipper\SipperDemo\RawDataFiles\Yellow_C13_070_23Mar10_Griffin_10-01-28.mz5";
            var testThermoFile =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\SIPPER_standard_testing\Yellow_C13_070_23Mar10_Griffin_10-01-28.raw";

            var mz5run = new RunFactory().CreateRun(testMz5File);

            mz5run.IsDataThresholded = true;

            var thermoRun = new RunFactory().CreateRun(testThermoFile);

            var testScanMz5    = 6010;
            var testScanThermo = 6011;

            var testScanSet1      = new ScanSet(testScanMz5);
            var testScanSetThermo = new ScanSet(testScanThermo);

            mz5run.CurrentScanSet    = testScanSet1;
            thermoRun.CurrentScanSet = testScanSetThermo;


            mz5run.GetMassSpectrum(testScanSet1);
            thermoRun.GetMassSpectrum(testScanSetThermo);


            Assert.AreEqual(mz5run.XYData.Xvalues.Length, thermoRun.XYData.Xvalues.Length);

            for (var i = 0; i < mz5run.XYData.Xvalues.Length; i++)
            {
                Assert.AreEqual(mz5run.XYData.Xvalues[i], thermoRun.XYData.Xvalues[i]);
            }

            var peakDetector = new DeconToolsPeakDetectorV2();

            peakDetector.PeakToBackgroundRatio  = 3;
            peakDetector.SignalToNoiseThreshold = 2;



            peakDetector.Execute(mz5run.ResultCollection);

            //peakDetector.Execute(thermoRun.ResultCollection);


            TestUtilities.DisplayPeaks(mz5run.PeakList);

            Console.WriteLine();
            Console.WriteLine();

            // TestUtilities.DisplayPeaks(thermoRun.PeakList);
        }
Ejemplo n.º 23
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 smootherTest1()
        {
            Run run = new MSScanFromTextFileRun(FileRefs.RawDataMSFiles.TextFileMS_std1);

            Task msgen = new GenericMSGenerator();

            msgen.Execute(run.ResultCollection);

            var peakdetector = new DeconToolsPeakDetectorV2(3, 3, Globals.PeakFitType.QUADRATIC, true);

            peakdetector.Execute(run.ResultCollection);

            Assert.AreEqual(84, run.PeakList.Count);

            Task smoother = new SavitzkyGolaySmoother(7, 2, false);

            smoother.Execute(run.ResultCollection);

            peakdetector.Execute(run.ResultCollection);

            Assert.AreEqual(46, run.PeakList.Count);
        }
Ejemplo n.º 25
0
        public void CompareToScottsData1()
        {
            var fileName = FileRefs.RawDataMSFiles.OrbitrapStdFile1;
            var run      = new RunFactory().CreateRun(fileName);

            run.ScanSetCollection.Create(run, 5509, 5509, 1, 1, false);
            var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);

            var peakBr       = 1.9;//1.3;
            var peakDetector = new DeconToolsPeakDetectorV2(peakBr, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true);

            var thrashParameters = new ThrashParameters();

            thrashParameters.MinMSFeatureToBackgroundRatio = peakBr;
            thrashParameters.MaxFit = 0.4;

            var newDeconvolutor = new InformedThrashDeconvolutor(thrashParameters);

            var scanset = new ScanSet(5509);

            run.CurrentScanSet = scanset;

            msgen.Execute(run.ResultCollection);
            peakDetector.Execute(run.ResultCollection);
            run.CurrentScanSet.BackgroundIntensity = peakDetector.BackgroundIntensity;
            newDeconvolutor.Execute(run.ResultCollection);


            var scottMzVals = ReadScottsAnnotationsScan5509().ToArray();

            var myMzVals = run.ResultCollection.ResultList.Select(p => p.IsotopicProfile.MonoPeakMZ).OrderBy(p => p).ToArray();

            var comparisions = new Dictionary <decimal, double>();

            foreach (var scottVal in scottMzVals)
            {
                var tolerance     = 0.01;
                var indexInThrash = MathUtils.BinarySearchWithTolerance(myMzVals, scottVal, 0, myMzVals.Length - 1, tolerance);

                var myMzVal = indexInThrash == -1 ? 0.0d : myMzVals[indexInThrash];
                comparisions.Add((decimal)scottVal, myMzVal);
            }

            var numCorrect = comparisions.Values.Count(p => p > 0);

            var numMissing = scottMzVals.Count() - numCorrect;

            Console.WriteLine("Total annotated= \t" + scottMzVals.Count());
            Console.WriteLine("Number correct = \t" + numCorrect);
            Console.WriteLine("Number missing = \t" + numMissing);
        }
        public void Test1()
        {
            var rawfilename  = @"D:\Data\O16O18\GlueGrant\GG_MO_Trauma_374020_20May11_Sphinx_11-03-28.RAW";
            var exportedIsos = Path.Combine(Path.GetDirectoryName(rawfilename), Path.GetFileName(rawfilename).Replace(".RAW", "_test_isos.csv"));

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

            var run = new RunFactory().CreateRun(rawfilename);

            run.ResultCollection.ResultType = Backend.Globals.ResultType.O16O18_TRADITIONAL_RESULT;

            run.ScanSetCollection.Create(run, 5000, 5000, 1, 1);


            run.CurrentScanSet = run.ScanSetCollection.ScanSetList[0];

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

            var peakDet = new DeconToolsPeakDetectorV2();

            peakDet.PeakToBackgroundRatio  = 1.3;
            peakDet.SignalToNoiseThreshold = 2;

            var decon = new HornDeconvolutor();

            decon.IsO16O18Data = true;

            var appender = new O16O18PeakDataAppender();

            var exporter = IsosExporterFactory.CreateIsosExporter(run.ResultCollection.ResultType, Backend.Globals.ExporterType.Text, exportedIsos);

            msgen.Execute(run.ResultCollection);
            peakDet.Execute(run.ResultCollection);
            decon.Execute(run.ResultCollection);
            appender.Execute(run.ResultCollection);

            var testResult = (O16O18IsosResult)run.ResultCollection.ResultList[1];

            Assert.AreEqual(DeconTools.Backend.Globals.ResultType.O16O18_TRADITIONAL_RESULT, run.ResultCollection.ResultType);
            Assert.AreEqual(5905390, testResult.IsotopicProfile.GetMonoAbundance());
            Assert.AreEqual(3017899, testResult.MonoPlus2Abundance);
            Assert.AreEqual(162389, testResult.MonoPlus4Abundance);
            exporter.Execute(run.ResultCollection);

            run.Close();
        }
Ejemplo n.º 27
0
        public void ValidateDataTest1()    //purpose is to compare
        {
            var testMz5File    = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\mzXML\QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18.mz5";
            var testThermoFile = FileRefs.RawDataMSFiles.OrbitrapStdFile1;

            var mz5run = new RunFactory().CreateRun(testMz5File);

            var thermoRun = new RunFactory().CreateRun(testThermoFile);

            var testScanMz5    = 6004;
            var testScanThermo = 6005;

            var testScanSet1      = new ScanSet(testScanMz5);
            var testScanSetThermo = new ScanSet(testScanThermo);

            mz5run.CurrentScanSet    = testScanSet1;
            thermoRun.CurrentScanSet = testScanSetThermo;


            mz5run.XYData    = mz5run.GetMassSpectrum(testScanSet1);
            thermoRun.XYData = thermoRun.GetMassSpectrum(testScanSetThermo);


            Assert.AreEqual(mz5run.XYData.Xvalues.Length, thermoRun.XYData.Xvalues.Length);

            for (var i = 0; i < mz5run.XYData.Xvalues.Length; i++)
            {
                Assert.AreEqual(mz5run.XYData.Xvalues[i], thermoRun.XYData.Xvalues[i]);
            }

            var peakDetector = new DeconToolsPeakDetectorV2();

            peakDetector.PeakToBackgroundRatio  = 3;
            peakDetector.SignalToNoiseThreshold = 2;

            //peakDetector.Execute(mz5run.ResultCollection);

            peakDetector.Execute(thermoRun.ResultCollection);


            //TestUtilities.DisplayPeaks(mz5run.PeakList);

            Console.WriteLine();
            Console.WriteLine();

            TestUtilities.DisplayPeaks(thermoRun.PeakList);
        }
Ejemplo n.º 28
0
        public void peak_interference_weakFeature_test1()
        {
            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            var scanSet = new ScanSet(6005);

            run.CurrentScanSet = scanSet;

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


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

            var decon = new HornDeconvolutor();


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

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

            var testResult = run.ResultCollection.ResultList.Where(p => p.IsotopicProfile.MonoPeakMZ > 597 && p.IsotopicProfile.MonoPeakMZ < 598).First();

            var monoPeak = testResult.IsotopicProfile.getMonoPeak();
            var lastPeak = testResult.IsotopicProfile.Peaklist[testResult.IsotopicProfile.Peaklist.Count - 1];

            var startIndexOfXYData = MathUtils.BinarySearchWithTolerance(run.XYData.Xvalues, monoPeak.XValue - 3, 0, (run.XYData.Xvalues.Length - 1), 2);

            //interference scorer

            var interferenceScorer = new InterferenceScorer();

            var stopwatch = new Stopwatch();

            stopwatch.Start();

            var scanPeaks         = run.PeakList.Select <Peak, MSPeak>(i => (MSPeak)i).ToList();
            var interferenceScore = interferenceScorer.GetInterferenceScore(scanPeaks, testResult.IsotopicProfile.Peaklist, monoPeak.XValue - 1.1,
                                                                            lastPeak.XValue + lastPeak.Width);

            stopwatch.Stop();

            Console.WriteLine("interference= " + interferenceScore);
            Console.WriteLine("Time taken = " + stopwatch.ElapsedMilliseconds);
        }
Ejemplo n.º 29
0
        public void interference_allFeaturesInScan_test1()
        {
            Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1);

            var scanSet = new ScanSet(6005);

            run.CurrentScanSet = scanSet;

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


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

            var decon = new HornDeconvolutor();


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

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

            foreach (var isosResult in run.ResultCollection.ResultList)
            {
                var monoPeak = isosResult.IsotopicProfile.getMonoPeak();
                var lastPeak = isosResult.IsotopicProfile.Peaklist[isosResult.IsotopicProfile.Peaklist.Count - 1];

                var startIndexOfXYData = MathUtils.BinarySearchWithTolerance(run.XYData.Xvalues, monoPeak.XValue - 3, 0, (run.XYData.Xvalues.Length - 1), 2);

                //interference scorer

                var interferenceScorer = new InterferenceScorer();

                var stopwatch = new Stopwatch();
                stopwatch.Start();
                var interferenceScore = interferenceScorer.GetInterferenceScore(run.XYData, isosResult.IsotopicProfile.Peaklist, monoPeak.XValue - 1.1,
                                                                                lastPeak.XValue + lastPeak.Width, startIndexOfXYData);
                stopwatch.Stop();

                Console.WriteLine("interference= \t" + interferenceScore);
            }

            TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);
        }
Ejemplo n.º 30
0
        public void ThrashV2OnIMSDataTest1()
        {
            var uimfFile =
                @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\UIMF\Sarc_MS2_90_6Apr11_Cheetah_11-02-19.uimf";

            var run          = new RunFactory().CreateRun(uimfFile);
            var msgen        = MSGeneratorFactory.CreateMSGenerator(run.MSFileType);
            var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, Globals.PeakFitType.QUADRATIC, true);
            var zeroFiller   = new DeconTools.Backend.ProcessingTasks.ZeroFillers.DeconToolsZeroFiller(3);

            var thrashParameters = new ThrashParameters();

            thrashParameters.MinMSFeatureToBackgroundRatio = 1;
            thrashParameters.MaxFit = 0.4;

            var newDeconvolutor = new ThrashDeconvolutorV2(thrashParameters);

            var testLCScan       = 500;
            var testIMSScan      = 120;
            var numIMSScanSummed = 7;
            var lowerIMSScan     = testIMSScan - (numIMSScanSummed - 1) / 2;
            var upperIMSScan     = testIMSScan + (numIMSScanSummed - 1) / 2;

            var scanSet = new ScanSetFactory().CreateScanSet(run, testLCScan, 1);

            run.CurrentScanSet = scanSet;
            ((UIMFRun)run).CurrentIMSScanSet = new IMSScanSet(testIMSScan, lowerIMSScan, upperIMSScan);

            msgen.Execute(run.ResultCollection);
            zeroFiller.Execute(run.ResultCollection);
            peakDetector.Execute(run.ResultCollection);
            newDeconvolutor.Execute(run.ResultCollection);

            TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList);

            Assert.IsTrue(run.ResultCollection.ResultList.Count > 0);
            Assert.AreEqual(33, run.ResultCollection.ResultList.Count);

            var result1 = run.ResultCollection.ResultList[0];

            Assert.AreEqual(13084442, (decimal)Math.Round(result1.IntensityAggregate));
            Assert.AreEqual(960.53365m, (decimal)Math.Round(result1.IsotopicProfile.MonoIsotopicMass, 5));
            Assert.AreEqual(2, result1.IsotopicProfile.ChargeState);
        }