예제 #1
0
        public void getPeakChromatogramTest1()
        {
            var run = RunUtilities.CreateAndLoadPeaks(FileRefs.RawDataMSFiles.OrbitrapStdFile1,
                                                      FileRefs.PeakDataFiles.OrbitrapPeakFile_scans5500_6500);

            var targetMZ  = 759.4032;
            var startScan = 5500;
            var stopScan  = 6500;


            double toleranceInPPM = 20;

            var chromGen = new PeakChromatogramGenerator();

            var mt = TestUtilities.GetMassTagStandard(1);

            run.CurrentMassTag = mt;

            var unlabelledTheorGenerator = new JoshTheorFeatureGenerator();

            unlabelledTheorGenerator.GenerateTheorFeature(mt);

            var peakChromGen = new PeakChromatogramGenerator(toleranceInPPM);

            peakChromGen.Execute(run.ResultCollection);

            run.XYData.Display();

            Assert.AreEqual(133, run.XYData.Xvalues.Length);
            Assert.AreEqual(5543, (int)run.XYData.Xvalues[35]);
            Assert.AreEqual(7319569, (int)run.XYData.Yvalues[35]);

            //make sure that the 0's are not trimmed off
            Assert.AreEqual(0, run.XYData.Yvalues[1]);
        }
예제 #2
0
        public void getPeakChromatogramTest2()
        {
            var mt = TestUtilities.GetMassTagStandard(1);

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

            var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(FileRefs.PeakDataFiles.OrbitrapPeakFile_scans5500_6500);

            peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList);

            run.CurrentMassTag = mt;

            var unlabelledTheorGenerator = new TomTheorFeatureGenerator();

            unlabelledTheorGenerator.GenerateTheorFeature(mt);

            var peakChromGen = new PeakChromatogramGenerator(10, Globals.ChromatogramGeneratorMode.TOP_N_PEAKS);

            peakChromGen.TopNPeaksLowerCutOff = 0.4;
            peakChromGen.Execute(run.ResultCollection);

            Assert.AreEqual(133, run.XYData.Xvalues.Length);
            Assert.AreEqual(5543, (int)run.XYData.Xvalues[35]);
            //Assert.AreEqual(7319569, (int)run.XYData.Yvalues[35]);
            run.XYData.Display();
        }
예제 #3
0
        public void test2()
        {
            MassTag massTag = new MassTag();

            massTag.ID = 56488;
            massTag.MonoIsotopicMass = 2275.1694779;
            massTag.ChargeState      = 3;
            massTag.MZ = massTag.MonoIsotopicMass / massTag.ChargeState + 1.00727649;


            Run run = new XCaliburRun(xcaliburTestfile);

            PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburPeakDataFile);

            peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList);


            run.CurrentMassTag = massTag;

            Task peakChromGen = new PeakChromatogramGenerator(10);

            Task smoother = new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(2, 2, 2);
            Task peakDet  = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector();


            peakChromGen.Execute(run.ResultCollection);
            smoother.Execute(run.ResultCollection);
            peakDet.Execute(run.ResultCollection);

            TestUtilities.DisplayPeaks(run.PeakList);
            TestUtilities.DisplayXYValues(run.ResultCollection);
        }
