Example #1
0
        public void TestGeneratingProductXic()
        {
            var methodName = MethodBase.GetCurrentMethod().Name;

            TestUtils.ShowStarting(methodName);

            if (!File.Exists(TestRawFilePath))
            {
                Assert.Ignore(@"Skipping test {0} since file not found: {1}", methodName, TestRawFilePath);
            }

            var run = InMemoryLcMsRun.GetLcMsRun(TestRawFilePath);

//            const string rafFilePath = @"C:\cygwin\home\kims336\Data\QCShewQE\QC_Shew_13_04_A_17Feb14_Samwise_13-07-28.raf";
            const string rafFilePath = @"H:\Research\Jarret\10mz\raw\Q_2014_0523_50_10_fmol_uL_10mz.raf";

            if (!File.Exists(rafFilePath))
            {
                Assert.Ignore(@"Skipping raf portion of test {0} since file not found: {1}", methodName, rafFilePath);
            }

            var rafRun = new PbfLcMsRun(rafFilePath);

            const double precursorIonMz = 815.16;
            const double productIonMz   = 902.445;
            var          tolerance      = new Tolerance(10);
            var          xic1           = run.GetFullProductExtractedIonChromatogram(productIonMz, tolerance, precursorIonMz);
//            xic1.Display();
            var xic2 = rafRun.GetFullProductExtractedIonChromatogram(productIonMz, tolerance, precursorIonMz);

//            xic2.Display();
            Assert.True(xic1.Equals(xic2));
            Console.WriteLine(@"Done");
        }
Example #2
0
        public void TestGeneratingProductXics()
        {
            var methodName = MethodBase.GetCurrentMethod().Name;

            TestUtils.ShowStarting(methodName);

            if (!File.Exists(TestRawFilePath))
            {
                Assert.Ignore(@"Skipping test {0} since file not found: {1}", methodName, TestRawFilePath);
            }

            var run = InMemoryLcMsRun.GetLcMsRun(TestRawFilePath);

//            const string rafFilePath = @"C:\cygwin\home\kims336\Data\QCShewQE\QC_Shew_13_04_A_17Feb14_Samwise_13-07-28.raf";
            const string rafFilePath = @"H:\Research\Jarret\10mz\raw\Q_2014_0523_50_10_fmol_uL_10mz.raf";

            if (!File.Exists(rafFilePath))
            {
                Assert.Ignore(@"Skipping raf portion of test {0} since file not found: {1}", methodName, rafFilePath);
            }

            var rafRun = new PbfLcMsRun(rafFilePath);

            var tolerance = new Tolerance(10);

            var mzArr          = new double[100000];
            var precursorMzArr = new double[mzArr.Length];
            var rnd            = new Random();

            for (var i = 0; i < mzArr.Length; i++)
            {
                mzArr[i]          = rnd.NextDouble() * 1450.0 + 50.0;
                precursorMzArr[i] = rnd.NextDouble() * (810.0 - 390.0) + 390.0;
            }

            var sw = new System.Diagnostics.Stopwatch();

            //double sec;

            // method 1
            sw.Start();
            for (var i = 0; i < mzArr.Length; i++)
            {
                var mz    = mzArr[i];
                var tolTh = tolerance.GetToleranceAsTh(mz);
                var minMz = mz - tolTh;
                var maxMz = mz + tolTh;
                var xic1  = run.GetFullProductExtractedIonChromatogram(minMz, maxMz, precursorMzArr[i]);
                //var xic2 = rafRun.GetFullProductExtractedIonChromatogram(minMz, maxMz, precursorMzArr[i]);
                //Assert.True(xic1.Equals(xic2));
            }
            sw.Stop();

            Console.WriteLine(@"Method 1: {0:f4} sec", sw.Elapsed.TotalSeconds);

            sw.Reset();
            sw.Start();
            for (var i = 0; i < mzArr.Length; i++)
            {
                var mz    = mzArr[i];
                var tolTh = tolerance.GetToleranceAsTh(mz);
                var minMz = mz - tolTh;
                var maxMz = mz + tolTh;
                rafRun.GetFullProductExtractedIonChromatogram(minMz, maxMz, precursorMzArr[i]);
            }
            sw.Stop();

            Console.WriteLine(@"Method 2: {0:f4} sec", sw.Elapsed.TotalSeconds);

            Console.WriteLine(@"Done");
        }
