public void GetMSLevelTest2() { var testfile = @"\\proto-7\AgQTOF03\2012_3\GLY06_11JAN12_LYNX_SN7980_TOP4wList_75000_SPIN_2\GLY06_11JAN12_LYNX_SN7980_TOP4wList_75000_SPIN_2.d"; Run run = new AgilentDRun(testfile); var scanStart = 3000; var scanStop = 3500; var stopwatch = new Stopwatch(); stopwatch.Start(); for (var scan = scanStart; scan <= scanStop; scan++) { var mslevel = run.GetMSLevel(scan); } stopwatch.Stop(); Console.WriteLine("Total time in milliseconds to get MSLevel for " + (scanStop - scanStart + 1) + " spectra = " + stopwatch.ElapsedMilliseconds); Console.WriteLine("Average time (ms) to get MSLevel = " + (double)stopwatch.ElapsedMilliseconds / (scanStop - scanStart + 1)); Assert.AreEqual(1, run.GetMSLevel(612)); Assert.AreEqual(2, run.GetMSLevel(613)); }
public void GetPrecursorTest1() { var testfile = @"\\proto-7\AgQTOF03\2012_3\GLY06_11JAN12_LYNX_SN7980_TOP4wList_75000_SPIN_2\GLY06_11JAN12_LYNX_SN7980_TOP4wList_75000_SPIN_2.d"; Run run = new AgilentDRun(testfile); var precursor = run.GetPrecursorInfo(612); Assert.AreEqual(1, precursor.MSLevel); Assert.AreEqual(-1, precursor.PrecursorCharge); Assert.AreEqual(0, precursor.PrecursorIntensity); Assert.AreEqual(0, precursor.PrecursorMZ); Assert.AreEqual(612, precursor.PrecursorScan); precursor = run.GetPrecursorInfo(613); Assert.AreEqual(2, precursor.MSLevel); Assert.AreEqual(1, precursor.PrecursorCharge); Assert.AreEqual(291638.781f, precursor.PrecursorIntensity); Assert.AreEqual(534.26422119140625, precursor.PrecursorMZ); Assert.AreEqual(613, precursor.PrecursorScan); }