public void GetCalibratedMass1() { //see https://jira.pnnl.gov/jira/browse/OMCS-870 var testFile = @"\\protoapps\DataPkgs\Public\2013\743_Mycobacterium_tuberculosis_Cys_and_Ser_ABP\IQ_Analysis\Testing\LNA_A_Stat_Sample_SC_28_LNA_ExpA_Expo_Stat_SeattleBioMed_15Feb13_Cougar_12-12-36.raw"; var run = new RunFactory().CreateRun(testFile); var calibrationData = new ViperMassCalibrationData(); calibrationData.MassError = 4.8; var massAlignmentInfo = new MassAlignmentInfoLcmsWarp(); massAlignmentInfo.SetMassAlignmentData(calibrationData); run.MassAlignmentInfo = massAlignmentInfo; var observedMZ = 440.5887078; var theorMZ = 440.5858315; var calibratedMZ = run.GetAlignedMZ(observedMZ); Assert.AreEqual(440.5866m, (decimal)Math.Round(calibratedMZ, 4)); var ppmDiffBefore = (observedMZ - theorMZ) / theorMZ * 1e6; var ppmDiffAfter = (calibratedMZ - theorMZ) / theorMZ * 1e6; Console.WriteLine("input m/z= " + observedMZ); Console.WriteLine("calibrated m/z= " + calibratedMZ); Console.WriteLine("ppmDiffBeforeCalibration= " + ppmDiffBefore); Console.WriteLine("ppmDiffAftereCalibration= " + ppmDiffAfter); var theorMZToLookForInRawData = run.GetTargetMZAligned(theorMZ); var ppmDiffTheor = (theorMZToLookForInRawData - theorMZ) / theorMZ * 1e6; Console.WriteLine(); Console.WriteLine("Theor m/z = " + theorMZ); Console.WriteLine("Theor m/z to look for = " + theorMZToLookForInRawData); Console.WriteLine("ppmDiff = " + ppmDiffTheor); Assert.AreEqual(4.8m, (decimal)Math.Round(ppmDiffTheor, 1)); }