예제 #4
0
        /// <summary>
        /// Finds the XIC based on the m/z and scan parameters.
        /// </summary>
        /// <param name="mz"></param>
        /// <param name="scan"></param>
        /// <returns></returns>
        public List <XYData> FindXic(double mz, int scan, bool shouldSmooth)
        {
            LcmsFeatureTarget target = new LcmsFeatureTarget();

            target.ID              = 0;
            target.MZ              = mz;
            target.ScanLCTarget    = scan;
            target.ElutionTimeUnit = Globals.ElutionTimeUnit.ScanNum;
            m_run.CurrentMassTag   = target;
            var result = m_run.ResultCollection.GetTargetedResult(m_run.CurrentMassTag);

            double chromPeakGeneratorTolInPPM = MzPpmWindow;

            Globals.ChromatogramGeneratorMode chromGeneratorMode = Globals.ChromatogramGeneratorMode.MZ_BASED;

            var chromGen = new PeakChromatogramGenerator(chromPeakGeneratorTolInPPM,
                                                         chromGeneratorMode);

            chromGen.NETWindowWidthForNonAlignedData = Convert.ToSingle(NetWindow);

            int pointsToSmooth = 5;
            var chromSmoother  = new SavitzkyGolaySmoother(pointsToSmooth, 2);

            double chromPeakDetectorPeakBR   = 1;
            double chromPeakDetectorSigNoise = 1;
            var    chromPeakDetector         = new ChromPeakDetector(chromPeakDetectorPeakBR,
                                                                     chromPeakDetectorSigNoise);

            ChromPeakSelectorParameters chromPeakSelectorParameters = new ChromPeakSelectorParameters();
            var chromPeakSelector = new BasicChromPeakSelector(chromPeakSelectorParameters);

            //this generates an extracted ion chromatogram
            // Since we are not using the built in generator,
            chromGen.Execute(m_run.ResultCollection);

            //this smooths the data - very important step!
            if (shouldSmooth)
            {
                chromSmoother.Execute(m_run.ResultCollection);
            }

            //this detects peaks within an extracted ion chromatogram
            chromPeakDetector.Execute(m_run.ResultCollection);

            //this selects the peak
            chromPeakSelector.Parameters.PeakSelectorMode = Globals.PeakSelectorMode.ClosestToTarget;
            chromPeakSelector.Execute(m_run.ResultCollection);

            //Here's the chromatogram data...
            List <XYData> data = new List <XYData>();

            for (int i = 0; i < m_run.XYData.Xvalues.Length; i++)
            {
                XYData datum = new XYData(m_run.XYData.Xvalues[i], m_run.XYData.Yvalues[i]);
                data.Add(datum);
            }

            return(data);
        }
예제 #5
0
        public void test3()
        {
            MassTag massTag = new MassTag();

            massTag.ID = 56488;
            massTag.MonoIsotopicMass = 2275.1694779;
            massTag.ChargeState      = 3;
            massTag.MZ     = massTag.MonoIsotopicMass / massTag.ChargeState + 1.00727649;
            massTag.NETVal = 0.3520239f;


            Run run = new XCaliburRun(xcaliburTestfile);
            ChromAlignerUsingVIPERInfo chromAligner = new ChromAlignerUsingVIPERInfo();

            chromAligner.Execute(run);


            PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburPeakDataFile);

            peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList);


            run.CurrentMassTag = massTag;

            Task peakChromGen = new PeakChromatogramGenerator(20);

            Task smoother     = new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(2, 2, 2);
            Task peakDet      = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector();
            Task chromPeakSel = new DeconTools.Backend.ProcessingTasks.ChromPeakSelector(1, 0.1);

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



            peakChromGen.Execute(run.ResultCollection);
            smoother.Execute(run.ResultCollection);
            peakDet.Execute(run.ResultCollection);
            chromPeakSel.Execute(run.ResultCollection);


            Console.WriteLine("Now generating MS....");
            msgen.Execute(run.ResultCollection);
            Console.WriteLine("----------- RESULTS ----------------------\n");
            TestUtilities.DisplayPeaks(run.PeakList);


            MassTagResultBase massTagResult = run.ResultCollection.MassTagResultList[massTag];

            massTagResult.DisplayToConsole();
            Assert.AreEqual(5512, massTagResult.ScanSet.PrimaryScanNumber);
        }
