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()); }
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); }