public ChromPeakAnalyzerIqWorkflow(TargetedWorkflowParameters parameters) : base(parameters) { var iterativeTffParameters = new IterativeTFFParameters(); TargetedMSFeatureFinder = new IterativeTFF(iterativeTffParameters); PeakFitter = new PeakLeastSquaresFitter(); }
public SmartChromPeakSelector(SmartChromPeakSelectorParameters parameters) { this.Parameters = parameters; MSPeakDetector = new DeconToolsPeakDetectorV2(parameters.MSPeakDetectorPeakBR, parameters.MSPeakDetectorSigNoiseThresh, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true); var iterativeTFFParams = new IterativeTFFParameters(); iterativeTFFParams.ToleranceInPPM = parameters.MSToleranceInPPM; iterativeTFFParams.MinimumRelIntensityForForPeakInclusion = parameters.IterativeTffMinRelIntensityForPeakInclusion; if (parameters.MSFeatureFinderType == DeconTools.Backend.Globals.TargetedFeatureFinderType.BASIC) { throw new NotSupportedException("Currently the Basic TFF is not supported in the SmartChromPeakSelector"); //TargetedMSFeatureFinder = new TargetedFeatureFinders.BasicTFF(parameters.MSToleranceInPPM); } else { TargetedMSFeatureFinder = new IterativeTFF(iterativeTFFParams); } resultValidator = new ResultValidatorTask(); fitScoreCalc = new IsotopicProfileFitScoreCalculator(); InterferenceScorer = new InterferenceScorer(); }
protected virtual void DoMainInitialization() { ValidateParameters(); TheorFeatureGen = new JoshTheorFeatureGenerator(DeconTools.Backend.Globals.LabellingType.NONE, 0.005); ChromGen = new PeakChromatogramGenerator(WorkflowParameters.ChromGenTolerance, WorkflowParameters.ChromGeneratorMode, DeconTools.Backend.Globals.IsotopicProfileType.UNLABELLED, WorkflowParameters.ChromGenToleranceUnit) { TopNPeaksLowerCutOff = 0.333, ChromWindowWidthForAlignedData = (float)WorkflowParameters.ChromNETTolerance * 2, ChromWindowWidthForNonAlignedData = (float)WorkflowParameters.ChromNETTolerance * 2 }; //only var allowNegativeValues = false; ChromSmoother = new SavitzkyGolaySmoother(WorkflowParameters.ChromSmootherNumPointsInSmooth, 2, allowNegativeValues); ChromPeakDetector = new ChromPeakDetector(WorkflowParameters.ChromPeakDetectorPeakBR, WorkflowParameters.ChromPeakDetectorSigNoise); ChromPeakSelector = CreateChromPeakSelector(WorkflowParameters); ChromPeakAnalyzer = new ChromPeakAnalyzer(WorkflowParameters); IterativeTffParameters = new IterativeTFFParameters(); IterativeTffParameters.ToleranceInPPM = WorkflowParameters.MSToleranceInPPM; MsfeatureFinder = new IterativeTFF(IterativeTffParameters); FitScoreCalc = new IsotopicProfileFitScoreCalculator(); InterferenceScorer = new InterferenceScorer(); ResultValidator = new ResultValidatorTask(); ChromatogramCorrelator = new IqChromCorrelator(WorkflowParameters.ChromSmootherNumPointsInSmooth, 0.05, WorkflowParameters.ChromGenTolerance); }
protected override void DoPostInitialization() { base.DoPostInitialization(); _iterativeTFFParameters = new IterativeTFFParameters { ToleranceInPPM = _workflowParameters.MSToleranceInPPM }; _iterativeTFFParameters.MinimumRelIntensityForForPeakInclusion = 0.4; //TODO: add comment why we need this _msfeatureFinder = new IterativeTFF(_iterativeTFFParameters); }
public ChromPeakAnalyzer(TargetedWorkflowParameters parameters) { Parameters = parameters; var iterativeTffParameters = new IterativeTFFParameters(); TargetedMSFeatureFinder = new IterativeTFF(iterativeTffParameters); InterferenceScorer = new InterferenceScorer(); MSPeakDetector = new DeconToolsPeakDetectorV2(); FitScoreCalc = new IsotopicProfileFitScoreCalculator(); ResultValidator = new ResultValidatorTask(); }
public void getVeryLowN15ProfileWithIterativeTFFTest1() { var n14n15Util = new N14N15TestingUtilities(); //get sample MS from Test Data var rf = new RunFactory(); var run = rf.CreateRun(N14N15TestingUtilities.MS_AMTTag23085904_z2_sum1_lowN15); run.XYData = N14N15TestingUtilities.GetTestSpectrum(N14N15TestingUtilities.MS_AMTTag23085904_z2_sum1_lowN15); var mt23140708 = n14n15Util.CreateMT23085904_Z2(); run.CurrentMassTag = mt23140708; run.ResultCollection.ResultType = Globals.ResultType.N14N15_TARGETED_RESULT; var theorN14FeatureGen = new TomTheorFeatureGenerator(DeconTools.Backend.Globals.LabellingType.NONE, 0.005); theorN14FeatureGen.GenerateTheorFeature(mt23140708); var theorN15FeatureGen = new TomTheorFeatureGenerator(DeconTools.Backend.Globals.LabellingType.N15, 0.005); theorN15FeatureGen.GenerateTheorFeature(mt23140708); var parameters = new IterativeTFFParameters(); parameters.IsotopicProfileType = Globals.IsotopicProfileType.LABELLED; parameters.ToleranceInPPM = 30; var itff = new IterativeTFF(parameters); itff.Execute(run.ResultCollection); // IsotopicProfile iso = itff.iterativelyFindMSFeature(run, mt23140708.IsotopicProfileLabelled); var result = (N14N15_TResult)run.ResultCollection.GetTargetedResult(run.CurrentMassTag); Assert.IsNotNull(result.IsotopicProfileLabeled); Assert.AreEqual(82280, (int)result.IntensityAggregate); Assert.AreEqual(3, result.IsotopicProfileLabeled.MonoIsotopicPeakIndex); TestUtilities.DisplayIsotopicProfileData(result.IsotopicProfileLabeled); }
public PartialLabelingQuantifier(string element, int lightIsotope, int heavyIsotope, int numLeftZeroPads = 1, int numRightZeroPads = 1, bool isTheorProfileTrimmed = false) { MinLabelAmount = 0; MaxLabelAmount = 100; StepAmountForIterator = 1; _elementLabeled = element; _lightIsotope = lightIsotope; _heavyIsotope = heavyIsotope; _theorLabeledProfiles = new List <IsotopicProfile>(); var tffParameters = new IterativeTFFParameters(); tffParameters.ToleranceInPPM = 30; _iterativeTff = new IterativeTFF(tffParameters); NumLeftZeroPads = numLeftZeroPads; NumRightZeroPads = numRightZeroPads; IsTheoreticalTrimmedDownToObserved = isTheorProfileTrimmed; }
protected virtual void DoMainInitialization() { ValidateParameters(); _theorFeatureGen = new JoshTheorFeatureGenerator(DeconTools.Backend.Globals.LabellingType.NONE, 0.005); _chromGen = new PeakChromatogramGenerator(_workflowParameters.ChromGenTolerance, _workflowParameters.ChromGeneratorMode, DeconTools.Backend.Globals.IsotopicProfileType.UNLABELLED, _workflowParameters.ChromGenToleranceUnit) { TopNPeaksLowerCutOff = 0.333, ChromWindowWidthForAlignedData = (float)_workflowParameters.ChromNETTolerance * 2, ChromWindowWidthForNonAlignedData = (float)_workflowParameters.ChromNETTolerance * 2 }; //only var allowNegativeValues = false; _chromSmoother = new SavitzkyGolaySmoother(_workflowParameters.ChromSmootherNumPointsInSmooth, 2, allowNegativeValues); _chromPeakDetector = new ChromPeakDetectorMedianBased(_workflowParameters.ChromPeakDetectorPeakBR, _workflowParameters.ChromPeakDetectorSigNoise); _chromPeakSelector = CreateChromPeakSelector(_workflowParameters); _iterativeTFFParameters = new IterativeTFFParameters(); _iterativeTFFParameters.ToleranceInPPM = _workflowParameters.MSToleranceInPPM; _msfeatureFinder = new IterativeTFF(_iterativeTFFParameters); _fitScoreCalc = new IsotopicProfileFitScoreCalculator(); _resultValidator = new ResultValidatorTask(); _chromatogramCorrelator = new ChromatogramCorrelator(_workflowParameters.ChromSmootherNumPointsInSmooth, 0.01, _workflowParameters.ChromGenTolerance); ChromatogramXYData = new XYData(); MassSpectrumXYData = new XYData(); ChromPeaksDetected = new List <ChromPeak>(); }
public SaturationDetector(string uimfFileLocation) { _uimfReader = new DataReader(uimfFileLocation); _smoother = new SavitzkyGolaySmoother(9, 2); _peakDetector = new ChromPeakDetector(0.0001, 0.0001); _theoreticalFeatureGenerator = new JoshTheorFeatureGenerator(); if (!_uimfReader.DoesContainBinCentricData()) { DataWriter dataWriter = new DataWriter(uimfFileLocation); dataWriter.CreateBinCentricTables(); } IterativeTFFParameters msFeatureFinderParameters = new IterativeTFFParameters { MinimumRelIntensityForForPeakInclusion = 0.0000000001, PeakDetectorMinimumPeakBR = 0, PeakDetectorPeakBR = 5.00000000000002, PeakBRStep = 0.25, PeakDetectorSigNoiseRatioThreshold = 0.00000000001, ToleranceInPPM = 50 }; _msFeatureFinder = new IterativeTFF(msFeatureFinderParameters); }
/// <summary> /// Initializes a new instance of the <see cref="LcImsPeptideSearchWorkfow"/> class. /// </summary> /// <param name="uimfFileLocation"> /// The uimf file location. /// </param> /// <param name="parameters"> /// The parameters. /// </param> public LcImsPeptideSearchWorkfow(string uimfFileLocation, LcImsPeptideSearchParameters parameters) { this._buildWatershedStopWatch = new Stopwatch(); this._smoothStopwatch = new Stopwatch(); this._featureFindStopWatch = new Stopwatch(); this._featureFindCount = 0; this._pointCount = 0; this._uimfFileLocation = uimfFileLocation; this._uimfReader = new DataReader(uimfFileLocation); // Append bin-centric table to the uimf if not present. if (!this._uimfReader.DoesContainBinCentricData()) { DataWriter dataWriter = new DataWriter(uimfFileLocation); dataWriter.CreateBinCentricTables(); } this._parameters = parameters; this._smoother = new SavitzkyGolaySmoother(parameters.NumPointForSmoothing, 2); this._theoreticalFeatureGenerator = new JoshTheorFeatureGenerator(); this._leftOfMonoPeakLooker = new LeftOfMonoPeakLooker(); this._peakDetector = new ChromPeakDetector(0.0001, 0.0001); this._isotopicPeakFitScoreCalculator = new PeakLeastSquaresFitter(); IterativeTFFParameters msFeatureFinderParameters = new IterativeTFFParameters { MinimumRelIntensityForForPeakInclusion = 0.0001, PeakDetectorMinimumPeakBR = 0.0001, PeakDetectorPeakBR = 5.0002, PeakBRStep = 0.25, PeakDetectorSigNoiseRatioThreshold = 0.0001, ToleranceInPPM = parameters.MassToleranceInPpm }; this._msFeatureFinder = new IterativeTFF(msFeatureFinderParameters); this.NumberOfFrames = this._uimfReader.GetGlobalParams().NumFrames; this.NumberOfScans = this._uimfReader.GetFrameParams(1).Scans; }
protected override void DoPostInitialization() { base.DoPostInitialization(); ValidateParameters(); theorFeatureGen = new JoshTheorFeatureGenerator(DeconTools.Backend.Globals.LabellingType.NONE, 0.005); theorN15FeatureGen = new JoshTheorFeatureGenerator(DeconTools.Backend.Globals.LabellingType.N15, 0.005); chromGenN14 = new PeakChromatogramGenerator(_workflowParameters.ChromGenTolerance, _workflowParameters.ChromGeneratorMode); chromGenN14.TopNPeaksLowerCutOff = 0.333; chromGenN15 = new PeakChromatogramGenerator(_workflowParameters.ChromGenTolerance, DeconTools.Backend.Globals.ChromatogramGeneratorMode.MOST_ABUNDANT_PEAK, DeconTools.Backend.Globals.IsotopicProfileType.LABELLED); chromGenN15.TopNPeaksLowerCutOff = 0.333; var pointsToSmooth = (_workflowParameters.ChromSmootherNumPointsInSmooth + 1) / 2; chromSmoother = new SavitzkyGolaySmoother(_workflowParameters.ChromSmootherNumPointsInSmooth, 2); chromPeakDetector = new ChromPeakDetector(_workflowParameters.ChromPeakDetectorPeakBR, _workflowParameters.ChromPeakDetectorSigNoise); var smartchrompeakSelectorParams = new SmartChromPeakSelectorParameters(); smartchrompeakSelectorParams.MSFeatureFinderType = DeconTools.Backend.Globals.TargetedFeatureFinderType.ITERATIVE; smartchrompeakSelectorParams.MSPeakDetectorPeakBR = _workflowParameters.MSPeakDetectorPeakBR; smartchrompeakSelectorParams.MSPeakDetectorSigNoiseThresh = _workflowParameters.MSPeakDetectorSigNoise; smartchrompeakSelectorParams.MSToleranceInPPM = _workflowParameters.MSToleranceInPPM; smartchrompeakSelectorParams.NETTolerance = (float)_workflowParameters.ChromNETTolerance; smartchrompeakSelectorParams.NumScansToSum = _workflowParameters.NumMSScansToSum; smartchrompeakSelectorParams.NumChromPeaksAllowed = 10; smartchrompeakSelectorParams.IterativeTffMinRelIntensityForPeakInclusion = 0.5; chromPeakSelectorN14 = new SmartChromPeakSelector(smartchrompeakSelectorParams); var chromPeakSelectorParameters = new ChromPeakSelectorParameters(); chromPeakSelectorParameters.NumScansToSum = _workflowParameters.NumMSScansToSum; chromPeakSelectorParameters.NETTolerance = (float)_workflowParameters.ChromNETTolerance; chromPeakSelectorParameters.PeakSelectorMode = DeconTools.Backend.Globals.PeakSelectorMode.N15IntelligentMode; chromPeakSelectorN15 = new BasicChromPeakSelector(chromPeakSelectorParameters); chromPeakSelectorN15.IsotopicProfileType = DeconTools.Backend.Globals.IsotopicProfileType.LABELLED; msPeakDetector = new DeconToolsPeakDetectorV2(_workflowParameters.MSPeakDetectorPeakBR, _workflowParameters.MSPeakDetectorSigNoise, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, false); var iterativeTFFParameters = new IterativeTFFParameters(); iterativeTFFParameters.ToleranceInPPM = _n14N15Workflow2Parameters.TargetedFeatureFinderToleranceInPPM; iterativeTFFParameters.MinimumRelIntensityForForPeakInclusion = 0.33; iterativeTFFParameters.IsotopicProfileType = DeconTools.Backend.Globals.IsotopicProfileType.UNLABELLED; unlabelledProfilefinder = new IterativeTFF(iterativeTFFParameters); iterativeTFFParameters = new IterativeTFFParameters(); iterativeTFFParameters.ToleranceInPPM = _n14N15Workflow2Parameters.TargetedFeatureFinderToleranceInPPM; iterativeTFFParameters.MinimumRelIntensityForForPeakInclusion = 0.33; iterativeTFFParameters.IsotopicProfileType = DeconTools.Backend.Globals.IsotopicProfileType.LABELLED; labelledProfileFinder = new IterativeTFF(iterativeTFFParameters); quantifier = new N14N15QuantifierTask(_n14N15Workflow2Parameters.NumPeaksUsedInQuant, _workflowParameters.MSToleranceInPPM); fitScoreCalc = new IsotopicProfileFitScoreCalculator(); var minRelativeIntensityForScore = 0.2; resultValidatorN14 = new ResultValidatorTask(minRelativeIntensityForScore, true); resultValidatorN15 = new LabelledIsotopicProfileScorer(minRelativeIntensityForScore); ChromatogramXYData = new XYData(); MassSpectrumXYData = new XYData(); ChromPeaksDetected = new List <ChromPeak>(); }
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()); }