예제 #6
0
        public void find_targetMassTag_131959Test1()
        {
            var run = new RunFactory().CreateRun(xcaliburTestfile);

            var masstagImporter = new MassTagFromTextFileImporter(massTagTestList1);
            var massTagColl     = masstagImporter.Import();

            Assert.AreEqual(2719, massTagColl.TargetList.Count);

            var chromAligner = new ChromAlignerUsingVIPERInfo();

            chromAligner.Execute(run);

            var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburAllPeaksFile);

            peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList);


            //int mtID = 635428;
            var mtID = 131959;

            Task peakChromGen = new PeakChromatogramGenerator(20);
            Task smoother     = new DeconTools.Backend.ProcessingTasks.Smoothers.SavitzkyGolaySmoother(23, 2);
            Task zeroFill     = new DeconTools.Backend.ProcessingTasks.ZeroFillers.DeconToolsZeroFiller(3);
            Task peakDet      = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector(0.5, 1);
            Task msPeakDet    = new DeconToolsPeakDetectorV2(1.3, 2, Globals.PeakFitType.QUADRATIC, true);

            var basicChromPeakSelParam = new ChromPeakSelectorParameters();

            basicChromPeakSelParam.NETTolerance     = 0.1f;
            basicChromPeakSelParam.PeakSelectorMode = Globals.PeakSelectorMode.ClosestToTarget;
            Task chromPeakSel = new BasicChromPeakSelector(basicChromPeakSelParam);


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


            run.CurrentMassTag = massTagColl.TargetList.Find(p => p.ID == mtID);
            var mt = run.CurrentMassTag;

            mt.MZ = mt.MonoIsotopicMass / mt.ChargeState + Globals.PROTON_MASS;

            Task theorFeatureGen       = new TomTheorFeatureGenerator(DeconTools.Backend.Globals.LabellingType.NONE, 0.005);
            Task targetedFeatureFinder = new BasicTFF();
            Task fitScoreCalc          = new IsotopicProfileFitScoreCalculator();


            theorFeatureGen.Execute(run.ResultCollection);


            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("------------------- MassTag = " + mt.ID + "---------------------------");
            Console.WriteLine("monoMass = " + mt.MonoIsotopicMass.ToString("0.0000") + "; monoMZ = " + mt.MZ.ToString("0.0000") + "; ChargeState = " + mt.ChargeState + "; NET = " + mt.NormalizedElutionTime.ToString("0.000") + "; Sequence = " + mt.Code + "; EmpiricalFormula= " + mt.EmpiricalFormula + "\n");

            peakChromGen.Execute(run.ResultCollection);
            smoother.Execute(run.ResultCollection);
            //TestUtilities.DisplayXYValues(run.ResultCollection);

            peakDet.Execute(run.ResultCollection);
            TestUtilities.DisplayPeaks(run.PeakList);

            chromPeakSel.Execute(run.ResultCollection);
            msgen.Execute(run.ResultCollection);
            //TestUtilities.DisplayXYValues(run.ResultCollection);
            msPeakDet.Execute(run.ResultCollection);
            targetedFeatureFinder.Execute(run.ResultCollection);
            fitScoreCalc.Execute(run.ResultCollection);

            var massTagResult = run.ResultCollection.MassTagResultList[mt];

            massTagResult.DisplayToConsole();



            //Console.WriteLine("------------------------------ end --------------------------");
        }
