public void test1() { Run run = new XCaliburRun(xcaliburTestfile); MassTag mt = TestUtilities.GetMassTagStandard(1); PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburPeakDataFile); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); run.CurrentMassTag = mt; Task theorFeatureGen = new TomTheorFeatureGenerator(); theorFeatureGen.Execute(run.ResultCollection); int numPeaksForExtractingChrom = 3; int toleranceInPPM = 25; IsotopicProfileMultiChromatogramExtractor multiChromExtractor = new IsotopicProfileMultiChromatogramExtractor( numPeaksForExtractingChrom, toleranceInPPM); List <int> ms1Levels = run.GetMSLevelScanValues(); Dictionary <MSPeak, XYData> chromDataForIsotopicProfile = multiChromExtractor.GetChromatogramsForIsotopicProfilePeaks(run.ResultCollection.MSPeakResultList, run.CurrentMassTag.IsotopicProfile, true, ms1Levels); multiChromExtractor.SmoothChromatograms(chromDataForIsotopicProfile, new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(11, 11, 2)); XYData xydata1 = chromDataForIsotopicProfile.Values.First(); XYData xydata2 = chromDataForIsotopicProfile.Values.ElementAt(1); XYData xydata3 = chromDataForIsotopicProfile.Values.ElementAt(2); TestUtilities.DisplayXYValues(xydata3); }
public void processOrbi_Refining_Case01_whatHappensTo_PeakID_396293() { var minScan = 200; var maxScan = 18000; Run run = new XCaliburRun2(DeconTools.UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1); var workflow = new WholisticChromBasedLCMSFeatureFinderWorkflow(run); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(DeconTools.UnitTesting2.FileRefs.PeakDataFiles.OrbitrapPeakFile1); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); #if peaksAreFilteredToNarrowMZ run.ResultCollection.MSPeakResultList = run.ResultCollection.MSPeakResultList.Where(p => p.Scan_num > minScan && p.Scan_num < maxScan && p.MSPeak.XValue > 771 && p.MSPeak.XValue < 775).ToList(); #else run.ResultCollection.MSPeakResultList = run.ResultCollection.MSPeakResultList.Where(p => p.Scan_num > minScan && p.Scan_num < maxScan).ToList(); #endif workflow.Execute(); TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); var filteredPeakResults = run.ResultCollection.MSPeakResultList.Where(p => p.Scan_num > minScan && p.Scan_num < maxScan && p.MSPeak.XValue > 771 && p.MSPeak.XValue < 775).ToList(); //TestUtilities.DisplayMSPeakResults(filteredPeakResults); }
public void processOrbiWithNewWorkflowTest2() { var minScan = 5500; var maxScan = 6500; Run run = new XCaliburRun2(DeconTools.UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1, minScan, maxScan); var workflow = new WholisticChromBasedLCMSFeatureFinderWorkflow(run); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(DeconTools.UnitTesting2.FileRefs.PeakDataFiles.OrbitrapPeakFile1); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); //run.ResultCollection.MSPeakResultList = run.ResultCollection.MSPeakResultList.Where(p => p.Scan_num > minScan && p.Scan_num < maxScan).ToList(); run.ResultCollection.MSPeakResultList = run.ResultCollection.MSPeakResultList.Where(p => p.Scan_num > minScan && p.Scan_num < maxScan && p.MSPeak.XValue > 771 && p.MSPeak.XValue < 775).ToList(); var sw = new Stopwatch(); sw.Start(); workflow.Execute(); sw.Stop(); TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); Console.WriteLine("workflow time = " + sw.ElapsedMilliseconds); }
public void test2() { MassTag massTag = new MassTag(); massTag.ID = 56488; massTag.MonoIsotopicMass = 2275.1694779; massTag.ChargeState = 3; massTag.MZ = massTag.MonoIsotopicMass / massTag.ChargeState + 1.00727649; Run run = new XCaliburRun(xcaliburTestfile); PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburPeakDataFile); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); run.CurrentMassTag = massTag; Task peakChromGen = new PeakChromatogramGenerator(10); Task smoother = new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(2, 2, 2); Task peakDet = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector(); peakChromGen.Execute(run.ResultCollection); smoother.Execute(run.ResultCollection); peakDet.Execute(run.ResultCollection); TestUtilities.DisplayPeaks(run.PeakList); TestUtilities.DisplayXYValues(run.ResultCollection); }
public void getPeakChromatogramTest2() { var mt = TestUtilities.GetMassTagStandard(1); Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(FileRefs.PeakDataFiles.OrbitrapPeakFile_scans5500_6500); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); run.CurrentMassTag = mt; var unlabelledTheorGenerator = new TomTheorFeatureGenerator(); unlabelledTheorGenerator.GenerateTheorFeature(mt); var peakChromGen = new PeakChromatogramGenerator(10, Globals.ChromatogramGeneratorMode.TOP_N_PEAKS); peakChromGen.TopNPeaksLowerCutOff = 0.4; peakChromGen.Execute(run.ResultCollection); Assert.AreEqual(133, run.XYData.Xvalues.Length); Assert.AreEqual(5543, (int)run.XYData.Xvalues[35]); //Assert.AreEqual(7319569, (int)run.XYData.Yvalues[35]); run.XYData.Display(); }
public void importPeaksFromOrbitrapFileTest1() { var mspeaks = new List <MSPeakResult>(); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(FileRefs.PeakDataFiles.OrbitrapPeakFile_scans5500_6500); peakImporter.ImportPeaks(mspeaks); Assert.AreEqual(105540, mspeaks.Count); }
public void test3() { MassTag massTag = new MassTag(); massTag.ID = 56488; massTag.MonoIsotopicMass = 2275.1694779; massTag.ChargeState = 3; massTag.MZ = massTag.MonoIsotopicMass / massTag.ChargeState + 1.00727649; massTag.NETVal = 0.3520239f; Run run = new XCaliburRun(xcaliburTestfile); ChromAlignerUsingVIPERInfo chromAligner = new ChromAlignerUsingVIPERInfo(); chromAligner.Execute(run); PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburPeakDataFile); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); run.CurrentMassTag = massTag; Task peakChromGen = new PeakChromatogramGenerator(20); Task smoother = new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(2, 2, 2); Task peakDet = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector(); Task chromPeakSel = new DeconTools.Backend.ProcessingTasks.ChromPeakSelector(1, 0.1); MSGeneratorFactory msgenFactory = new MSGeneratorFactory(); Task msgen = msgenFactory.CreateMSGenerator(run.MSFileType); peakChromGen.Execute(run.ResultCollection); smoother.Execute(run.ResultCollection); peakDet.Execute(run.ResultCollection); chromPeakSel.Execute(run.ResultCollection); Console.WriteLine("Now generating MS...."); msgen.Execute(run.ResultCollection); Console.WriteLine("----------- RESULTS ----------------------\n"); TestUtilities.DisplayPeaks(run.PeakList); MassTagResultBase massTagResult = run.ResultCollection.MassTagResultList[massTag]; massTagResult.DisplayToConsole(); Assert.AreEqual(5512, massTagResult.ScanSet.PrimaryScanNumber); }
private Run setupRun(string runFile, string peaksFile) { RunFactory rf = new RunFactory(); Run run = rf.CreateRun(runFile); ChromAlignerUsingVIPERInfo chromAligner = new ChromAlignerUsingVIPERInfo(); chromAligner.Execute(run); PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(peaksFile); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); return(run); }
public void getPeakChromatogramUsingChromGenTest1() { var targetMZ = 831.48; double toleranceInPPM = 20; Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(FileRefs.PeakDataFiles.OrbitrapPeakFile_scans5500_6500); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); var chromGen = new ChromatogramGenerator(); run.XYData = chromGen.GenerateChromatogram(run.ResultCollection.MSPeakResultList, run.MinLCScan, run.MaxLCScan, targetMZ, toleranceInPPM, 1); for (var i = 0; i < run.XYData.Xvalues.Length; i++) { run.XYData.Xvalues[i] = run.GetTime(i); } // run.XYData.Display(); var counter = 0; var sb = new StringBuilder(); var sortedList = run.ResultCollection.MSPeakResultList.OrderBy(p => p.MSPeak.XValue); foreach (var peak in sortedList) { counter++; if (peak.MSPeak.XValue > (targetMZ - 0.1) && peak.MSPeak.XValue < (targetMZ + 0.1)) { sb.Append(peak.ChromID); sb.Append("\t"); sb.Append(peak.PeakID); sb.Append("\t"); sb.Append(peak.Scan_num); sb.Append("\t"); sb.Append(peak.MSPeak.XValue); sb.Append("\t"); sb.Append(peak.MSPeak.Height); sb.Append(Environment.NewLine); } } Console.WriteLine(sb.ToString()); }
public void Test1() { var rawdataFile = @"D:\Data\Orbitrap\QC_Shew_09_05-pt5-6_4Jan10_Doc_09-11-08.RAW"; var massTagFile = @"\\protoapps\UserData\Slysz\Data\MassTags\QCShew_Formic_MassTags_Bin10_all.txt"; var parameterFile = @"\\protoapps\UserData\Slysz\Data\QCShew_MassiveTargeted\WorkflowParameterFiles\UnlabelledTargeted_WorkflowParameters_noSum.xml"; var mtimporter = new MassTagFromTextFileImporter(massTagFile); var mtc = new TargetCollection(); mtc = mtimporter.Import(); var run = new RunFactory().CreateRun(rawdataFile); //RunUtilities.AlignRunUsingAlignmentInfoInFiles(run); var expectedPeaksFilename = Path.Combine(run.DataSetPath, run.DatasetName + "_peaks.txt"); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(expectedPeaksFilename, null); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); var testMassTagID = 3513677; var massTagChargeState = 2; run.CurrentMassTag = (from n in mtc.TargetList where n.ID == testMassTagID && n.ChargeState == massTagChargeState select n).First(); var parameters = WorkflowParameters.CreateParameters(parameterFile); var workflow = TargetedWorkflow.CreateWorkflow(parameters); workflow.Run = run; workflow.Execute(); workflow.Result.DisplayToConsole(); RunUtilities.AlignRunUsingAlignmentInfoInFiles(run); workflow.Execute(); workflow.Result.DisplayToConsole(); }
public void getPeakChromAndStoreInPeakChromObject_Test1() { double chromToleranceInPPM = 20; var targetMZ = 831.48; Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(FileRefs.PeakDataFiles.OrbitrapPeakFile_scans5500_6500); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); var chromGen = new ChromatogramGenerator(); PeakChrom chrom = new BasicPeakChrom(); chrom.ChromSourceData = chromGen.GeneratePeakChromatogram(run.ResultCollection.MSPeakResultList, run.MinLCScan, run.MaxLCScan, targetMZ, chromToleranceInPPM); Assert.AreEqual(59, chrom.ChromSourceData.Count); }
public void getPeakChromatogramInTheFormOfMSPeakResult_Test1() { double chromToleranceInPPM = 20; var targetMZ = 831.48; Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(FileRefs.PeakDataFiles.OrbitrapPeakFile_scans5500_6500); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); var chromGen = new ChromatogramGenerator(); var filteredMSPeaks = chromGen.GeneratePeakChromatogram(run.ResultCollection.MSPeakResultList, run.MinLCScan, run.MaxLCScan, targetMZ, chromToleranceInPPM); //Assert.AreEqual(56, filteredMSPeaks.Count); TestUtilities.DisplayMSPeakResults(filteredMSPeaks); }
public void processOrbi_Scans3000_6000_Test1() { var minScan = 5500; var maxScan = 6500; Run run = new XCaliburRun2(DeconTools.UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1, minScan, maxScan); var workflow = new WholisticChromBasedLCMSFeatureFinderWorkflow(run); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(DeconTools.UnitTesting2.FileRefs.PeakDataFiles.OrbitrapPeakFile1); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); //run.ResultCollection.MSPeakResultList = run.ResultCollection.MSPeakResultList.Where(p => p.Scan_num > minScan && p.Scan_num < maxScan).ToList(); run.ResultCollection.MSPeakResultList = run.ResultCollection.MSPeakResultList.Where(p => p.Scan_num > minScan && p.Scan_num < maxScan && p.MSPeak.XValue > 771 && p.MSPeak.XValue < 775).ToList(); workflow.ExecuteWorkflow2(run); TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); }
public void getChromatogramsSpeedTest1() { var targetMZ = 831.48; double toleranceInPPM = 20; var totalIterations = 40; Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(FileRefs.PeakDataFiles.OrbitrapPeakFile1); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); var chromGen = new ChromatogramGenerator(); var speedResults = new List <long>(); var sw = new Stopwatch(); var startScan = 5500; var stopScan = 8500; for (var i = 0; i < totalIterations; i++) { sw.Reset(); sw.Start(); run.XYData = chromGen.GenerateChromatogram(run.ResultCollection.MSPeakResultList, startScan, stopScan, (targetMZ + totalIterations), toleranceInPPM, 1); sw.Stop(); speedResults.Add(sw.ElapsedMilliseconds); } Console.WriteLine("Average time = " + speedResults.Average()); }
public void importPeaksFromUIMFFileTest1() //NOTE: 2012_11_15 - The importer imports UIMF peaks as if they were orbi peaks. All IMS scan info is ignored { var testPeakFile = @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\UIMF_O16O18Testing\RawData\Alz_O18_Run03_7Sep12_Cheetah_11-12-23_peaks.txt"; var mspeaks = new List <MSPeakResult>(); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(testPeakFile); peakImporter.ImportPeaks(mspeaks); Assert.AreEqual(202928, mspeaks.Count); var testResult = mspeaks[0]; Assert.AreEqual(1, testResult.PeakID); Assert.AreEqual(-1, testResult.FrameNum); Assert.AreEqual(1, testResult.Scan_num); Assert.AreEqual(386.74464, (decimal)testResult.MSPeak.XValue); Assert.AreEqual(49599, testResult.MSPeak.Height); Assert.AreEqual(199.19, (decimal)testResult.MSPeak.SignalToNoise); Assert.AreEqual(-1, testResult.MSPeak.MSFeatureID); // 43 800 213 357.38662 1528 0.071 100 16 }
public void find_targetMassTag_131959Test1() { var run = new RunFactory().CreateRun(xcaliburTestfile); var masstagImporter = new MassTagFromTextFileImporter(massTagTestList1); var massTagColl = masstagImporter.Import(); Assert.AreEqual(2719, massTagColl.TargetList.Count); var chromAligner = new ChromAlignerUsingVIPERInfo(); chromAligner.Execute(run); var peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburAllPeaksFile); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); //int mtID = 635428; var mtID = 131959; Task peakChromGen = new PeakChromatogramGenerator(20); Task smoother = new DeconTools.Backend.ProcessingTasks.Smoothers.SavitzkyGolaySmoother(23, 2); Task zeroFill = new DeconTools.Backend.ProcessingTasks.ZeroFillers.DeconToolsZeroFiller(3); Task peakDet = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector(0.5, 1); Task msPeakDet = new DeconToolsPeakDetectorV2(1.3, 2, Globals.PeakFitType.QUADRATIC, true); var basicChromPeakSelParam = new ChromPeakSelectorParameters(); basicChromPeakSelParam.NETTolerance = 0.1f; basicChromPeakSelParam.PeakSelectorMode = Globals.PeakSelectorMode.ClosestToTarget; Task chromPeakSel = new BasicChromPeakSelector(basicChromPeakSelParam); Task msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); run.CurrentMassTag = massTagColl.TargetList.Find(p => p.ID == mtID); var mt = run.CurrentMassTag; mt.MZ = mt.MonoIsotopicMass / mt.ChargeState + Globals.PROTON_MASS; Task theorFeatureGen = new TomTheorFeatureGenerator(DeconTools.Backend.Globals.LabellingType.NONE, 0.005); Task targetedFeatureFinder = new BasicTFF(); Task fitScoreCalc = new IsotopicProfileFitScoreCalculator(); theorFeatureGen.Execute(run.ResultCollection); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("------------------- MassTag = " + mt.ID + "---------------------------"); Console.WriteLine("monoMass = " + mt.MonoIsotopicMass.ToString("0.0000") + "; monoMZ = " + mt.MZ.ToString("0.0000") + "; ChargeState = " + mt.ChargeState + "; NET = " + mt.NormalizedElutionTime.ToString("0.000") + "; Sequence = " + mt.Code + "; EmpiricalFormula= " + mt.EmpiricalFormula + "\n"); peakChromGen.Execute(run.ResultCollection); smoother.Execute(run.ResultCollection); //TestUtilities.DisplayXYValues(run.ResultCollection); peakDet.Execute(run.ResultCollection); TestUtilities.DisplayPeaks(run.PeakList); chromPeakSel.Execute(run.ResultCollection); msgen.Execute(run.ResultCollection); //TestUtilities.DisplayXYValues(run.ResultCollection); msPeakDet.Execute(run.ResultCollection); targetedFeatureFinder.Execute(run.ResultCollection); fitScoreCalc.Execute(run.ResultCollection); var massTagResult = run.ResultCollection.MassTagResultList[mt]; massTagResult.DisplayToConsole(); //Console.WriteLine("------------------------------ end --------------------------"); }
private void getTestMSPeaklistForChromagramGen(Run run) { PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(peaks_rsph_AOnly_28_run1File_Scans1000_1500); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); }
public void run_fullAnalysisTest1() { Run run = new BrukerRun(rsph_AOnly_28_run1File); MassTagCollection massTagColl = new MassTagCollection(); run.ResultCollection.MassTagResultType = DeconTools.Backend.Globals.MassTagResultType.N14N15_MASSTAG_RESULT; massTagColl.MassTagIDList = fourTestMTs; MassTagFromSqlDBImporter importer = new MassTagFromSqlDBImporter("MT_R_sphaeroides241_P513", "Albert"); importer.chargeStateFilterThreshold = 0.05; importer.Import(massTagColl); Assert.AreEqual(7, massTagColl.MassTagList.Count); ChromAlignerUsingVIPERInfo chromAligner = new ChromAlignerUsingVIPERInfo(); chromAligner.Execute(run); PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(rsph_Aonly_28_run1_scans500_1000_peaks); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); Task peakChromGen = new PeakChromatogramGenerator(20); Task smoother = new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(11, 11, 2); Task peakDet = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector(0.5, 0.5); Task chromPeakSel = new DeconTools.Backend.ProcessingTasks.ChromPeakSelector(1, 0.01, Globals.PeakSelectorMode.CLOSEST_TO_TARGET); MSGeneratorFactory msgenFactory = new MSGeneratorFactory(); Task msgen = msgenFactory.CreateMSGenerator(run.MSFileType); DeconToolsV2.Peaks.clsPeakProcessorParameters peakParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(2, 3, false, DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC); Task mspeakDet = new DeconToolsPeakDetector(peakParams); Task theorFeatureGen = new TomTheorFeatureGenerator(); N14N15TFFTask finder = new N14N15TFFTask(0.01); N14N15QuantifierTask quant = new N14N15QuantifierTask(1); IsotopicProfileFitScoreCalculator fitScoreCalc = new IsotopicProfileFitScoreCalculator(); List <long> timingResults = new List <long>(); foreach (MassTag mt in massTagColl.MassTagList) { run.CurrentMassTag = mt; mt.MZ = mt.MonoIsotopicMass / mt.ChargeState + Globals.PROTON_MASS; Console.WriteLine(); Console.WriteLine(); Console.WriteLine("------------------- MassTag = " + mt.ID + "---------------------------"); Console.WriteLine("monoMass = " + mt.MonoIsotopicMass.ToString("0.0000") + "; monoMZ = " + mt.MZ.ToString("0.0000") + "; ChargeState = " + mt.ChargeState + "; NET = " + mt.NETVal.ToString("0.000") + "; Sequence = " + mt.PeptideSequence + "\n"); Stopwatch sw = new Stopwatch(); sw.Start(); try { peakChromGen.Execute(run.ResultCollection); smoother.Execute(run.ResultCollection); peakDet.Execute(run.ResultCollection); chromPeakSel.Execute(run.ResultCollection); msgen.Execute(run.ResultCollection); mspeakDet.Execute(run.ResultCollection); theorFeatureGen.Execute(run.ResultCollection); finder.Execute(run.ResultCollection); quant.Execute(run.ResultCollection); fitScoreCalc.Execute(run.ResultCollection); MassTagResultBase massTagResult = run.ResultCollection.MassTagResultList[mt]; massTagResult.DisplayToConsole(); Console.WriteLine("------------------------------ end --------------------------"); } catch (Exception ex) { Console.WriteLine("Task failed. Message: " + ex.Message + ex.StackTrace); } sw.Stop(); timingResults.Add(sw.ElapsedMilliseconds); } foreach (long tr in timingResults) { Console.WriteLine(tr); } Console.WriteLine("-------- Analysis time for all MTs = " + timingResults.Sum()); Console.WriteLine("-------- Average time for each MT = " + timingResults.Average()); Console.WriteLine(); }
public void test1() { Run run = new XCaliburRun(xcaliburTestfile); MassTagCollection massTagColl = new MassTagCollection(); MassTagIDGenericImporter mtidImporter = new MassTagIDGenericImporter(cysteineMassTagSourceFile1, '\t'); mtidImporter.Import(massTagColl); MassTagFromSqlDBImporter importer = new MassTagFromSqlDBImporter("MT_Shewanella_ProdTest_P352", "porky"); importer.Import(massTagColl); Assert.AreEqual(737, massTagColl.MassTagIDList.Count); Assert.AreEqual(826, massTagColl.MassTagList.Count); ChromAlignerUsingVIPERInfo chromAligner = new ChromAlignerUsingVIPERInfo(); chromAligner.Execute(run); PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburAllPeaksFile); peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList); Task peakChromGen = new PeakChromatogramGenerator(20); Task smoother = new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(11, 11, 2); Task peakDet = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector(0.5, 0.5); Task chromPeakSel = new DeconTools.Backend.ProcessingTasks.ChromPeakSelector(1, 0.01, Globals.PeakSelectorMode.CLOSEST_TO_TARGET); MSGeneratorFactory msgenFactory = new MSGeneratorFactory(); Task msgen = msgenFactory.CreateMSGenerator(run.MSFileType); DeconToolsV2.Peaks.clsPeakProcessorParameters peakParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(2, 0.75, true, DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC); Task mspeakDet = new DeconToolsPeakDetector(peakParams); Task theorFeatureGen = new TomTheorFeatureGenerator(); Task targetedFeatureFinder = new BasicTFF(6); Task exporter = new BasicMTResultSQLiteExporter(cysteineAnalysisOutput1); IsotopicProfileFitScoreCalculator fitScoreCalc = new IsotopicProfileFitScoreCalculator(); int successCounter = 0; List <long> timingResults = new List <long>(); foreach (MassTag mt in massTagColl.MassTagList) { run.CurrentMassTag = mt; mt.MZ = mt.MonoIsotopicMass / mt.ChargeState + Globals.PROTON_MASS; Console.WriteLine(); Console.WriteLine(); Console.WriteLine("------------------- MassTag = " + mt.ID + "---------------------------"); Console.WriteLine("monoMass = " + mt.MonoIsotopicMass.ToString("0.0000") + "; monoMZ = " + mt.MZ.ToString("0.0000") + "; ChargeState = " + mt.ChargeState + "; NET = " + mt.NETVal.ToString("0.000") + "; Sequence = " + mt.PeptideSequence + "\n"); Stopwatch sw = new Stopwatch(); sw.Start(); try { peakChromGen.Execute(run.ResultCollection); smoother.Execute(run.ResultCollection); peakDet.Execute(run.ResultCollection); chromPeakSel.Execute(run.ResultCollection); msgen.Execute(run.ResultCollection); mspeakDet.Execute(run.ResultCollection); theorFeatureGen.Execute(run.ResultCollection); targetedFeatureFinder.Execute(run.ResultCollection); fitScoreCalc.Execute(run.ResultCollection); MassTagResultBase massTagResult = run.ResultCollection.MassTagResultList[mt]; massTagResult.DisplayToConsole(); Console.WriteLine("------------------------------ end --------------------------"); } catch (Exception ex) { Console.WriteLine("Task failed. Message: " + ex.Message + ex.StackTrace); } sw.Stop(); timingResults.Add(sw.ElapsedMilliseconds); if (mt == massTagColl.MassTagList.Last()) { exporter.Execute(run.ResultCollection); } } exporter.Cleanup(); //List<IMassTagResult> successfulResults = run.ResultCollection.GetSuccessfulMassTagResults(); foreach (long tr in timingResults) { Console.WriteLine(tr); } Console.WriteLine("-------- Analysis time for all MTs = " + timingResults.Sum()); Console.WriteLine("-------- Average time for each MT = " + timingResults.Average()); Console.WriteLine(); }