public void testXicReadFullRange() { var testRawFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Data/small.RAW"); XicData xicData = new XicData { // test the full range Content = new List <XicUnit> { new XicUnit() { Meta = new XicMeta() { MzStart = null, MzEnd = null, RtStart = null, RtEnd = null } } } }; XicReader.ReadXic(testRawFile, false, xicData); XicUnit xicUnit = xicData.Content[0]; Assert.AreEqual(14, ((Array)xicUnit.RetentionTimes).Length); Assert.AreEqual(14, ((Array)xicUnit.Intensities).Length); Assert.AreEqual(140, xicUnit.Meta.MzStart, 0.01); Assert.AreEqual(2000, xicUnit.Meta.MzEnd, 0.01); Assert.AreEqual(0.004935, xicUnit.Meta.RtStart, 0.01); Assert.AreEqual(0.4872366666, xicUnit.Meta.RtEnd, 0.01); }
public void testXicRead() { var testRawFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Data/small2.RAW"); XicData xicData = new XicData { // test the full retention time range Content = new List <XicUnit> { new XicUnit() { Meta = new XicMeta() { MzStart = 749.786, MzEnd = 749.8093, RtStart = null, RtEnd = null } } } }; XicReader.ReadXic(testRawFile, false, xicData); XicUnit xicUnit = xicData.Content[0]; Assert.AreEqual(46, ((Array)xicUnit.RetentionTimes).Length); Assert.AreEqual(46, ((Array)xicUnit.Intensities).Length); Assert.AreEqual(749.786, xicUnit.Meta.MzStart, 0.01); Assert.AreEqual(749.8093, xicUnit.Meta.MzEnd, 0.01); Assert.AreEqual(10, xicUnit.Meta.RtStart, 0.01); Assert.AreEqual(10.98, xicUnit.Meta.RtEnd, 0.01); xicData = new XicData { // test the nonsensical retention time range Content = new List <XicUnit> { new XicUnit() { Meta = new XicMeta() { MzStart = 749.786, MzEnd = 749.8093, RtStart = 300, RtEnd = 400 } } } }; XicReader.ReadXic(testRawFile, false, xicData); xicUnit = xicData.Content[0]; Assert.AreEqual(1, ((Array)xicUnit.RetentionTimes).Length); Assert.AreEqual(1, ((Array)xicUnit.Intensities).Length); Assert.AreEqual(749.786, xicUnit.Meta.MzStart, 0.01); Assert.AreEqual(749.8093, xicUnit.Meta.MzEnd, 0.01); Assert.AreEqual(300, xicUnit.Meta.RtStart, 0.01); Assert.AreEqual(400, xicUnit.Meta.RtEnd, 0.01); }