예제 #7
0
        public void test1()
        {
            Run run = new XCaliburRun(xcaliburTestfile);
            MassTagCollection        massTagColl  = new MassTagCollection();
            MassTagIDGenericImporter mtidImporter = new MassTagIDGenericImporter(cysteineMassTagSourceFile1, '\t');

            mtidImporter.Import(massTagColl);

            MassTagFromSqlDBImporter importer = new MassTagFromSqlDBImporter("MT_Shewanella_ProdTest_P352", "porky");

            importer.Import(massTagColl);

            Assert.AreEqual(737, massTagColl.MassTagIDList.Count);

            Assert.AreEqual(826, massTagColl.MassTagList.Count);

            ChromAlignerUsingVIPERInfo chromAligner = new ChromAlignerUsingVIPERInfo();

            chromAligner.Execute(run);

            PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburAllPeaksFile);

            peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList);

            Task peakChromGen = new PeakChromatogramGenerator(20);

            Task smoother     = new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(11, 11, 2);
            Task peakDet      = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector(0.5, 0.5);
            Task chromPeakSel = new DeconTools.Backend.ProcessingTasks.ChromPeakSelector(1, 0.01, Globals.PeakSelectorMode.CLOSEST_TO_TARGET);

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


            DeconToolsV2.Peaks.clsPeakProcessorParameters peakParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(2, 0.75, true, DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC);
            Task mspeakDet             = new DeconToolsPeakDetector(peakParams);
            Task theorFeatureGen       = new TomTheorFeatureGenerator();
            Task targetedFeatureFinder = new BasicTFF(6);
            Task exporter = new BasicMTResultSQLiteExporter(cysteineAnalysisOutput1);


            IsotopicProfileFitScoreCalculator fitScoreCalc = new IsotopicProfileFitScoreCalculator();

            int         successCounter = 0;
            List <long> timingResults  = new List <long>();

            foreach (MassTag mt in massTagColl.MassTagList)
            {
                run.CurrentMassTag = mt;
                mt.MZ = mt.MonoIsotopicMass / mt.ChargeState + Globals.PROTON_MASS;

                Console.WriteLine();
                Console.WriteLine();
                Console.WriteLine("------------------- MassTag = " + mt.ID + "---------------------------");
                Console.WriteLine("monoMass = " + mt.MonoIsotopicMass.ToString("0.0000") + "; monoMZ = " + mt.MZ.ToString("0.0000") + "; ChargeState = " + mt.ChargeState + "; NET = " + mt.NETVal.ToString("0.000") + "; Sequence = " + mt.PeptideSequence + "\n");


                Stopwatch sw = new Stopwatch();
                sw.Start();
                try
                {
                    peakChromGen.Execute(run.ResultCollection);
                    smoother.Execute(run.ResultCollection);
                    peakDet.Execute(run.ResultCollection);
                    chromPeakSel.Execute(run.ResultCollection);
                    msgen.Execute(run.ResultCollection);
                    mspeakDet.Execute(run.ResultCollection);
                    theorFeatureGen.Execute(run.ResultCollection);
                    targetedFeatureFinder.Execute(run.ResultCollection);
                    fitScoreCalc.Execute(run.ResultCollection);
                    MassTagResultBase massTagResult = run.ResultCollection.MassTagResultList[mt];
                    massTagResult.DisplayToConsole();


                    Console.WriteLine("------------------------------ end --------------------------");
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Task failed. Message: " + ex.Message + ex.StackTrace);
                }
                sw.Stop();
                timingResults.Add(sw.ElapsedMilliseconds);

                if (mt == massTagColl.MassTagList.Last())
                {
                    exporter.Execute(run.ResultCollection);
                }
            }

            exporter.Cleanup();

            //List<IMassTagResult> successfulResults = run.ResultCollection.GetSuccessfulMassTagResults();

            foreach (long tr in timingResults)
            {
                Console.WriteLine(tr);
            }
            Console.WriteLine("-------- Analysis time for all MTs = " + timingResults.Sum());
            Console.WriteLine("-------- Average time for each MT = " + timingResults.Average());

            Console.WriteLine();
        }
예제 #8
0
        public void Test1()
        {
            var testFile =
                @"D:\Data\Orbitrap\BrianIQTesting\QC_Shew_11_02_pt5-b_6Jun11_Sphinx_11-03-27.RAW";
            var peaksTestFile =
                @"D:\Data\Orbitrap\BrianIQTesting\QC_Shew_11_02_pt5-b_6Jun11_Sphinx_11-03-27_peaks.txt";


            var run = RunUtilities.CreateAndLoadPeaks(testFile, peaksTestFile);

            var target = new LcmsFeatureTarget();

            target.ID = 0;


            target.MZ              = 715.39214;
            target.ScanLCTarget    = 7343;
            target.ElutionTimeUnit = Globals.ElutionTimeUnit.ScanNum;
            run.CurrentMassTag     = target;

            var result = run.ResultCollection.GetTargetedResult(run.CurrentMassTag);

            double chromPeakGeneratorTolInPPM = 20;
            var    chromGeneratorMode         = Globals.ChromatogramGeneratorMode.MZ_BASED;

            var chromGen = new PeakChromatogramGenerator(chromPeakGeneratorTolInPPM, chromGeneratorMode);

            // If we want to use the Execute Command
            //BLL .1 and .5 NET windows work.   .02 NET window does not BR and SN was set to 1 however)
            chromGen.ChromWindowWidthForNonAlignedData = .02F;


            var pointsToSmooth = 5;
            var chromSmoother  = new SavitzkyGolaySmoother(pointsToSmooth, 2);

            //BLL We also tried to set the BR and SIG NOISE to 0.  This did not work
            var chromPeakDetectorPeakBR   = 0.5;
            var chromPeakDetectorSigNoise = 0.5;
            var chromPeakDetector         = new ChromPeakDetector(chromPeakDetectorPeakBR, chromPeakDetectorSigNoise);


            var chromPeakSelectorParameters = new ChromPeakSelectorParameters();

            chromPeakSelectorParameters.PeakSelectorMode = Globals.PeakSelectorMode.ClosestToTarget;
            var chromPeakSelector = new BasicChromPeakSelector(chromPeakSelectorParameters);

            var smartChromPeakParameters = new SmartChromPeakSelectorParameters();


            var smartChromPeakSelector = new SmartChromPeakSelector(smartChromPeakParameters);


            //this generates an extracted ion chromatogram
            // Since we are not using the built in generator,
            chromGen.Execute(run.ResultCollection);

            //this smooths the data - very important step!

            //BLL. This didnt work for me when we first started, instead of using the NET window above.
            //chromGen.GenerateChromatogram(run,
            //                                target.ScanLCTarget - 300,
            //                                target.ScanLCTarget + 300,
            //                                target.MZ,
            //                                chromPeakGeneratorTolInPPM);
            chromSmoother.Execute(run.ResultCollection);

            //this detects peaks within an extracted ion chromatogram
            chromPeakDetector.Execute(run.ResultCollection);

            //this selects the peak
            chromPeakSelector.Execute(run.ResultCollection);
            //smartChromPeakSelector.Execute(run.ResultCollection);


            //TestUtilities.DisplayXYValues(run.XYData);
            TestUtilities.DisplayPeaks(run.PeakList);



            Console.WriteLine("Number of peaks detected = " + run.PeakList.Count);
            Console.WriteLine("Selected peak= " + result.ChromPeakSelected);
        }
