public static Run CreateResultsFromThreeScansOfStandardOrbitrapData() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); run.ScanSetCollection.Create(run, 6000, 6020, 1, 1, false); Task msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); Task peakDetector = new DeconToolsPeakDetectorV2(); Task decon = new ThrashDeconvolutorV2(); Task msScanInfoCreator = new ScanResultUpdater(); Task flagger = new ResultValidatorTask(); foreach (var scan in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); msScanInfoCreator.Execute(run.ResultCollection); flagger.Execute(run.ResultCollection); } return(run); }
protected virtual void InitializeProcessingTasks() { MSGenerator = MSGeneratorFactory.CreateMSGenerator(Run.MSFileType); PeakDetector = PeakDetectorFactory.CreatePeakDetector(NewDeconToolsParameters); Deconvolutor = DeconvolutorFactory.CreateDeconvolutor(NewDeconToolsParameters); //the new iThrash imports the _peaks.txt file if (Deconvolutor is DeconTools.Backend.ProcessingTasks.Deconvoluters.InformedThrashDeconvolutor) { _deconvolutorRequiresPeaksFile = true; } //Will initialize these but whether or not they are used are determined elsewhere ZeroFiller = new DeconToolsZeroFiller(NewDeconToolsParameters.MiscMSProcessingParameters.ZeroFillingNumZerosToFill); Smoother = new SavitzkyGolaySmoother(NewDeconToolsParameters.MiscMSProcessingParameters.SavitzkyGolayNumPointsInSmooth, NewDeconToolsParameters.MiscMSProcessingParameters.SavitzkyGolayOrder); FitScoreCalculator = new DeconToolsFitScoreCalculator(); ScanResultUpdater = new ScanResultUpdater(NewDeconToolsParameters.ScanBasedWorkflowParameters.ProcessMS2); ResultValidator = new ResultValidatorTask(); IsosResultExporter = IsosExporterFactory.CreateIsosExporter(Run.ResultCollection.ResultType, ExporterType, IsosOutputFileName); ScanResultExporter = ScansExporterFactory.CreateScansExporter(Run.MSFileType, ExporterType, ScansOutputFileName); if (!_deconvolutorRequiresPeaksFile) { PeakListExporter = PeakListExporterFactory.Create(ExporterType, Run.MSFileType, PeakListExporterTriggerValue, PeakListOutputFileName); } PeakToMSFeatureAssociator = new PeakToMSFeatureAssociator(); }
public void peakDetectionOnXCaliburTest1() { Run run = new XCaliburRun(xcaliburTestfile, 6000, 7000); ScanSetCollection scansetCollection = new ScanSetCollection(); for (int i = 6000; i < 6015; i++) { scansetCollection.ScanSetList.Add(new ScanSet(i)); } ResultCollection results = new ResultCollection(run); foreach (ScanSet scanset in scansetCollection.ScanSetList) { run.CurrentScanSet = scanset; Task msgen = new GenericMSGenerator(); msgen.Execute(results); Task peakDetector = new DeconToolsPeakDetector(); peakDetector.Execute(results); Task scanResultUpdater = new ScanResultUpdater(); scanResultUpdater.Execute(results); } Assert.AreEqual(2, results.ScanResultList.Count); }
public void outputToSqlite_uimf_test1() { List <Run> runcoll = new List <Run>(); Run run = new UIMFRun(uimfFile1); runcoll.Add(run); FrameSetCollectionCreator fsc = new FrameSetCollectionCreator(run, 800, 809, 3, 1); fsc.Create(); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 200, 220, 9, 1); sscc.Create(); Task msgen = new UIMF_MSGenerator(); Task peakDetector = new DeconToolsPeakDetector(); Task decon = new RapidDeconvolutor(); Task driftTimeExtractor = new DeconTools.Backend.ProcessingTasks.UIMFDriftTimeExtractor(); Task origIntensExtr = new DeconTools.Backend.ProcessingTasks.OriginalIntensitiesExtractor(); Task ticExtractor = new DeconTools.Backend.ProcessingTasks.UIMF_TICExtractor(); Task scanResultUpdater = new ScanResultUpdater(); Task sqliteExporter = new DeconTools.Backend.ProcessingTasks.ResultExporters.ScanResultExporters.UIMFScanResult_SqliteExporter(uimf_Sqlite_ScanResultOutputFile1); Stopwatch sw; foreach (FrameSet frame in ((UIMFRun)run).FrameSetCollection.FrameSetList) { ((UIMFRun)run).CurrentFrameSet = frame; foreach (ScanSet scan in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); ticExtractor.Execute(run.ResultCollection); scanResultUpdater.Execute(run.ResultCollection); driftTimeExtractor.Execute(run.ResultCollection); origIntensExtr.Execute(run.ResultCollection); sw = new Stopwatch(); sw.Start(); sqliteExporter.Execute(run.ResultCollection); sw.Stop(); if (sw.ElapsedMilliseconds > 10) { Console.WriteLine("SqliteExporter execution time = \t" + sw.ElapsedMilliseconds); } } } }
public void xcaliburSpeed_RAPID_Test1() { Run run = new XCaliburRun(xcaliburTestfile); int startScan = 6005; int stopScan = 7000; int numScansSummed = 1; ScanSetCollectionCreator scanSetCreator = new ScanSetCollectionCreator(run, startScan, stopScan, numScansSummed, 1); scanSetCreator.Create(); ResultCollection results = new ResultCollection(run); List <timingResult> timingResults = new List <timingResult>(); System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); foreach (ScanSet scanset in run.ScanSetCollection.ScanSetList) { if (results.Run.GetMSLevel(scanset.PrimaryScanNumber) != 1) { continue; } sw.Reset(); timingResult timeresult = new timingResult(); timeresult.frameNum = -1; timeresult.scanNum = scanset.PrimaryScanNumber; sw.Start(); run.CurrentScanSet = scanset; Task msgen = new GenericMSGenerator(); msgen.Execute(results); timeresult.msGenTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); Task peakDetector = new DeconToolsPeakDetector(); peakDetector.Execute(results); timeresult.peakDetectorTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); Task rapid = new RapidDeconvolutor(); rapid.Execute(results); timeresult.deconTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); Task scanResultUpdater = new ScanResultUpdater(); scanResultUpdater.Execute(results); timeresult.resultUpdaterTime = sw.ElapsedMilliseconds; timingResults.Add(timeresult); } reportTimingEachScan(timingResults); }
public void ExportMultipleScansTest1() { Run run = new IMFRun(imfFilepath); ScanSetCollection scanSetCollection = new ScanSetCollection(); scanSetCollection.ScanSetList.Add(new ScanSet(232)); scanSetCollection.ScanSetList.Add(new ScanSet(233)); scanSetCollection.ScanSetList.Add(new ScanSet(234)); ResultCollection results = new ResultCollection(run); foreach (ScanSet scanset in scanSetCollection.ScanSetList) { run.CurrentScanSet = scanset; Task msGen = new GenericMSGenerator(); msGen.Execute(results); 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); peakDetector.Execute(results); Task decon = new RapidDeconvolutor(); decon.Execute(results); Task scanResultUpdater = new ScanResultUpdater(); scanResultUpdater.Execute(results); } Assert.AreEqual(3, results.ScanResultList.Count); Assert.AreEqual(92, results.ScanResultList[0].NumPeaks); Assert.AreEqual(82, results.ScanResultList[1].NumPeaks); Assert.AreEqual(72, results.ScanResultList[2].NumPeaks); Assert.AreEqual(11, results.ScanResultList[0].NumIsotopicProfiles); Assert.AreEqual(9, results.ScanResultList[1].NumIsotopicProfiles); Assert.AreEqual(9, results.ScanResultList[2].NumIsotopicProfiles); Assert.AreEqual(830.045752112968, (Decimal)results.ScanResultList[0].BasePeak.XValue); Assert.AreEqual(10438, results.ScanResultList[0].BasePeak.Height); Assert.AreEqual(0.09454554, (Decimal)results.ScanResultList[0].BasePeak.Width); Assert.AreEqual(434.9167, (Decimal)results.ScanResultList[0].BasePeak.SN); Exporter <ResultCollection> exporter = new BasicScansExporter(scansExporterTest1output); exporter.Export(results); }
public void test1_summing() { Project.Reset(); Project project = Project.getInstance(); UIMFRun run = new UIMFRun(uimfFilepath, 1201, 1201); project.RunCollection.Add(run); int numFramesSummed = 3; int numScansSummed = 3; ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 250, 270, numScansSummed, 1); sscc.Create(); FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, numFramesSummed, 1); fscc.Create(); 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; Task peakDetector = new DeconToolsPeakDetector(detectorParams); Task decon = new HornDeconvolutor(); Task scanResultsUpdater = new ScanResultUpdater(); Task originalIntensitiesExtractor = new OriginalIntensitiesExtractor(); project.TaskCollection.TaskList.Add(msGen); project.TaskCollection.TaskList.Add(peakDetector); project.TaskCollection.TaskList.Add(decon); project.TaskCollection.TaskList.Add(scanResultsUpdater); project.TaskCollection.TaskList.Add(originalIntensitiesExtractor); TaskController controller = new UIMF_TaskController(project.TaskCollection); controller.Execute(project.RunCollection); ResultCollection rc = project.RunCollection[0].ResultCollection; Assert.AreEqual(180, rc.ResultList.Count); StringBuilder sb = new StringBuilder(); IsosResultUtilities.DisplayResults(sb, rc.ResultList); Console.Write(sb.ToString()); }
public void multipleFrames_horn_test1() { Project.Reset(); Project project = Project.getInstance(); project.LoadOldDecon2LSParameters(uimfParameters1); UIMFRun run = new UIMFRun(uimfFilepath, 1201, 1203); project.RunCollection.Add(run); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 9, 1); sscc.Create(); FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, 1, 1); fscc.Create(); Task msGen = new UIMF_MSGenerator(0, 5000); Task zeroFiller = new DeconToolsZeroFiller(3); Task peakDetector = new DeconToolsPeakDetector(project.Parameters.OldDecon2LSParameters.PeakProcessorParameters); Task decon = new HornDeconvolutor(project.Parameters.OldDecon2LSParameters.HornTransformParameters); Task scanResultsUpdater = new ScanResultUpdater(); project.TaskCollection.TaskList.Add(msGen); project.TaskCollection.TaskList.Add(zeroFiller); project.TaskCollection.TaskList.Add(peakDetector); project.TaskCollection.TaskList.Add(decon); project.TaskCollection.TaskList.Add(scanResultsUpdater); Stopwatch sw = new Stopwatch(); sw.Start(); TaskController controller = new UIMF_TaskController(project.TaskCollection); controller.Execute(project.RunCollection); sw.Stop(); Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds); Console.WriteLine("Scans analyzed = " + project.RunCollection[0].ScanSetCollection.ScanSetList.Count); Console.WriteLine("Features found = " + project.RunCollection[0].ResultCollection.ResultList.Count); Console.WriteLine("Peaks found = " + project.RunCollection[0].ResultCollection.ScanResultList[0].NumPeaks); StringBuilder sb = new StringBuilder(); }
public void DeconToolsPeakDetectionTest1() { Run run = new MSScanFromTextFileRun(imfMSScanTextfile); ResultCollection resultcollection = new ResultCollection(run); Task msgen = new GenericMSGenerator(); msgen.Execute(resultcollection); 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); peakdetector.Execute(resultcollection); Assert.AreEqual(82, resultcollection.Run.PeakList.Count); Assert.AreEqual(167.243318707619, Convert.ToDecimal(resultcollection.Run.CurrentScanSet.BackgroundIntensity)); detectorParams.PeakBackgroundRatio = 2; peakdetector = new DeconToolsPeakDetector(detectorParams); peakdetector.Execute(resultcollection); Assert.AreEqual(154, resultcollection.Run.PeakList.Count); Assert.AreEqual(167.243318707619, Convert.ToDecimal(resultcollection.Run.CurrentScanSet.BackgroundIntensity)); detectorParams.PeakBackgroundRatio = 2; detectorParams.SignalToNoiseThreshold = 1; peakdetector = new DeconToolsPeakDetector(detectorParams); peakdetector.Execute(resultcollection); Assert.AreEqual(156, resultcollection.Run.PeakList.Count); Assert.AreEqual(167.243318707619, Convert.ToDecimal(resultcollection.Run.CurrentScanSet.BackgroundIntensity)); detectorParams.PeakBackgroundRatio = 3; detectorParams.SignalToNoiseThreshold = 3; detectorParams.ThresholdedData = true; peakdetector = new DeconToolsPeakDetector(detectorParams); peakdetector.Execute(resultcollection); Task scanresultUpdater = new ScanResultUpdater(); scanresultUpdater.Execute(resultcollection); Assert.AreEqual(82, resultcollection.Run.PeakList.Count); Assert.AreEqual(1, resultcollection.ScanResultList.Count); Assert.AreEqual(82, resultcollection.ScanResultList[0].NumPeaks); Assert.AreEqual(167.243318707619, Convert.ToDecimal(resultcollection.Run.CurrentScanSet.BackgroundIntensity)); }
public void outputToText_xcaliburData_Test1() { List <Run> runcoll = new List <Run>(); Run run = new XCaliburRun(xcaliburFile1); runcoll.Add(run); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 6000, 6100, 1, 1); sscc.Create(); Task msgen = new GenericMSGenerator(); Task peakDetector = new DeconToolsPeakDetector(); Task decon = new RapidDeconvolutor(); Task textScanResultExporter = new DeconTools.Backend.ProcessingTasks.ResultExporters.ScanResultExporters.BasicScanResult_TextFileExporter(xcalibur_text_ScanResultOutputFile1); Task scanResultUpdater = new ScanResultUpdater(); Stopwatch sw; foreach (ScanSet scan in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); scanResultUpdater.Execute(run.ResultCollection); sw = new Stopwatch(); sw.Start(); textScanResultExporter.Execute(run.ResultCollection); sw.Stop(); if (sw.ElapsedMilliseconds > 10) { Console.WriteLine("Exporter execution time = \t" + sw.ElapsedMilliseconds); } } //TaskCollection taskColl=new TaskCollection(); //taskColl.TaskList.Add(msgen); //taskColl.TaskList.Add(peakDetector); //taskColl.TaskList.Add(decon); //taskColl.TaskList.Add(sqliteExporter); //TaskController controller = new BasicTaskController(taskColl); //controller.Execute(runcoll); }
public void test1() { Run run0 = new XCaliburRun(c2_blankfilePath); Run run1 = new XCaliburRun(c2_6FilePath); Run run2 = new XCaliburRun(c2_7FilePath); Run run3 = new XCaliburRun(c2_8FilePath); Run run4 = new XCaliburRun(c2_9FilePath); Run run5 = new XCaliburRun(c2_10FilePath); Project.getInstance().RunCollection.Add(run0); Project.getInstance().RunCollection.Add(run1); Project.getInstance().RunCollection.Add(run2); Project.getInstance().RunCollection.Add(run3); Project.getInstance().RunCollection.Add(run4); Project.getInstance().RunCollection.Add(run5); foreach (Run run in Project.getInstance().RunCollection) { ScanSetCollectionCreator scansetCreator = new ScanSetCollectionCreator(run, 1, 1); scansetCreator.Create(); } Task msgen = new GenericMSGenerator(); Task peakDetector = new DeconToolsPeakDetector(); Task decon = new SimpleDecon(); Task isosMergerExporter = new BasicIsosMergerExporter("..\\..\\TestFiles\\MergeTestFiles\\BasicIsosMergerExporterTest1Output_isos.csv"); Task scansupdater = new ScanResultUpdater(); Task scansMergerExporter = new BasicScansMergerExporter("..\\..\\TestFiles\\MergeTestFiles\\BasicIsosMergerExporterTest1Output_scans.csv"); Project.getInstance().TaskCollection.TaskList.Add(msgen); Project.getInstance().TaskCollection.TaskList.Add(peakDetector); Project.getInstance().TaskCollection.TaskList.Add(decon); Project.getInstance().TaskCollection.TaskList.Add(isosMergerExporter); Project.getInstance().TaskCollection.TaskList.Add(scansupdater); Project.getInstance().TaskCollection.TaskList.Add(scansMergerExporter); BasicTaskController taskController = new BasicTaskController(Project.getInstance().TaskCollection); taskController.Execute(Project.getInstance().RunCollection); TaskCleaner cleaner = new TaskCleaner(Project.getInstance().TaskCollection); cleaner.CleanTasks(); }
public void examineFPGAFileTest1() { UIMFRun run = new UIMFRun(uimfFPGAFilePath); 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; Task peakDetector = new DeconToolsPeakDetector(detectorParams); Task decon = new HornDeconvolutor(); Task scanResultsUpdater = new ScanResultUpdater(); Task originalIntensitiesExtractor = new OriginalIntensitiesExtractor(); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 300, 300, 1, 1); sscc.Create(); FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, 5, 5, 1, 1); fscc.Create(); foreach (var frame in run.FrameSetCollection.FrameSetList) { run.CurrentFrameSet = frame; foreach (var scan in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scan; msGen.Execute(run.ResultCollection); //TestUtilities.DisplayXYValues(run.XYData); originalIntensitiesExtractor.Execute(run.ResultCollection); TestUtilities.DisplayXYValues(run.XYData); } } }
public void test1() { Project project = Project.getInstance(); //TODO: add project parameters (for summing) Run run = new UIMFRun(uimfFilepath, 1200, 1202, 300, 400); project.RunCollection.Add(run); FrameSetCollectionCreator framesetCreator = new FrameSetCollectionCreator(run, ((UIMFRun)run).MinFrame, ((UIMFRun)run).MaxFrame, 1, 1); framesetCreator.Create(); ScanSetCollectionCreator scanSetcreator = new ScanSetCollectionCreator(run, run.MinScan, run.MaxScan, 1, 1, false); scanSetcreator.Create(); 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 rapidDecon = new RapidDeconvolutor(); Task scanresultUpdater = new ScanResultUpdater(); project.TaskCollection.TaskList.Add(msGen); project.TaskCollection.TaskList.Add(peakDetector); project.TaskCollection.TaskList.Add(rapidDecon); project.TaskCollection.TaskList.Add(scanresultUpdater); TaskController controller = new UIMF_TaskController(project.TaskCollection); controller.Execute(project.RunCollection); UIMFScansExporter scansExporter = new UIMFScansExporter(uimfScansExporterTest1output); scansExporter.Export(project.RunCollection[0].ResultCollection); }
public void outputToSqlite_xcaliburData_Test1() { List <Run> runcoll = new List <Run>(); Run run = new XCaliburRun(xcaliburFile1); runcoll.Add(run); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 6000, 6100, 1, 1, false); sscc.Create(); Task msgen = new GenericMSGenerator(); Task peakDetector = new DeconToolsPeakDetector(); Task decon = new RapidDeconvolutor(); Task sqliteScanResultExporter = new DeconTools.Backend.ProcessingTasks.ResultExporters.ScanResultExporters.BasicScanResult_SqliteExporter(xcalibur_sqlite_ScanResultOutputFile1); Task peakExporter = new DeconTools.Backend.ProcessingTasks.PeakListExporters.PeakListSQLiteExporter(100000, peakExporter1); Task scanResultUpdater = new ScanResultUpdater(); Stopwatch sw; foreach (ScanSet scan in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); scanResultUpdater.Execute(run.ResultCollection); sw = new Stopwatch(); sw.Start(); sqliteScanResultExporter.Execute(run.ResultCollection); sw.Stop(); if (sw.ElapsedMilliseconds > 10) { Console.WriteLine("SqliteExporter execution time = \t" + sw.ElapsedMilliseconds); } peakExporter.Execute(run.ResultCollection); } }
public void updateScanResultsOnXCaliburFileTest1() { Run run = new XCaliburRun(xcaliburTestfile, 6000, 7000); ScanSetCollection scansetCollection = new ScanSetCollection(); for (int i = 6000; i < 6015; i++) { scansetCollection.ScanSetList.Add(new ScanSet(i)); } ResultCollection results = new ResultCollection(run); foreach (ScanSet scanset in scansetCollection.ScanSetList) { run.CurrentScanSet = scanset; Task msgen = new GenericMSGenerator(0, 2000); msgen.Execute(results); Task peakDetector = new DeconToolsPeakDetector(); peakDetector.Execute(results); Task rapid = new RapidDeconvolutor(); rapid.Execute(results); Task scanResultUpdater = new ScanResultUpdater(); scanResultUpdater.Execute(results); } Assert.AreEqual(2, results.ScanResultList.Count); Assert.AreEqual(1, results.ScanResultList[0].SpectrumType); Assert.AreEqual(481.274105402604, (decimal)results.ScanResultList[0].BasePeak.XValue); Assert.AreEqual(353, results.ScanResultList[0].NumIsotopicProfiles); Assert.AreEqual(2052, results.ScanResultList[0].NumPeaks); //Assert.AreEqual(2132, results.ScanResultList[0].NumPeaks); Assert.AreEqual(32.6941466666667, (decimal)results.ScanResultList[0].ScanTime); Assert.AreEqual(6005, results.ScanResultList[0].ScanSet.PrimaryScanNumber); Assert.AreEqual(362, results.ScanResultList[1].NumIsotopicProfiles); //Assert.AreEqual(370, results.ScanResultList[1].NumIsotopicProfiles); Assert.AreEqual(715, results.ResultList.Count); }
public static Run CreatePeakDataFromStandardOrbitrapData() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); run.ScanSetCollection.Create(run, 6000, 6050, 1, 1, false); Task msgen = new GenericMSGenerator(); var peakDetector = new DeconToolsPeakDetectorV2(); peakDetector.PeaksAreStored = true; Task decon = new ThrashDeconvolutorV2(); Task msScanInfoCreator = new ScanResultUpdater(); Task flagger = new ResultValidatorTask(); foreach (var scan in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); } return(run); }
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 test1() { Project.Reset(); Project project = Project.getInstance(); UIMFRun run = new UIMFRun(uimfFilepath, 1200, 1202); project.RunCollection.Add(run); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 1, 1); sscc.Create(); FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, 1, 1); fscc.Create(); 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 rapidDecon = new RapidDeconvolutor(); Task scanResultsUpdater = new ScanResultUpdater(); project.TaskCollection.TaskList.Add(msGen); project.TaskCollection.TaskList.Add(peakDetector); project.TaskCollection.TaskList.Add(rapidDecon); project.TaskCollection.TaskList.Add(scanResultsUpdater); Stopwatch sw = new Stopwatch(); sw.Start(); TaskController controller = new UIMF_TaskController(project.TaskCollection); controller.Execute(project.RunCollection); sw.Stop(); Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds); Console.WriteLine("Scans analyzed = " + project.RunCollection[0].ScanSetCollection.ScanSetList.Count); Console.WriteLine("Features found = " + project.RunCollection[0].ResultCollection.ResultList.Count); Assert.AreEqual(1, Project.getInstance().RunCollection.Count); Assert.AreEqual(4, project.TaskCollection.TaskList.Count); Assert.AreEqual(600, project.RunCollection[0].ScanSetCollection.ScanSetList.Count); UIMFRun uimfRun = (UIMFRun)(project.RunCollection[0]); Assert.AreEqual(3, uimfRun.FrameSetCollection.FrameSetList.Count); StringBuilder sb = new StringBuilder(); foreach (IsosResult result in project.RunCollection[0].ResultCollection.ResultList) { Assert.IsInstanceOfType(typeof(UIMFIsosResult), result); UIMFIsosResult uimfResult = (UIMFIsosResult)result; sb.Append(uimfResult.FrameSet.PrimaryFrame); sb.Append("\t"); sb.Append(uimfResult.ScanSet.PrimaryScanNumber); sb.Append("\t"); sb.Append(uimfResult.IsotopicProfile.Peaklist[0].XValue); sb.Append("\t"); sb.Append(uimfResult.IsotopicProfile.GetAbundance()); sb.Append("\t"); //sb.Append(uimfResult.IsotopicProfile. sb.Append(Environment.NewLine); } Console.Write(sb.ToString()); }
public void updateScanResultsUIMFFileTest1() { UIMFRun run = new UIMFRun(uimfFilepath); run.FrameSetCollection = new FrameSetCollection(); for (int i = 1200; i < 1203; i++) { run.FrameSetCollection.FrameSetList.Add(new FrameSet(i)); } run.ScanSetCollection = new ScanSetCollection(); for (int i = 200; i < 304; i++) { run.ScanSetCollection.ScanSetList.Add(new ScanSet(i)); } StreamWriter sw; ResultCollection results = new ResultCollection(run); Task msgen = new UIMF_MSGenerator(); Task peakDetector = new DeconToolsPeakDetector(); Task rapid = new RapidDeconvolutor(); Task scanResultUpdater = new ScanResultUpdater(); Task peakListExporter = new PeakListTextExporter(run.MSFileType, peakListoutputPath); foreach (FrameSet frameset in run.FrameSetCollection.FrameSetList) { ((UIMFRun)run).CurrentFrameSet = frameset; foreach (ScanSet scanset in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scanset; msgen.Execute(results); peakDetector.Execute(results); rapid.Execute(results); scanResultUpdater.Execute(results); peakListExporter.Execute(results); } } peakListExporter.Cleanup(); Assert.AreEqual(3, results.ScanResultList.Count); Assert.AreEqual(1, results.ScanResultList[0].SpectrumType); Assert.AreEqual(670.990710325132, (decimal)results.ScanResultList[0].BasePeak.XValue); Assert.AreEqual(183, results.ScanResultList[0].NumIsotopicProfiles); Assert.AreEqual(7097, results.ScanResultList[0].NumPeaks); Assert.AreEqual(-1, (decimal)results.ScanResultList[0].ScanTime); UIMFScanResult uimfScanresult1 = (UIMFScanResult)(results.ScanResultList[0]); Assert.AreEqual(4.0, uimfScanresult1.FramePressureFront); Assert.AreEqual(4.016, uimfScanresult1.FramePressureBack); Assert.AreEqual(1200, uimfScanresult1.Frameset.PrimaryFrame); Assert.AreEqual(504, results.ResultList.Count); }
public void IMFcompareToCanonicalResults_noSumming() { //generate results using new framework int numScansSummed = 1; Run run = new IMFRun(imfFilepath); ResultCollection results = new ResultCollection(run); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 231, 233, numScansSummed, 1, false); sscc.Create(); ParameterLoader loader = new ParameterLoader(); loader.LoadParametersFromFile(qtParameterfile1); foreach (ScanSet scanset in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scanset; Task msgen = new GenericMSGenerator(); msgen.Execute(results); Task peakDetector = new DeconToolsPeakDetector(loader.PeakParameters); peakDetector.Execute(results); Task horndecon = new HornDeconvolutor(loader.TransformParameters); horndecon.Execute(results); Task scanResultUpdater = new ScanResultUpdater(); scanResultUpdater.Execute(results); } //read in results from canonical _isos List <IsosResult> canonIsos = readInIsos(canonIMFIsosFilename, Globals.MSFileType.PNNL_IMS); Assert.AreEqual(canonIsos.Count, results.ResultList.Count); //compare numbers StringBuilder sb = new StringBuilder(); for (int i = 0; i < results.ResultList.Count; i++) { sb.Append("scanmass\t"); sb.Append(results.ResultList[i].ScanSet.PrimaryScanNumber); sb.Append("\t"); sb.Append(canonIsos[i].ScanSet.PrimaryScanNumber); sb.Append("\n"); sb.Append("monoMass\t"); sb.Append(results.ResultList[i].IsotopicProfile.MonoIsotopicMass.ToString("0.0000")); sb.Append("\t"); sb.Append(canonIsos[i].IsotopicProfile.MonoIsotopicMass); sb.Append("\n"); sb.Append("intens\t"); sb.Append(results.ResultList[i].IsotopicProfile.IntensityAggregate); sb.Append("\t"); sb.Append(canonIsos[i].IsotopicProfile.IntensityAggregate); sb.Append("\n"); sb.Append("score\t"); sb.Append(results.ResultList[i].IsotopicProfile.Score.ToString("0.0000")); sb.Append("\t"); sb.Append(canonIsos[i].IsotopicProfile.Score); sb.Append("\n"); sb.Append("FWHM\t"); sb.Append(results.ResultList[i].IsotopicProfile.GetFWHM().ToString("0.0000")); sb.Append("\t"); sb.Append(canonIsos[i].IsotopicProfile.GetFWHM()); sb.Append("\n"); sb.Append("s/n\t"); sb.Append(results.ResultList[i].IsotopicProfile.GetSignalToNoise().ToString("0.0000")); sb.Append("\t"); sb.Append(canonIsos[i].IsotopicProfile.GetSignalToNoise()); sb.Append("\n"); sb.Append("\n"); } Console.Write(sb.ToString()); }
public void xcaliburSpeed_THRASH_Test1() { Run run = new XCaliburRun(xcaliburTestfile); int startScan = 6005; int stopScan = 6050; int numScansSummed = 1; ScanSetCollectionCreator scanSetCreator = new ScanSetCollectionCreator(run, startScan, stopScan, numScansSummed, 1); scanSetCreator.Create(); ResultCollection results = new ResultCollection(run); List <timingResult> timingResults = new List <timingResult>(); System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); foreach (ScanSet scanset in run.ScanSetCollection.ScanSetList) { if (results.Run.GetMSLevel(scanset.PrimaryScanNumber) != 1) { continue; } sw.Reset(); timingResult timeresult = new timingResult(); timeresult.frameNum = -1; timeresult.scanNum = scanset.PrimaryScanNumber; sw.Start(); run.CurrentScanSet = scanset; Task msgen = new GenericMSGenerator(); msgen.Execute(results); timeresult.msGenTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); Task peakDetector = new DeconToolsPeakDetector(); peakDetector.Execute(results); timeresult.peakDetectorTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); DeconToolsV2.HornTransform.clsHornTransformParameters hornParams = new DeconToolsV2.HornTransform.clsHornTransformParameters(); Task decon = new HornDeconvolutor(hornParams); decon.Execute(results); timeresult.deconTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); Task scanResultUpdater = new ScanResultUpdater(); scanResultUpdater.Execute(results); timeresult.resultUpdaterTime = sw.ElapsedMilliseconds; timingResults.Add(timeresult); } reportTimingEachScan(timingResults); /* * results on Gord's computer... 2009_11_18. * scanNum msgen peakDet decon updater * 6005 85 72 3013 3 * 6012 13 6 2661 0 * 6019 13 9 2908 0 * 6026 12 11 2560 0 * 6033 14 9 2778 0 * 6040 13 6 2558 0 * 6047 12 8 2753 0 * * Avg: 23.1 17.3 2747.3 0.4 */ }
public void imf_multipleFrames_horn_test2() { List <Run> runCollection = new List <Run>(); Run run = new IMFRun(imfFilePath); runCollection.Add(run); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 9, 1); sscc.Create(); Task msGen = new GenericMSGenerator(0, 5000); Task zeroFiller = new DeconToolsZeroFiller(3); DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(); detectorParams.PeakBackgroundRatio = 4; detectorParams.SignalToNoiseThreshold = 3; detectorParams.PeakFitType = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC; Task peakDetector = new DeconToolsPeakDetector(detectorParams); DeconToolsV2.HornTransform.clsHornTransformParameters hornParams = new DeconToolsV2.HornTransform.clsHornTransformParameters(); hornParams.CompleteFit = true; hornParams.LeftFitStringencyFactor = 2.5; hornParams.RightFitStringencyFactor = 0.5; hornParams.PeptideMinBackgroundRatio = 4; hornParams.MaxFit = 0.4; Task decon = new HornDeconvolutor(hornParams); Task scanResultsUpdater = new ScanResultUpdater(); TaskCollection tc = new TaskCollection(); tc.TaskList.Add(msGen); tc.TaskList.Add(zeroFiller); tc.TaskList.Add(peakDetector); tc.TaskList.Add(decon); tc.TaskList.Add(scanResultsUpdater); Stopwatch sw = new Stopwatch(); sw.Start(); TaskController controller = new BasicTaskController(tc); controller.Execute(runCollection); sw.Stop(); Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds); Console.WriteLine("Scans analyzed = " + runCollection[0].ScanSetCollection.ScanSetList.Count); Console.WriteLine("Features found = " + runCollection[0].ResultCollection.ResultList.Count); Console.WriteLine("Peaks found = " + runCollection[0].ResultCollection.ScanResultList.Sum(p => p.NumPeaks)); StringBuilder sb = new StringBuilder(); }
public void UIMF_and_IMF_Nosumming_Test1() { Run uimfrun = new UIMFRun(uimfFilepath); Run imfRun = new IMFRun(imfFrame1200filepath); int startFrame = 1200; int stopFrame = 1200; int numFramesSummed = 1; int numScansSummed = 1; FrameSetCollectionCreator framesetCreator = new FrameSetCollectionCreator(uimfrun, startFrame, stopFrame, numFramesSummed, 1); framesetCreator.Create(); ScanSetCollectionCreator scanSetCreator = new ScanSetCollectionCreator(uimfrun, numScansSummed, 1); scanSetCreator.Create(); ResultCollection uimfResults = new ResultCollection(uimfrun); //first analyze the UIMF file.... foreach (FrameSet frameset in ((UIMFRun)uimfrun).FrameSetCollection.FrameSetList) { System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); ((UIMFRun)uimfrun).CurrentFrameSet = frameset; foreach (ScanSet scanset in uimfrun.ScanSetCollection.ScanSetList) { uimfrun.CurrentScanSet = scanset; Task msgen = new UIMF_MSGenerator(0, 2000); msgen.Execute(uimfResults); Task peakDetector = new DeconToolsPeakDetector(); peakDetector.Execute(uimfResults); Task rapid = new RapidDeconvolutor(); rapid.Execute(uimfResults); Task scanResultUpdater = new ScanResultUpdater(); scanResultUpdater.Execute(uimfResults); } } //next analyze the IMF file for the corresponding frame scanSetCreator = new ScanSetCollectionCreator(imfRun, 0, 599, numScansSummed, 1); scanSetCreator.Create(); ResultCollection imfResults = new ResultCollection(imfRun); foreach (ScanSet scanset in imfRun.ScanSetCollection.ScanSetList) { imfRun.CurrentScanSet = scanset; Task msgen = new GenericMSGenerator(0, 2000); msgen.Execute(imfResults); Task peakDetector = new DeconToolsPeakDetector(); peakDetector.Execute(imfResults); Task rapid = new RapidDeconvolutor(); rapid.Execute(imfResults); Task scanResultUpdater = new ScanResultUpdater(); scanResultUpdater.Execute(imfResults); } Console.WriteLine("imfScanSetCount = " + imfResults.Run.ScanSetCollection.ScanSetList.Count); Console.WriteLine("UIMFScanSetCount = " + uimfResults.Run.ScanSetCollection.ScanSetList.Count); Console.WriteLine("IMF scan0 peaks = " + imfResults.ScanResultList.Sum(p => p.NumPeaks)); Console.WriteLine("UIMF scan0 peaks = " + uimfResults.ScanResultList[0].NumPeaks); Console.WriteLine("imfResultCount = " + imfResults.ResultList.Count); Console.WriteLine("UIMFResultCount = " + uimfResults.ResultList.Count); for (int i = 0; i < uimfResults.ResultList.Count; i++) { Console.Write(getResultSummary(uimfResults.ResultList[i])); Console.Write(getResultSummary(imfResults.ResultList[i])); Console.Write("\n"); } }
public void multipleFrames_horn_test4() { Project.Reset(); //Project.getInstance().LoadOldDecon2LSParameters(uimfParameters1); UIMFRun run = new UIMFRun(uimfFilepath, 1202, 1202); Project.getInstance().RunCollection.Add(run); ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 9, 1); sscc.Create(); FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, 1, 1); fscc.Create(); Task msGen = new UIMF_MSGenerator(0, 5000); Task zeroFiller = new DeconToolsZeroFiller(3); DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(); detectorParams.PeakBackgroundRatio = 4; detectorParams.SignalToNoiseThreshold = 3; detectorParams.PeakFitType = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC; Task peakDetector = new DeconToolsPeakDetector(detectorParams); DeconToolsV2.HornTransform.clsHornTransformParameters hornParams = new DeconToolsV2.HornTransform.clsHornTransformParameters(); hornParams.CompleteFit = true; hornParams.LeftFitStringencyFactor = 2.5; hornParams.RightFitStringencyFactor = 0.5; hornParams.PeptideMinBackgroundRatio = 4; hornParams.MaxFit = 0.4; hornParams.UseMZRange = false; hornParams.UseMercuryCaching = true; Task decon = new HornDeconvolutor(hornParams); Task scanResultsUpdater = new ScanResultUpdater(); Project.getInstance().TaskCollection.TaskList.Add(msGen); Project.getInstance().TaskCollection.TaskList.Add(zeroFiller); Project.getInstance().TaskCollection.TaskList.Add(peakDetector); Project.getInstance().TaskCollection.TaskList.Add(decon); Project.getInstance().TaskCollection.TaskList.Add(scanResultsUpdater); Stopwatch sw = new Stopwatch(); sw.Start(); TaskController controller = new UIMF_TaskController(Project.getInstance().TaskCollection); controller.Execute(Project.getInstance().RunCollection); sw.Stop(); Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds); Console.WriteLine("Scans analyzed = " + Project.getInstance().RunCollection[0].ScanSetCollection.ScanSetList.Count); Console.WriteLine("Features found = " + Project.getInstance().RunCollection[0].ResultCollection.ResultList.Count); Console.WriteLine("Peaks found = " + Project.getInstance().RunCollection[0].ResultCollection.ScanResultList[0].NumPeaks); StringBuilder sb = new StringBuilder(); }
public void msGeneratorSummingTest1() { Run run = new UIMFRun(uimfFilePath3); int startFrame = 800; int stopFrame = 802; int numFramesSummed = 3; int numScansSummed = 9; FrameSetCollectionCreator framesetCreator = new FrameSetCollectionCreator(run, startFrame, stopFrame, numFramesSummed, 1); framesetCreator.Create(); ScanSetCollectionCreator scanSetCreator = new ScanSetCollectionCreator(run, numScansSummed, 1); scanSetCreator.Create(); ResultCollection results = new ResultCollection(run); List <timingResult> timingResults = new List <timingResult>(); Task msgen = new UIMF_MSGenerator(); Task peakDetector = new DeconToolsPeakDetector(); Task decon = new HornDeconvolutor(); Task scanResultUpdater = new ScanResultUpdater(); Task uimfTicExtractor = new UIMF_TICExtractor(); Task driftTimeExtractor = new DeconTools.Backend.ProcessingTasks.UIMFDriftTimeExtractor(); ((HornDeconvolutor)decon).MinPeptideBackgroundRatio = 4; foreach (FrameSet frameset in ((UIMFRun)run).FrameSetCollection.FrameSetList) { System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); ((UIMFRun)run).CurrentFrameSet = frameset; foreach (ScanSet scanset in run.ScanSetCollection.ScanSetList) { sw.Reset(); timingResult timeresult = new timingResult(); timeresult.frameNum = frameset.PrimaryFrame; timeresult.scanNum = scanset.PrimaryScanNumber; sw.Start(); run.CurrentScanSet = scanset; msgen.Execute(results); timeresult.msGenTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); peakDetector.Execute(results); timeresult.peakDetectorTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); decon.Execute(results); timeresult.deconTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); scanResultUpdater.Execute(results); timeresult.resultUpdaterTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); uimfTicExtractor.Execute(results); timeresult.ticExtractorTime = sw.ElapsedMilliseconds; sw.Reset(); sw.Start(); driftTimeExtractor.Execute(results); timeresult.driftTimeExtractorTime = sw.ElapsedMilliseconds; timingResults.Add(timeresult); } } //reportTimingEachFrameEachScan(timingResults); Console.WriteLine("Total _isos = " + results.ResultList.Count); Console.WriteLine("PeptideBR = " + ((HornDeconvolutor)decon).MinPeptideBackgroundRatio); Console.WriteLine(); Console.WriteLine(); Console.WriteLine(); reportTiming_FrameAggregate(timingResults, startFrame, stopFrame); Project.Reset(); }