Example #3
0
        public void TestGeneratingProductXics()
        {
            var methodName = MethodBase.GetCurrentMethod().Name;
            TestUtils.ShowStarting(methodName);

            if (!File.Exists(TestRawFilePath))
            {
                Assert.Ignore(@"Skipping test {0} since file not found: {1}", methodName, TestRawFilePath);
            }

            var run = InMemoryLcMsRun.GetLcMsRun(TestRawFilePath);

//            const string rafFilePath = @"C:\cygwin\home\kims336\Data\QCShewQE\QC_Shew_13_04_A_17Feb14_Samwise_13-07-28.raf";
            const string rafFilePath = @"H:\Research\Jarret\10mz\raw\Q_2014_0523_50_10_fmol_uL_10mz.raf";
            if (!File.Exists(rafFilePath))
            {
                Assert.Ignore(@"Skipping raf portion of test {0} since file not found: {1}", methodName, rafFilePath);
            }

            var rafRun = new PbfLcMsRun(rafFilePath);

            var tolerance = new Tolerance(10);

            var mzArr = new double[100000];
            var precursorMzArr = new double[mzArr.Length];
            var rnd = new Random();
            for (var i = 0; i < mzArr.Length; i++)
            {
                mzArr[i] = rnd.NextDouble() * 1450.0 + 50.0;
                precursorMzArr[i] = rnd.NextDouble() * (810.0 - 390.0) + 390.0;
            }

            var sw = new System.Diagnostics.Stopwatch();
            //double sec;

            // method 1
            sw.Start();
            for (var i = 0; i < mzArr.Length; i++)
            {
                var mz = mzArr[i];
                var tolTh = tolerance.GetToleranceAsTh(mz);
                var minMz = mz - tolTh;
                var maxMz = mz + tolTh;
                var xic1 = run.GetFullProductExtractedIonChromatogram(minMz, maxMz, precursorMzArr[i]);
                //var xic2 = rafRun.GetFullProductExtractedIonChromatogram(minMz, maxMz, precursorMzArr[i]);
                //Assert.True(xic1.Equals(xic2));
            }
            sw.Stop();
            
            Console.WriteLine(@"Method 1: {0:f4} sec", sw.Elapsed.TotalSeconds);

            sw.Reset();
            sw.Start();
            for (var i = 0; i < mzArr.Length; i++)
            {
                var mz = mzArr[i];
                var tolTh = tolerance.GetToleranceAsTh(mz);
                var minMz = mz - tolTh;
                var maxMz = mz + tolTh;
                rafRun.GetFullProductExtractedIonChromatogram(minMz, maxMz, precursorMzArr[i]);
            }
            sw.Stop();
            
            Console.WriteLine(@"Method 2: {0:f4} sec", sw.Elapsed.TotalSeconds);

            Console.WriteLine(@"Done");
        }
Example #4
0
        public void TestGeneratingProductXic()
        {
            var methodName = MethodBase.GetCurrentMethod().Name;
            TestUtils.ShowStarting(methodName);

            if (!File.Exists(TestRawFilePath))
            {
                Assert.Ignore(@"Skipping test {0} since file not found: {1}", methodName, TestRawFilePath);
            }

            var run = InMemoryLcMsRun.GetLcMsRun(TestRawFilePath);

//            const string rafFilePath = @"C:\cygwin\home\kims336\Data\QCShewQE\QC_Shew_13_04_A_17Feb14_Samwise_13-07-28.raf";
            const string rafFilePath = @"H:\Research\Jarret\10mz\raw\Q_2014_0523_50_10_fmol_uL_10mz.raf";
            if (!File.Exists(rafFilePath))
            {
                Assert.Ignore(@"Skipping raf portion of test {0} since file not found: {1}", methodName, rafFilePath);
            }

            var rafRun = new PbfLcMsRun(rafFilePath);

            const double precursorIonMz = 815.16;
            const double productIonMz = 902.445;
            var tolerance = new Tolerance(10);
            var xic1 = run.GetFullProductExtractedIonChromatogram(productIonMz, tolerance, precursorIonMz);
//            xic1.Display();
            var xic2 = rafRun.GetFullProductExtractedIonChromatogram(productIonMz, tolerance, precursorIonMz);
//            xic2.Display();
            Assert.True(xic1.Equals(xic2));
            Console.WriteLine(@"Done");
        }