Esempio n. 1
0
        public void Mono3()
        {
            MzXmlReader reader = new MzXmlReader();

            reader.Open("data/orbixl-mini.mzxml");
            var  scans      = new List <Scan>();
            Scan ms2Scan    = new Scan();
            Scan parentScan = new Scan();

            GetBlock(reader, 3, ref ms2Scan, ref parentScan, ref scans);
            MonocleOptions options = new MonocleOptions();

            Monocle.Run(scans, parentScan, ms2Scan.Precursors[0], options);
            Assert.Equal(869.449817, ms2Scan.Precursors[0].Mz, 3);
        }
Esempio n. 2
0
        public void Mono2()
        {
            MzXmlReader reader = new MzXmlReader();

            reader.Open("data/orbixl-mini.mzxml", new ScanReaderOptions());
            var  scans      = new List <Scan>();
            Scan ms2Scan    = new Scan();
            Scan parentScan = new Scan();

            GetBlock(reader, 2, ref ms2Scan, ref parentScan, ref scans);
            MonocleOptions options = new MonocleOptions();

            Monocle.Run(scans, parentScan, ms2Scan.Precursors[0], options);
            Assert.Equal(1009.98842, ms2Scan.Precursors[0].Mz, 2);
        }
Esempio n. 3
0
        public void testOutput()
        {
            var reader = new MzXmlReader();

            reader.Open("data/orbixl-mini.mzxml", new ScanReaderOptions());

            string dir = Directory.GetCurrentDirectory();

            var writer = new MzXmlWriter();

            writer.Open("data/mzxml-writer-test.mzxml");

            var header = new ScanFileHeader();

            header.FileName = "mzxml-writer-test.mzxml";
            header.FilePath = "data/mzxml-writer-test.mzxml";
            writer.WriteHeader(header);

            var scans = reader.GetEnumerator();

            scans.MoveNext();
            Scan scan1 = (Scan)scans.Current;

            scans.MoveNext();
            Scan scan2 = (Scan)scans.Current;

            writer.WriteScan(scan1);
            writer.WriteScan(scan2);
            writer.Close();

            reader = new MzXmlReader();
            reader.Open("data/mzxml-writer-test.mzxml", new ScanReaderOptions());

            scans = reader.GetEnumerator();
            scans.MoveNext();
            Scan scan3 = (Scan)scans.Current;

            scans.MoveNext();
            Scan scan4 = (Scan)scans.Current;

            Assert.Equal(scan1.ScanNumber, scan3.ScanNumber);
            Assert.Equal(scan1.RetentionTime, scan3.RetentionTime);
            Assert.Equal(scan1.PeakCount, scan3.PeakCount);
            Assert.Equal(scan1.Centroids[0].Mz, scan3.Centroids[0].Mz);
            Assert.Equal(scan1.Centroids[11].Intensity, scan3.Centroids[11].Intensity);
        }
Esempio n. 4
0
        public void TestReadMs2()
        {
            MzXmlReader reader = new MzXmlReader();

            reader.Open("data/orbixl-mini.mzxml", new ScanReaderOptions());
            var scans = new List <Scan>();

            foreach (Scan scan in reader)
            {
                scans.Add(scan);
            }
            var ms2Scan = scans[10];

            Assert.Equal(2, ms2Scan.MsOrder);
            Assert.Equal(1d, ms2Scan.Precursors.Count, 3);
            Assert.Equal(687.3921, ms2Scan.Precursors[0].Mz, 3);
        }
Esempio n. 5
0
        public void TestReadScans()
        {
            MzXmlReader reader = new MzXmlReader();

            reader.Open("data/orbixl-mini.mzxml", new ScanReaderOptions());
            var scans = new List <Scan>();

            foreach (Scan scan in reader)
            {
                scans.Add(scan);
            }
            Assert.Equal(84, scans.Count);
            Assert.Equal(1, scans[0].ScanNumber);
            Assert.Equal(1, scans[0].MsOrder);
            Assert.Equal(1396, scans[0].PeakCount);
            Assert.Equal(1396, scans[0].Centroids.Count);
            Assert.Equal(356.43359375, scans[0].Centroids[0].Mz, 6);
        }
Esempio n. 6
0
        public void WindowTest()
        {
            MzXmlReader reader = new MzXmlReader();

            reader.Open("data/orbixl-mini.mzxml");
            var scans = new List <Scan>();

            foreach (Scan scan in reader)
            {
                scans.Add(scan);
            }
            MonocleOptions options = new MonocleOptions();

            options.AveragingVector            = AveragingVector.Both;
            options.Number_Of_Scans_To_Average = 6;
            var nearby = Monocle.GetNearbyScans(ref scans, scans[scans[10].PrecursorMasterScanNumber - 1], options);

            Assert.Equal(13, nearby.Count);
        }
Esempio n. 7
0
        public void MonoAll()
        {
            MzXmlReader reader = new MzXmlReader();

            reader.Open("data/orbixl-mini.mzxml");
            var scans = new List <Scan>();

            foreach (Scan scan in reader)
            {
                scans.Add(scan);
            }
            MonocleOptions options = new MonocleOptions();

            options.AveragingVector = AveragingVector.Both;
            Monocle.Run(ref scans, options);

            Assert.Equal(687.39195, scans[10].Precursors[0].Mz, 3);
            Assert.Equal(1009.98842, scans[31].Precursors[0].Mz, 2);
            Assert.Equal(869.449817, scans[52].Precursors[0].Mz, 3);
        }
Esempio n. 8
0
        public void TestOpen()
        {
            MzXmlReader reader = new MzXmlReader();

            reader.Open("data/orbixl-mini.mzxml", new ScanReaderOptions());
        }
Esempio n. 9
0
        public void TestOpen()
        {
            MzXmlReader reader = new MzXmlReader();

            reader.Open("data/orbixl-mini.mzxml");
        }