예제 #9
0
        /// <summary>
        /// Finds the XIC based on the m/z and scan parameters.
        /// </summary>
        /// <param name="mz"></param>
        /// <param name="scan"></param>
        /// <returns></returns>
        public List<PNNLOmics.Data.XYData> FindXic(double mz, int scan, bool shouldSmooth)
        {
            LcmsFeatureTarget target    = new LcmsFeatureTarget();
            target.ID                   = 0;
            target.MZ                   = mz;
            target.ScanLCTarget         = scan;
            target.ElutionTimeUnit      = Globals.ElutionTimeUnit.ScanNum;
            m_run.CurrentMassTag        = target;
            var result                  = m_run.ResultCollection.GetTargetedResult(m_run.CurrentMassTag);

            double chromPeakGeneratorTolInPPM = MzPpmWindow;
            Globals.ChromatogramGeneratorMode chromGeneratorMode = Globals.ChromatogramGeneratorMode.MZ_BASED;

            var chromGen = new PeakChromatogramGenerator(   chromPeakGeneratorTolInPPM,
                                                            chromGeneratorMode);
            chromGen.NETWindowWidthForNonAlignedData = Convert.ToSingle(NetWindow);

            int pointsToSmooth  = 5;
            var chromSmoother   = new SavitzkyGolaySmoother(pointsToSmooth, 2);

            double chromPeakDetectorPeakBR   = 1;
            double chromPeakDetectorSigNoise = 1;
            var chromPeakDetector            = new ChromPeakDetector(   chromPeakDetectorPeakBR,
                                                                        chromPeakDetectorSigNoise);

            ChromPeakSelectorParameters chromPeakSelectorParameters = new ChromPeakSelectorParameters();
            var chromPeakSelector = new BasicChromPeakSelector(chromPeakSelectorParameters);

            //this generates an extracted ion chromatogram
            // Since we are not using the built in generator,
            chromGen.Execute(m_run.ResultCollection);

            //this smooths the data - very important step!
            if (shouldSmooth)
            {
                chromSmoother.Execute(m_run.ResultCollection);
            }

            //this detects peaks within an extracted ion chromatogram
            chromPeakDetector.Execute(m_run.ResultCollection);

            //this selects the peak
            chromPeakSelector.Parameters.PeakSelectorMode = Globals.PeakSelectorMode.ClosestToTarget;
            chromPeakSelector.Execute(m_run.ResultCollection);

            //Here's the chromatogram data...
            List<PNNLOmics.Data.XYData> data = new List<PNNLOmics.Data.XYData>();

            for (int i = 0; i < m_run.XYData.Xvalues.Length; i++)
            {
                PNNLOmics.Data.XYData datum = new PNNLOmics.Data.XYData(m_run.XYData.Xvalues[i], m_run.XYData.Yvalues[i]);
                data.Add(datum);
            }

            return data;
        }
