public void DetectPeaksInOrbitrapData() { var peakBR = 1.3; double sigNoise = 2; var isThresholded = true; var peakfitType = DeconTools.Backend.Globals.PeakFitType.QUADRATIC; var testFile = FileRefs.RawDataMSFiles.OrbitrapStdFile1; Run run = new XCaliburRun2(testFile); //create list of target scansets run.ScanSetCollection.Create(run, 6000, 6015, 1, 1); //in the 'run' object there is now a list of scans : run.ScanSetCollection var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); var peakDet = new DeconToolsPeakDetectorV2(peakBR, sigNoise, peakfitType, isThresholded); peakDet.PeaksAreStored = true; foreach (var scan in run.ScanSetCollection.ScanSetList) { //set the target scan: run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDet.Execute(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 deconWithTHRASH_Then_ValidateTest1() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var scanSet = new ScanSet(6005); run.CurrentScanSet = scanSet; var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true); var decon = new HornDeconvolutor(); var validator = new ResultValidatorTask(); msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); validator.Execute(run.ResultCollection); Assert.AreEqual(93, run.ResultCollection.ResultList.Count); var testResult = run.ResultCollection.ResultList[0]; Assert.AreEqual(0.0532199478712594m, (decimal)testResult.InterferenceScore); //TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); }
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); }
public void OldDeconvolutorTest_temp1() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); #if !Disable_DeconToolsV2 var parameters = new DeconEngineClasses.OldDecon2LSParameters(); var paramFile = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\ParameterFiles\LTQ_Orb_SN2_PeakBR1pt3_PeptideBR1_Thrash_MaxFit1.xml"; parameters.Load(paramFile); var scanSet = new ScanSetFactory().CreateScanSet(run, 6005, 1); var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true); var deconvolutor = new HornDeconvolutor(parameters.GetDeconToolsParameters()); run.CurrentScanSet = scanSet; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); deconvolutor.Execute(run.ResultCollection); run.ResultCollection.ResultList = run.ResultCollection.ResultList.OrderByDescending(p => p.IntensityAggregate).ToList(); TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); //IsosResult testIso = run.ResultCollection.ResultList[0]; //TestUtilities.DisplayIsotopicProfileData(testIso.IsotopicProfile); //TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); //TestUtilities.DisplayPeaks(run.PeakList); #endif }
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 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 effectOfFWHMOnFitTest() { Run run = new XCaliburRun2(xcaliburTestfile); var results = new ResultCollection(run); run.CurrentScanSet = new ScanSet(6005); var isTicRequested = false; Task msGen = new GenericMSGenerator(1154, 1160, isTicRequested); msGen.Execute(results); Task peakDetector = new DeconToolsPeakDetectorV2(0.5, 3, Globals.PeakFitType.QUADRATIC, false); peakDetector.Execute(results); Task decon = new HornDeconvolutor(); decon.Execute(results); var result1 = results.ResultList[0]; var resolution = result1.IsotopicProfile.GetMZofMostAbundantPeak() / result1.IsotopicProfile.GetFWHM(); var distcreator = new MercuryDistributionCreator(); distcreator.CreateDistribution(result1.IsotopicProfile.MonoIsotopicMass, result1.IsotopicProfile.ChargeState, resolution); distcreator.OffsetDistribution(result1.IsotopicProfile); var sb = new StringBuilder(); var areafitter = new AreaFitter(); var fitval = areafitter.GetFit(distcreator.Data, run.XYData, 10); sb.Append(resolution); sb.Append("\t"); sb.Append(fitval); sb.Append("\n"); for (var fwhm = 0.001; fwhm < 0.050; fwhm = fwhm + 0.0005) { distcreator = new MercuryDistributionCreator(); resolution = result1.IsotopicProfile.GetMZofMostAbundantPeak() / fwhm; distcreator.CreateDistribution(result1.IsotopicProfile.MonoIsotopicMass, result1.IsotopicProfile.ChargeState, resolution); distcreator.OffsetDistribution(result1.IsotopicProfile); areafitter = new AreaFitter(); fitval = areafitter.GetFit(distcreator.Data, run.XYData, 10); sb.Append(resolution); sb.Append("\t"); sb.Append(fitval); sb.Append("\n"); } //Console.Write(sb.ToString()); }
public void CheckBackgroundIntensityTest1() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var scan = new ScanSet(6005); var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); var peakDetector = new DeconToolsPeakDetectorV2(); peakDetector.PeakToBackgroundRatio = 1.3; peakDetector.SignalToNoiseThreshold = 2; peakDetector.PeakFitType = Globals.PeakFitType.QUADRATIC; peakDetector.IsDataThresholded = true; var oldPeakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true); peakDetector.IsDataThresholded = true; run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); oldPeakDetector.Execute(run.ResultCollection); //Assert.AreEqual(peakDetector.BackgroundIntensity, oldPeakDetector.BackgroundIntensity); }
public void deconWithRAPID_Then_ValidateTest1() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); ScanSet scanSet = new ScanSet(6005); run.CurrentScanSet = scanSet; MSGenerator msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); DeconToolsPeakDetectorV2 peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true); RapidDeconvolutor decon = new RapidDeconvolutor(); ResultValidatorTask validator = new ResultValidatorTask(); msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); validator.Execute(run.ResultCollection); Assert.AreEqual(190, run.ResultCollection.ResultList.Count); IsosResult testResult = run.ResultCollection.ResultList[0]; Assert.AreEqual(0.0213668719893332m, (decimal)testResult.InterferenceScore); //TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); }
public void findMSFeaturesInOrbitrapData_Test1() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var scanSet = new ScanSet(6005); run.CurrentScanSet = scanSet; var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true); var decon = new HornDeconvolutor(); msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); Assert.AreEqual(93, run.ResultCollection.ResultList.Count); //order and get the most intense msfeature run.ResultCollection.ResultList = run.ResultCollection.ResultList.OrderByDescending(p => p.IntensityAggregate).ToList(); var testIso = run.ResultCollection.ResultList[0]; Assert.AreEqual(13084442, testIso.IntensityAggregate); Assert.AreEqual(2, testIso.IsotopicProfile.ChargeState); Assert.AreEqual(0.01012m, (decimal)Math.Round(testIso.IsotopicProfile.Score, 5)); Assert.AreEqual(3, testIso.IsotopicProfile.Peaklist.Count); Assert.AreEqual(481.274105402604m, (decimal)testIso.IsotopicProfile.Peaklist[0].XValue); Assert.AreEqual(481.775412188198m, (decimal)testIso.IsotopicProfile.Peaklist[1].XValue); Assert.AreEqual(482.276820274024m, (decimal)testIso.IsotopicProfile.Peaklist[2].XValue); TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); // TestUtilities.DisplayPeaks(run.PeakList); }
public void TempTest1() { using (var run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1)) { run.GetTuneData(); } }
public void DetectPeaksTest1() { var peakBR = 1.3; double sigNoise = 2; var isThresholded = true; var peakfitType = DeconTools.Backend.Globals.PeakFitType.QUADRATIC; var testFile = FileRefs.RawDataMSFiles.OrbitrapStdFile1; Run run = new XCaliburRun2(testFile); var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); run.CurrentScanSet = new ScanSet(6005); msgen.Execute(run.ResultCollection); var peakDet = new DeconToolsPeakDetectorV2(peakBR, sigNoise, peakfitType, isThresholded); peakDet.PeaksAreStored = true; var peakList = peakDet.FindPeaks(run.XYData, 0, 50000); TestUtilities.DisplayPeaks(peakList); }
public void checkDataSetNamesAndPathsTest() { var testFile = FileRefs.RawDataMSFiles.OrbitrapStdFile1; Run run = new XCaliburRun2(testFile); Assert.AreEqual("QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18", run.DatasetName); }
public void checkVersion_2pt2_xcalibur_dll_test1() { var run = new XCaliburRun2(@"\\proto-7\VOrbiETD01\2012_3\QC_Shew_12_02_Run-03_26Jul12_Roc_12-04-08\QC_Shew_12_02_Run-03_26Jul12_Roc_12-04-08.raw"); Assert.AreEqual(8904, run.GetNumMSScans()); Assert.IsNotNull(run); }
public void ConstructorTest1() { using (Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1)) { Assert.AreEqual(1, run.MinLCScan); Assert.AreEqual(18505, run.MaxLCScan); } }
public void ConstructorTest2() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1, 6000, 7000); Assert.AreEqual(6000, run.MinLCScan); Assert.AreEqual(7000, run.MaxLCScan); run = null; }
public void initializeVelosOrbiFile_Test1() { var testFile = FileRefs.RawDataMSFiles.VOrbiFile1; Run run = new XCaliburRun2(testFile); Assert.AreEqual(1, run.MinLCScan); Assert.AreEqual(17773, run.MaxLCScan); }
public void GetTICFromInstrumentInfoTest1() { var run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var scan = 6005; var ticIntensity = run.GetTICFromInstrumentInfo(scan); Assert.IsTrue(ticIntensity > 0); }
public void Test1() { var peakAssociator = new PeakToMSFeatureAssociator(); Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var scanSet = new ScanSet(6005); run.CurrentScanSet = scanSet; var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true); var decon = new HornDeconvolutor(); msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); peakAssociator.Execute(run.ResultCollection); var numPeaksAssociatedWithFeatures = 0; foreach (var msfeature in run.ResultCollection.ResultList) { foreach (var peak in msfeature.IsotopicProfile.Peaklist) { numPeaksAssociatedWithFeatures++; } } var numPeaksInPeakListWithAssociations = 0; foreach (MSPeak peak in run.PeakList) { Console.WriteLine(peak.MSFeatureID + "\t" + peak.XValue + "\t" + peak.Height + "\t"); if (peak.MSFeatureID != -1) { numPeaksInPeakListWithAssociations++; } } //I don't think I can assume this... msfeature1 might overlap and share a peak with msfeature2 //Assert.AreEqual(numPeaksAssociatedWithFeatures, numPeaksInPeakListWithAssociations); Console.WriteLine("total peaks associated with MSFeatures = " + numPeaksAssociatedWithFeatures); Console.WriteLine("total peaks in original peaklist that were associated = " + numPeaksInPeakListWithAssociations); Console.WriteLine("fraction peaks assigned = " + (double)(numPeaksInPeakListWithAssociations / (double)run.PeakList.Count)); }
public void GetIonInjectionTimeTest1() { var run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var scan = 6005; var ionInjectionTime = run.GetIonInjectionTimeInMilliseconds(scan); Assert.AreEqual(2.84m, (decimal)Math.Round(ionInjectionTime, 2)); Console.WriteLine("Scan " + scan + "; ion injection time = " + ionInjectionTime); }
public void getSpectrum_Test1() { var run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var xydata = run.GetMassSpectrum(new Backend.Core.ScanSet(6005)); Assert.IsTrue(xydata.Xvalues.Length > 1000); // TestUtilities.DisplayXYValues(xydata); }
public void GetMS2IsolationWidthTest1() { var run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var scan = 6006; var isolationWidth = run.GetMS2IsolationWidth(scan); Assert.AreEqual(3.0m, (decimal)Math.Round(isolationWidth, 1)); Console.WriteLine("Scan " + scan + "; MS2IsolationWidth = " + isolationWidth); }
public void ThrashPreferPlusOneChargeStateTest1() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); run.ScanSetCollection.Create(run, 6005, 6005, 1, 1, false); var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); var peakDetector = new DeconToolsPeakDetectorV2(0.5, 2, Globals.PeakFitType.QUADRATIC, true); peakDetector.IsDataThresholded = true; var parameters = new ThrashParameters(); parameters.MinMSFeatureToBackgroundRatio = 1; parameters.MaxFit = 0.3; parameters.CheckAllPatternsAgainstChargeState1 = true; var deconvolutor = new ThrashDeconvolutorV2(parameters); var scan = new ScanSet(6005); run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); run.PeakList = run.PeakList.Where(p => p.XValue > 750 && p.XValue < 753).ToList(); deconvolutor.Execute(run.ResultCollection); Assert.IsTrue(run.ResultCollection.ResultList.Count > 0); var result1 = run.ResultCollection.ResultList.First(); Assert.AreEqual(1, result1.IsotopicProfile.ChargeState); Console.WriteLine("--------- Prefer +1 charge state ----------------"); TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); run.ResultCollection.ResultList.Clear(); run.ResultCollection.IsosResultBin.Clear(); deconvolutor.Parameters.CheckAllPatternsAgainstChargeState1 = false; deconvolutor.Execute(run.ResultCollection); Console.WriteLine("\n--------- No charge state bias ----------------"); TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); Assert.IsTrue(run.ResultCollection.ResultList.Count > 0); result1 = run.ResultCollection.ResultList.First(); Assert.AreEqual(3, result1.IsotopicProfile.ChargeState); }
public void getSummedSpectrum_Test1() { var run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var scanset = new ScanSet(6005, new int[] { 6005, 6012, 6019 }); var xydata = run.GetMassSpectrum(scanset); Assert.IsTrue(xydata.Xvalues.Length > 1000); //TestUtilities.DisplayXYValues(run.XYData); }
public void GetScanInfoTest1() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var msmsScanNum1 = 6000; var scan = new ScanSet(msmsScanNum1); var scanInfoString = run.GetScanInfo(scan.PrimaryScanNumber); Assert.AreEqual(@"ITMS + c NSI d Full ms2 [email protected] [135.00-2000.00]", scanInfoString); }
public void getNumSpectraTest1() { var run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var numScans = run.GetNumMSScans(); Assert.AreEqual(18505, numScans); Assert.AreEqual(1, run.MinLCScan); Assert.AreEqual(18505, run.MaxLCScan); //TestUtilities.DisplayXYValues(run.XYData); }
public void OldDeconvolutorOrbitrapTest1() { Run run = new XCaliburRun2(FileRefs.RawDataMSFiles.OrbitrapStdFile1); run.ScanSetCollection.Create(run, 6005, 6200, 1, 1, false); var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); var peakDetector = new DeconToolsPeakDetectorV2(1.3, 2, DeconTools.Backend.Globals.PeakFitType.QUADRATIC, true); var deconvolutor = new HornDeconvolutor(); deconvolutor.MinPeptideBackgroundRatio = 3; //deconvolutor.IsMZRangeUsed = true; //deconvolutor.MinMZ = 575; //deconvolutor.MaxMZ = 585; foreach (var scanSet in run.ScanSetCollection.ScanSetList) { run.CurrentScanSet = scanSet; msgen.Execute(run.ResultCollection); peakDetector.Execute(run.ResultCollection); run.CurrentScanSet.BackgroundIntensity = peakDetector.BackgroundIntensity; var stopwatch = new Stopwatch(); stopwatch.Start(); deconvolutor.Execute(run.ResultCollection); stopwatch.Stop(); Console.WriteLine("Time for decon= \t" + stopwatch.ElapsedMilliseconds); } //Assert.AreEqual(93, run.ResultCollection.ResultList.Count); ////order and get the most intense msfeature //run.ResultCollection.ResultList = run.ResultCollection.ResultList.OrderByDescending(p => p.IsotopicProfile.IntensityAggregate).ToList(); //IsosResult testIso = run.ResultCollection.ResultList[0]; //Assert.AreEqual(13084442, testIso.IsotopicProfile.IntensityAggregate); //Assert.AreEqual(2, testIso.IsotopicProfile.ChargeState); //Assert.AreEqual(0.01012m, (decimal)Math.Round(testIso.IsotopicProfile.Score, 5)); //Assert.AreEqual(3, testIso.IsotopicProfile.Peaklist.Count); //Assert.AreEqual(481.274105402604m, (decimal)testIso.IsotopicProfile.Peaklist[0].XValue); //Assert.AreEqual(481.775412188198m, (decimal)testIso.IsotopicProfile.Peaklist[1].XValue); //Assert.AreEqual(482.276820274024m, (decimal)testIso.IsotopicProfile.Peaklist[2].XValue); //TestUtilities.DisplayIsotopicProfileData(testIso.IsotopicProfile); //TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); //TestUtilities.DisplayPeaks(run.PeakList); }
public void fitterOnRapidDataTest1() { Run run = new XCaliburRun2(xcaliburTestfile); ResultCollection results = new ResultCollection(run); run.CurrentScanSet = new ScanSet(6067); bool isTicRequested = false; Task msGen = new GenericMSGenerator(1154, 1158, isTicRequested); msGen.Execute(results); DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(); detectorParams.PeakBackgroundRatio = 0.5; detectorParams.PeakFitType = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC; detectorParams.SignalToNoiseThreshold = 3; detectorParams.ThresholdedData = false; Task peakDetector = new DeconToolsPeakDetectorV2(detectorParams); peakDetector.Execute(results); Task decon = new RapidDeconvolutor(); decon.Execute(results); IsosResult result1 = results.ResultList[0]; double resolution = result1.IsotopicProfile.GetMZofMostAbundantPeak() / result1.IsotopicProfile.GetFWHM(); MercuryDistributionCreator distcreator = new MercuryDistributionCreator(); distcreator.CreateDistribution(result1.IsotopicProfile.MonoIsotopicMass, result1.IsotopicProfile.ChargeState, resolution); distcreator.OffsetDistribution(result1.IsotopicProfile); XYData theorXYData = distcreator.Data; // theorXYData.Display(); AreaFitter areafitter = new AreaFitter(); double fitval = areafitter.GetFit(theorXYData, run.XYData, 10); Console.WriteLine(result1.IsotopicProfile.Score + "\t" + fitval); Console.WriteLine((result1.IsotopicProfile.Score - fitval) / result1.IsotopicProfile.Score * 100); Assert.AreEqual(0.0207350903681061m, (decimal)fitval); }
public void fitterOnHornDataTest1() { Run run = new XCaliburRun2(xcaliburTestfile); var results = new ResultCollection(run); run.CurrentScanSet = new ScanSet(6067); var isTicRequested = false; Task msGen = new GenericMSGenerator(1154, 1158, isTicRequested); msGen.Execute(results); Task peakDetector = new DeconToolsPeakDetectorV2(0.5, 3, Globals.PeakFitType.QUADRATIC, false); peakDetector.Execute(results); var deconParameters = new DeconToolsParameters(); deconParameters.ThrashParameters.MinMSFeatureToBackgroundRatio = 2; // PeptideMinBackgroundRatio Task decon = new HornDeconvolutor(deconParameters); decon.Execute(results); var result1 = results.ResultList[0]; var distcreator = new MercuryDistributionCreator(); var resolution = result1.IsotopicProfile.GetMZofMostAbundantPeak() / result1.IsotopicProfile.GetFWHM(); distcreator.CreateDistribution(result1.IsotopicProfile.MonoIsotopicMass, result1.IsotopicProfile.ChargeState, resolution); distcreator.OffsetDistribution(result1.IsotopicProfile); var theorXYData = distcreator.Data; //StringBuilder sb = new StringBuilder(); //TestUtilities.GetXYValuesToStringBuilder(sb, theorXYData.Xvalues, theorXYData.Yvalues); //Console.WriteLine(sb.ToString()); var areafitter = new AreaFitter(); var fitval = areafitter.GetFit(theorXYData, run.XYData, 10); Console.WriteLine(result1.IsotopicProfile.Score + "\t" + fitval); Console.WriteLine((result1.IsotopicProfile.Score - fitval) / result1.IsotopicProfile.Score); Assert.AreEqual(0.0207350903681061m, (decimal)fitval); //TODO: fix this test... i'm getting 0.0207350903681061m }