public void Test1() { double featureFinderTol = 15; var featureFinderRequiresMonoPeak = false; var n14n15Util = new N14N15TestingUtilities(); //get MS var massSpectrum = n14n15Util.GetSpectrumAMTTag23140708_Z3_Sum3(); //this is the diff b/w previous test and this one var mt23140708 = n14n15Util.CreateMT23140708_Z3(); var featureGen2 = new JoshTheorFeatureGenerator(); featureGen2.GenerateTheorFeature(mt23140708); //get ms peaks var peakDet = new DeconToolsPeakDetectorV2(1.3, 2, Globals.PeakFitType.QUADRATIC, false); var msPeakList = peakDet.FindPeaks(massSpectrum, 0, 0); var bff = new BasicTFF(featureFinderTol, featureFinderRequiresMonoPeak); var n14Profile = bff.FindMSFeature(msPeakList, mt23140708.IsotopicProfile); var theorXYData = mt23140708.IsotopicProfile.GetTheoreticalIsotopicProfileXYData(n14Profile.GetFWHM()); var theorMaxY = theorXYData.Yvalues.Max(); double obsMaxY = n14Profile.getMostIntensePeak().Height; for (var i = 0; i < theorXYData.Xvalues.Length; i++) { theorXYData.Yvalues[i] = theorXYData.Yvalues[i] * obsMaxY; } offsetDistribution(theorXYData, mt23140708.IsotopicProfile, n14Profile); var subtracted = XYDataUtilities.SubtractXYData(massSpectrum, theorXYData, n14Profile.MonoPeakMZ - 1, n14Profile.MonoPeakMZ + 3, 0.01); var outputFileMS = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\TextFile\massSpectrum1.txt"; var outputFileMSSubtracted = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\TextFile\massSpectrum1_withDataSubtracted.txt"; TestUtilities.WriteToFile(massSpectrum, outputFileMS); TestUtilities.WriteToFile(subtracted, outputFileMSSubtracted); // XYDataUtilities.NormalizeXYData() }
public void n14N15LabelledData_TFFTest1() { double featureFinderTol = 15; var featureFinderRequiresMonoPeak = false; var n14n15Util = new N14N15TestingUtilities(); //get sample MS from Test Data var massSpectrum = n14n15Util.GetSpectrumAMTTag23140708_Z3_Sum3(); //this is the diff b/w previous test and this one var mt23140708 = n14n15Util.CreateMT23140708_Z3(); //get ms peaks var peakDet = new DeconToolsPeakDetectorV2(1.3, 2, Globals.PeakFitType.QUADRATIC, false); var msPeakList = peakDet.FindPeaks(massSpectrum, 0, 0); //TestUtilities.DisplayPeaks(msPeakList); //generate theor unlabelled profile var unlabelledfeatureGen = new TomTheorFeatureGenerator(); unlabelledfeatureGen.GenerateTheorFeature(mt23140708); //generate theor N15-labelled profile var n15featureGen = new TomTheorFeatureGenerator(Globals.LabellingType.N15, 0.005); n15featureGen.GenerateTheorFeature(mt23140708); //find features in experimental data, using the theoretical profiles var msfeatureFinder = new BasicTFF(); msfeatureFinder.ToleranceInPPM = featureFinderTol; msfeatureFinder.NeedMonoIsotopicPeak = featureFinderRequiresMonoPeak; var n14profile = msfeatureFinder.FindMSFeature(msPeakList, mt23140708.IsotopicProfile); var n15profile = msfeatureFinder.FindMSFeature(msPeakList, mt23140708.IsotopicProfileLabelled); Console.WriteLine(mt23140708.GetEmpiricalFormulaFromTargetCode()); TestUtilities.DisplayIsotopicProfileData(mt23140708.IsotopicProfile); Console.WriteLine(); TestUtilities.DisplayIsotopicProfileData(mt23140708.IsotopicProfileLabelled); Console.WriteLine(); TestUtilities.DisplayIsotopicProfileData(n14profile); Console.WriteLine(); TestUtilities.DisplayIsotopicProfileData(n15profile); }