public void smartChromPeakSelectorTest_noSumming()
        {
            var run = new RunFactory().CreateRun(xcaliburTestfile);

            run.Close();

            run = new RunFactory().CreateRun(xcaliburTestfile);


            var massTagColl = new TargetCollection();

            var masstagImporter = new MassTagFromTextFileImporter(massTagTestList1);

            massTagColl = masstagImporter.Import();

            var chromAligner = new ChromAlignerUsingVIPERInfo();

            chromAligner.Execute(run);

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

            var chromPeakDet = new ChromPeakDetector(0.5, 1);

            var smartchromParam        = new SmartChromPeakSelectorParameters();
            var smartChromPeakSelector = new SmartChromPeakSelector(smartchromParam);

            var basicChromParam        = new ChromPeakSelectorParameters();
            var basicChromPeakSelector = new BasicChromPeakSelector(basicChromParam);



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

            var iterativeTff = new IterativeTFF(new IterativeTFFParameters());

            var fitscoreCalc = new IsotopicProfileFitScoreCalculator();



            var testChromatogramDataFile = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\TargetedWorkflowStandards\massTag635428_chromatogramData.txt";

            var xydata = TestUtilities.LoadXYDataFromFile(testChromatogramDataFile);

            Assert.IsNotNull(xydata);

            run.XYData = xydata;
            // run.XYData.Display();

            run.CurrentMassTag = massTagColl.TargetList.Where(p => p.ID == 635428).First();

            Console.WriteLine("------MT = " + run.CurrentMassTag.ToString());

            theorFeatureGen.Execute(run.ResultCollection);
            chromPeakDet.Execute(run.ResultCollection);

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

            //first run the standard peak selector
            basicChromPeakSelector.Execute(run.ResultCollection);
            Assert.AreEqual(10066, (int)Math.Round(result.ChromPeakSelected.XValue));


            //now run the smart chrom peak selector
            run.XYData = xydata;
            chromPeakDet.Execute(run.ResultCollection);
            smartChromPeakSelector.Parameters.NETTolerance = 0.025f;
            smartChromPeakSelector.Execute(run.ResultCollection);

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

            TestUtilities.DisplayPeaks(run.PeakList);

            fitscoreCalc.Execute(run.ResultCollection);


            Assert.AreEqual(9579, (int)Math.Round(result.ChromPeakSelected.XValue));
            //result.DisplayToConsole();


            TestUtilities.DisplayIsotopicProfileData(result.Target.IsotopicProfile);
        }
        public void smartChromPeakSelectorTest_withDynamicSumming()
        {
            var run = new RunFactory().CreateRun(xcaliburTestfile);

            var massTagColl = new TargetCollection();

            var masstagImporter = new MassTagFromTextFileImporter(massTagTestList1);

            massTagColl = masstagImporter.Import();

            var chromAligner = new ChromAlignerUsingVIPERInfo();

            chromAligner.Execute(run);

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

            var chromPeakDet = new ChromPeakDetector(0.5, 1);

            var smartchromParam        = new SmartChromPeakSelectorParameters();
            var smartChromPeakSelector = new SmartChromPeakSelector(smartchromParam);

            var basicChromPeakSelector = new BasicChromPeakSelector(new ChromPeakSelectorParameters());



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

            var iterativeTff = new IterativeTFF(new IterativeTFFParameters());

            var fitscoreCalc = new IsotopicProfileFitScoreCalculator();



            var testChromatogramDataFile = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\TargetedWorkflowStandards\massTag635428_chromatogramData.txt";

            var xydata = TestUtilities.LoadXYDataFromFile(testChromatogramDataFile);

            Assert.IsNotNull(xydata);

            run.XYData         = new XYData();
            run.XYData.Xvalues = xydata.Xvalues;
            run.XYData.Yvalues = xydata.Yvalues;
            // run.XYData.Display();

            run.CurrentMassTag = massTagColl.TargetList.Where(p => p.ID == 635428).First();

            Console.WriteLine("------MT = " + run.CurrentMassTag.ToString());

            theorFeatureGen.Execute(run.ResultCollection);
            chromPeakDet.Execute(run.ResultCollection);

            //first run the standard peak selector



            basicChromPeakSelector.Execute(run.ResultCollection);

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

            Assert.AreEqual(10066, (int)Math.Round(result.ChromPeakSelected.XValue));


            //now run the smart chrom peak selector
            run.XYData         = new XYData();
            run.XYData.Xvalues = xydata.Xvalues;
            run.XYData.Yvalues = xydata.Yvalues;
            chromPeakDet.Execute(run.ResultCollection);
            smartChromPeakSelector.Parameters.NETTolerance = 0.025f;
            smartChromPeakSelector.Parameters.MaxScansSummedInDynamicSumming = 51;
            smartChromPeakSelector.Parameters.SummingMode = SummingModeEnum.SUMMINGMODE_DYNAMIC;
            smartChromPeakSelector.Parameters.AreaOfPeakToSumInDynamicSumming = 1;

            smartChromPeakSelector.Execute(run.ResultCollection);

            msgen.Execute(run.ResultCollection);
            iterativeTff.Execute(run.ResultCollection);
            fitscoreCalc.Execute(run.ResultCollection);


            Console.WriteLine(result.ScanSet);
            Assert.AreEqual(14, result.ScanSet.IndexValues.Count);
            Assert.AreEqual(0.0104m, (decimal)Math.Round(result.Score, 4));
            Assert.AreEqual("9575 {9534, 9540, 9547, 9554, 9561, 9568, 9575, 9582, 9589, 9596, 9603, 9610, 9617, 9624}", result.ScanSet.ToString());

            run.XYData         = new XYData();
            run.XYData.Xvalues = xydata.Xvalues;
            run.XYData.Yvalues = xydata.Yvalues;
            chromPeakDet.Execute(run.ResultCollection);
            smartChromPeakSelector.Parameters.NETTolerance = 0.025f;
            smartChromPeakSelector.Parameters.MaxScansSummedInDynamicSumming = 51;
            smartChromPeakSelector.Parameters.SummingMode = SummingModeEnum.SUMMINGMODE_DYNAMIC;
            smartChromPeakSelector.Parameters.AreaOfPeakToSumInDynamicSumming = 2;

            smartChromPeakSelector.Execute(run.ResultCollection);

            msgen.Execute(run.ResultCollection);
            iterativeTff.Execute(run.ResultCollection);
            fitscoreCalc.Execute(run.ResultCollection);

            result.DisplayToConsole();

            Assert.AreEqual(9579, (int)Math.Round(result.ChromPeakSelected.XValue));
            Assert.AreEqual(0.025m, (decimal)(Math.Round(result.Score, 4)));
            //Console.WriteLine(result.ScanSet);
            Assert.AreEqual(26, result.ScanSet.IndexValues.Count);
            Assert.AreEqual("9575 {9493, 9500, 9506, 9513, 9520, 9527, 9534, 9540, 9547, 9554, 9561, 9568, 9575, 9582, 9589, 9596, 9603, 9610, 9617, 9624, 9631, 9638, 9645, 9652, 9658, 9665}", result.ScanSet.ToString());
        }