protected override void InitializeProcessingTasks() { base.InitializeProcessingTasks(); UimfDriftTimeExtractor = new UIMFDriftTimeExtractor(); UimfTicExtractor = new UIMF_TICExtractor(); SaturationDetector = new SaturationDetector(); }
public void uimf_data_preLoaded() // in this case, data is preloaded, preventing re-accessing the same drifttimes over and over { Run run = new UIMFRun(uimfFilepath); FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, 800, 801, 3, 1); fscc.Create(); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 220, 270, 9, 1); sscc.Create(); ((UIMFRun)run).GetFrameDataAllFrameSets(); // this is the key line... loads data necessary for drift time calc and correction UIMF_MSGenerator msgen = new UIMF_MSGenerator(); DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector(); peakDet.PeakBackgroundRatio = 6; peakDet.SigNoiseThreshold = 3; HornDeconvolutor decon = new HornDeconvolutor(); UIMFDriftTimeExtractor driftTimeExtractor = new UIMFDriftTimeExtractor(); StringBuilder sb = new StringBuilder(); foreach (var frame in ((UIMFRun)run).FrameSetCollection.FrameSetList) { ((UIMFRun)run).CurrentFrameSet = frame; foreach (var scan in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDet.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); driftTimeExtractor.Execute(run.ResultCollection); } } foreach (var item in run.ResultCollection.ResultList) { UIMFIsosResult isosresult = (UIMFIsosResult)item; sb.Append(isosresult.FrameSet.PrimaryFrame); sb.Append("\t"); sb.Append(isosresult.ScanSet.PrimaryScanNumber); sb.Append("\t"); sb.Append(isosresult.IsotopicProfile.MonoPeakMZ.ToString("0.000")); sb.Append("\t"); sb.Append(isosresult.DriftTime.ToString("0.000")); sb.Append(Environment.NewLine); } Console.Write(sb.ToString()); }
protected override void InitializeProcessingTasks() { base.InitializeProcessingTasks(); UimfDriftTimeExtractor = new UIMFDriftTimeExtractor(); UimfTicExtractor = new UIMF_TICExtractor(); SaturationDetector = new SaturationDetector(); mCachedProgressMessage = string.Empty; mLastProgress = DateTime.UtcNow; }
public void uimf_data_not_preLoaded() // in this case the drift time is calculated every time by looking up sqlite data from uimf file { Run run = new UIMFRun(uimfFilepath); FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, 800, 801, 3, 1); fscc.Create(); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 220, 270, 9, 1); sscc.Create(); UIMF_MSGenerator msgen = new UIMF_MSGenerator(); DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector(); peakDet.PeakBackgroundRatio = 6; peakDet.SigNoiseThreshold = 3; HornDeconvolutor decon = new HornDeconvolutor(); UIMFDriftTimeExtractor driftTimeExtractor = new UIMFDriftTimeExtractor(); StringBuilder sb = new StringBuilder(); foreach (var frame in ((UIMFRun)run).FrameSetCollection.FrameSetList) { ((UIMFRun)run).CurrentFrameSet = frame; foreach (var scan in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDet.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); driftTimeExtractor.Execute(run.ResultCollection); } } foreach (var item in run.ResultCollection.ResultList) { UIMFIsosResult isosresult = (UIMFIsosResult)item; sb.Append(isosresult.FrameSet.PrimaryFrame); sb.Append("\t"); sb.Append(isosresult.ScanSet.PrimaryScanNumber); sb.Append("\t"); sb.Append(isosresult.IsotopicProfile.MonoPeakMZ.ToString("0.000")); sb.Append("\t"); sb.Append(isosresult.DriftTime.ToString("0.000")); sb.Append(Environment.NewLine); } Console.Write(sb.ToString()); }
public static Run CreateResultsFromTwoFramesOfStandardUIMFData() { var run = new UIMFRun(FileRefs.RawDataMSFiles.UIMFStdFile1); run.ResultCollection.ResultType = Globals.ResultType.UIMF_TRADITIONAL_RESULT; run.ScanSetCollection.Create(run, 500, 501, 3, 1); run.IMSScanSetCollection.Create(run, 250, 270, 9, 1); Task msgen = new UIMF_MSGenerator(); Task peakDetector = new DeconToolsPeakDetectorV2(); Task decon = new ThrashDeconvolutorV2(); Task msScanInfoCreator = new ScanResultUpdater(); Task flagger = new ResultValidatorTask(); Task ticExtractor = new DeconTools.Backend.ProcessingTasks.UIMF_TICExtractor(); Task driftTimeextractor = new UIMFDriftTimeExtractor(); foreach (var frame in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = frame; foreach (IMSScanSet scan in run.IMSScanSetCollection.ScanSetList) { run.CurrentIMSScanSet = scan; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); flagger.Execute(run.ResultCollection); driftTimeextractor.Execute(run.ResultCollection); msScanInfoCreator.Execute(run.ResultCollection); ticExtractor.Execute(run.ResultCollection); } } return(run); }
public void smallExportTest1() { Project project = Project.getInstance(); //TODO: add project parameters (for summing) project.RunCollection.Add(new UIMFRun(uimfFilepath, 1200, 1202, 250, 300)); Task msGen = new UIMF_MSGenerator(200, 2000); DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(); detectorParams.PeakBackgroundRatio = 3; detectorParams.PeakFitType = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC; detectorParams.SignalToNoiseThreshold = 3; detectorParams.ThresholdedData = false; Task peakDetector = new DeconToolsPeakDetector(detectorParams); Task decon = new HornDeconvolutor(); Task driftTimeExtractor = new UIMFDriftTimeExtractor(); project.TaskCollection.TaskList.Add(msGen); project.TaskCollection.TaskList.Add(peakDetector); project.TaskCollection.TaskList.Add(decon); project.TaskCollection.TaskList.Add(driftTimeExtractor); TaskController controller = new UIMF_TaskController(project.TaskCollection); controller.Execute(project.RunCollection); UIMFIsosExporter isosExporter = new UIMFIsosExporter(uimfIsosExporterTest1output); isosExporter.Export(project.RunCollection[0].ResultCollection); }
public void test1() { Run uimfrun = new UIMFRun(inputUIMFFile1); int startFrame = 800; int stopFrame = 800; int numFramesSummed = 3; int numScansSummed = 9; FrameSetCollectionCreator framesetCreator = new FrameSetCollectionCreator(uimfrun, startFrame, stopFrame, numFramesSummed, 1); framesetCreator.Create(); ScanSetCollectionCreator scansetCreator = new ScanSetCollectionCreator(uimfrun, 230, 240, numScansSummed, 1, false); scansetCreator.Create(); Project project = Project.getInstance(); project.RunCollection.Add(uimfrun); Task msGen = new UIMF_MSGenerator(200, 2000); DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(); detectorParams.PeakBackgroundRatio = 3; detectorParams.PeakFitType = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC; detectorParams.SignalToNoiseThreshold = 3; detectorParams.ThresholdedData = false; Task peakDetector = new DeconToolsPeakDetector(detectorParams); Task decon = new HornDeconvolutor(); Task driftTimeExtractor = new UIMFDriftTimeExtractor(); project.TaskCollection.TaskList.Add(msGen); project.TaskCollection.TaskList.Add(peakDetector); project.TaskCollection.TaskList.Add(decon); project.TaskCollection.TaskList.Add(driftTimeExtractor); TaskController controller = new UIMF_TaskController(project.TaskCollection); controller.Execute(project.RunCollection); Assert.AreEqual(252, project.RunCollection[0].ResultCollection.ResultList.Count); if (File.Exists(outputFile1)) { File.Delete(outputFile1); } Stopwatch sw = new Stopwatch(); sw.Start(); UIMFSQLiteIsosExporter isosExporter = new UIMFSQLiteIsosExporter(outputFile1); isosExporter.Export(project.RunCollection[0].ResultCollection); sw.Stop(); Console.Write("\n\n----------- Time taken for UIMFSQLiteIsosExporter (milliseconds) = \t" + sw.ElapsedMilliseconds); }