예제 #10
0
        public void run_fullAnalysisTest1()
        {
            Run run = new BrukerRun(rsph_AOnly_28_run1File);
            MassTagCollection massTagColl = new MassTagCollection();

            run.ResultCollection.MassTagResultType = DeconTools.Backend.Globals.MassTagResultType.N14N15_MASSTAG_RESULT;


            massTagColl.MassTagIDList = fourTestMTs;

            MassTagFromSqlDBImporter importer = new MassTagFromSqlDBImporter("MT_R_sphaeroides241_P513", "Albert");

            importer.chargeStateFilterThreshold = 0.05;
            importer.Import(massTagColl);

            Assert.AreEqual(7, massTagColl.MassTagList.Count);

            ChromAlignerUsingVIPERInfo chromAligner = new ChromAlignerUsingVIPERInfo();

            chromAligner.Execute(run);

            PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(rsph_Aonly_28_run1_scans500_1000_peaks);

            peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList);

            Task peakChromGen = new PeakChromatogramGenerator(20);

            Task smoother     = new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(11, 11, 2);
            Task peakDet      = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector(0.5, 0.5);
            Task chromPeakSel = new DeconTools.Backend.ProcessingTasks.ChromPeakSelector(1, 0.01, Globals.PeakSelectorMode.CLOSEST_TO_TARGET);

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


            DeconToolsV2.Peaks.clsPeakProcessorParameters peakParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(2, 3, false, DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC);
            Task mspeakDet       = new DeconToolsPeakDetector(peakParams);
            Task theorFeatureGen = new TomTheorFeatureGenerator();


            N14N15TFFTask finder = new N14N15TFFTask(0.01);



            N14N15QuantifierTask quant = new N14N15QuantifierTask(1);


            IsotopicProfileFitScoreCalculator fitScoreCalc = new IsotopicProfileFitScoreCalculator();

            List <long> timingResults = new List <long>();


            foreach (MassTag mt in massTagColl.MassTagList)
            {
                run.CurrentMassTag = mt;
                mt.MZ = mt.MonoIsotopicMass / mt.ChargeState + Globals.PROTON_MASS;

                Console.WriteLine();
                Console.WriteLine();
                Console.WriteLine("------------------- MassTag = " + mt.ID + "---------------------------");
                Console.WriteLine("monoMass = " + mt.MonoIsotopicMass.ToString("0.0000") + "; monoMZ = " + mt.MZ.ToString("0.0000") + "; ChargeState = " + mt.ChargeState + "; NET = " + mt.NETVal.ToString("0.000") + "; Sequence = " + mt.PeptideSequence + "\n");


                Stopwatch sw = new Stopwatch();
                sw.Start();
                try
                {
                    peakChromGen.Execute(run.ResultCollection);
                    smoother.Execute(run.ResultCollection);
                    peakDet.Execute(run.ResultCollection);
                    chromPeakSel.Execute(run.ResultCollection);
                    msgen.Execute(run.ResultCollection);
                    mspeakDet.Execute(run.ResultCollection);
                    theorFeatureGen.Execute(run.ResultCollection);
                    finder.Execute(run.ResultCollection);
                    quant.Execute(run.ResultCollection);
                    fitScoreCalc.Execute(run.ResultCollection);
                    MassTagResultBase massTagResult = run.ResultCollection.MassTagResultList[mt];
                    massTagResult.DisplayToConsole();


                    Console.WriteLine("------------------------------ end --------------------------");
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Task failed. Message: " + ex.Message + ex.StackTrace);
                }
                sw.Stop();
                timingResults.Add(sw.ElapsedMilliseconds);
            }

            foreach (long tr in timingResults)
            {
                Console.WriteLine(tr);
            }
            Console.WriteLine("-------- Analysis time for all MTs = " + timingResults.Sum());
            Console.WriteLine("-------- Average time for each MT = " + timingResults.Average());

            Console.WriteLine();
        }