Esempio n. 1
0
        private void TestReadMzML(FileSystemInfo mzMLFile, int expectedSpectra)
        {
            var methodName = MethodBase.GetCurrentMethod().Name;

            Utils.ShowStarting(methodName, mzMLFile.Name);

            var timer = new Stopwatch();

            timer.Start();

            var reader    = new MzMLReader(mzMLFile.FullName);
            var constTime = timer.Elapsed;

            Console.WriteLine(@"Constructor time: " + constTime);

            var numSpectra = reader.NumSpectra;
            var metaTime   = timer.Elapsed - constTime;

            Console.WriteLine(@"Metadata read time: " + metaTime);

            var spectra      = reader.ReadAllSpectra();
            var spectraCount = spectra.Count();

            timer.Stop();

            reader.Close();

            Console.WriteLine(@"Spectra Read time: " + (timer.Elapsed - metaTime));
            Console.WriteLine(@"Time: " + timer.Elapsed);

            Assert.AreEqual(expectedSpectra, numSpectra, "NumSpectra");
            Assert.AreEqual(expectedSpectra, spectraCount, "SpectraCount");
        }
Esempio n. 2
0
        [TestCase(@"\\proto-2\UnitTest_Files\InformedProteomics_TestFiles\MZML\VA139IMSMS_compressed.mzML", 3145)] // Centroid, Agilent QTOF, compressed binary data
		public void TestReadMzML(string filePath, int expectedSpectra)
		{
            var methodName = MethodBase.GetCurrentMethod().Name;
            TestUtils.ShowStarting(methodName, filePath);

			Stopwatch timer = new Stopwatch();
			timer.Start();
			var reader = new MzMLReader(filePath);
            var constTime = timer.Elapsed;
            Console.WriteLine(@"Constructor time: " + constTime);
		    var numSpectra = reader.NumSpectra;
            var metaTime = timer.Elapsed - constTime;
            Console.WriteLine(@"Metadata read time: " + metaTime);
            var spectra = reader.ReadAllSpectra();
            var spectraCount = spectra.Count();
			timer.Stop();
            Console.WriteLine(@"Spectra Read time: " + (timer.Elapsed - metaTime));
            Console.WriteLine(@"Time: " + timer.Elapsed);
            Assert.AreEqual(expectedSpectra, numSpectra, "NumSpectra");
            Assert.AreEqual(expectedSpectra, spectraCount, "SpectraCount");
            Assert.AreEqual(numSpectra, spectraCount, "NumSpectra vs. SpectraCount");
            reader.Close();
		}