コード例 #1
0
        private void Orbitrap_MsScanArrived(object sender, MsScanEventArgs e)
        {
            string accessId;

            using (IMsScan scan = (IMsScan)e.GetScan())                 // caution! You must dispose this, or you block shared memory!
            {
                // The access ID gives a feedback about placed scans or scans generated by the instrument.
                scan.SpecificInformation.TryGetValue("Access Id:", out accessId);
                Console.WriteLine("{0:HH:mm:ss,fff} scan {1} arrived", DateTime.Now, accessId);

                ////// The common part is shared by all Thermo Fisher instruments, these settings mainly form the so called filter string
                ////// which also appears on top of each spectrum in many visualizers.
                //Console.WriteLine("----------------Common--------------");
                //Dump("Common", scan.CommonInformation);

                ////// The specific part is individual for each instrument type. Many values are shared by different Exactive Series models.
                //Console.WriteLine("----------------Specific--------------");
                // Dump("Specific", scan.SpecificInformation);

                //Dump(scan);

                var ib = IsBoxCarScan(scan);
                Console.WriteLine("IsBoxCar Scan: {0}", ib);

                FullScan.PlaceFullScan(m_scans, Parameters);

                //List<double> dynamicBoxCarRange = new List<double> { 600, 700, 800, 900, 1000 };
                //BoxCarScan.PlaceBoxCarScan(m_scans, Parameters, dynamicBoxCarRange);

                DataDependentScan.PlaceMS2Scan(m_scans, Parameters, 750);

                BoxCarScan.PlaceStaticBoxCarScan(m_scans, Parameters);
            }
        }
コード例 #2
0
ファイル: DataReceiver.cs プロジェクト: avcarr2/MetaDrive
        private void PlaceBU_MS2Scan(IMsScan scan, List <IsoEnvelop> isoEnvelops)
        {
            Console.WriteLine("\n{0:HH:mm:ss,fff} Deconvolute Dynamic BoxCar Start", DateTime.Now);

            int placeScanCount = 0;

            foreach (var iso in isoEnvelops.OrderByDescending(p => p.TotalIntensity))
            {
                if (placeScanCount >= Parameters.MS1IonSelecting.TopN)
                {
                    break;
                }

                if (DynamicExclusionList.isNotInExclusionList(iso.ExperimentIsoEnvelop.First().Mz, Parameters.MS1IonSelecting.ExclusionTolerance))
                {
                    var dataTime = DateTime.Now;
                    lock (lockerExclude)
                    {
                        DynamicExclusionList.exclusionList.Enqueue(new Tuple <double, int, DateTime>(iso.ExperimentIsoEnvelop.First().Mz, iso.Charge, dataTime));
                        Console.WriteLine("2 ExclusionList Enqueue: {0}", iso.ExperimentIsoEnvelop.First().Mz);
                    }

                    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, iso.ExperimentIsoEnvelop.First().Mz);
                    placeScanCount++;
                }
            }
        }
コード例 #3
0
ファイル: DataReceiver.cs プロジェクト: avcarr2/MetaDrive
        private void PlaceUserDefined(IMsScan scan)
        {
            Console.WriteLine("\n{0:HH:mm:ss,fff} UserDefined Start", DateTime.Now);

            var monomass = 16950.88339;

            Dictionary <int, double> mz_z = new Dictionary <int, double>();

            for (int i = 15; i <= 27; i++)
            {
                mz_z.Add(i, monomass.ToMz(i));
            }

            var mzs = mz_z.Values;

            //foreach (var mz in mzs)
            //{
            //    Parameters.MS2ScanSetting.NCE = 10;
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE = 15;
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE = 20;
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE = 25;
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE = 30;
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE = 35;
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE = 40;
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE = 45;
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE = 50;
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //}
            //Parameters.MS2ScanSetting.NCE = 25;

            //foreach (var mz in mzs)
            //{
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE_factors = "[0.9, 1, 1.1]";
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE_factors = "[0.8, 1, 1.2]";
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE_factors = "[0.6, 1, 1.4]";
            //    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
            //    Parameters.MS2ScanSetting.NCE_factors = "null";
            //}

            int j = 15;

            while (j <= 27)
            {
                DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz_z[j]);
                Parameters.MS2ScanSetting.NCE_factors = "[0.9, 1, 1.1]";
                DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz_z[j]);
                Parameters.MS2ScanSetting.NCE_factors = "[0.8, 1, 1.2]";
                DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz_z[j]);
                Parameters.MS2ScanSetting.NCE_factors = "[0.6, 1, 1.4]";
                DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz_z[j]);
                Parameters.MS2ScanSetting.NCE_factors = "null";
                j += 1;
            }

            List <double> comb = new List <double>();

            comb.Add(mz_z[20]);
            comb.Add(mz_z[21]);
            comb.Add(mz_z[22]);
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.9, 1, 1.1]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.8, 1, 1.2]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.6, 1, 1.4]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "null";

            comb.Clear();
            comb.Add(mz_z[19]);
            comb.Add(mz_z[21]);
            comb.Add(mz_z[23]);
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.9, 1, 1.1]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.8, 1, 1.2]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.6, 1, 1.4]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "null";

            comb.Clear();
            comb.Add(mz_z[17]);
            comb.Add(mz_z[21]);
            comb.Add(mz_z[25]);
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.9, 1, 1.1]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.8, 1, 1.2]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.6, 1, 1.4]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "null";

            comb.Clear();
            comb.Add(mz_z[17]);
            comb.Add(mz_z[19]);
            comb.Add(mz_z[21]);
            comb.Add(mz_z[23]);
            comb.Add(mz_z[25]);
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.9, 1, 1.1]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.8, 1, 1.2]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "[0.6, 1, 1.4]";
            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, comb);
            Parameters.MS2ScanSetting.NCE_factors = "null";

            FullScan.PlaceFullScan(m_scans, Parameters);
        }
コード例 #4
0
ファイル: DataReceiver.cs プロジェクト: avcarr2/MetaDrive
        private void PlaceDynamicBoxCarMS2Scan(IMsScan scan, List <ChargeEnvelop> chargeEnvelops, List <IsoEnvelop> isoEnvelops)
        {
            Console.WriteLine("\n{0:HH:mm:ss,fff} Deconvolute Dynamic BoxCar Start", DateTime.Now);

            int placeScanCount = 0;

            foreach (var ce in chargeEnvelops)
            {
                if (placeScanCount >= Parameters.MS1IonSelecting.TopN)
                {
                    return;
                }

                var mzs = ce.distributions.Select(p => p.mz).OrderBy(p => p).ToArray();

                int matchedCount = DynamicDBCExclusionList.MatchExclusionList(mzs, 0.1);

                if (matchedCount == 0)
                {
                    Console.WriteLine("DynamicDBCExclusionList didn't match.");
                    if (Parameters.BoxCarScanSetting.DoDbcForMS2)
                    {
                        DataDependentScan.PlaceMS2Scan(m_scans, Parameters, ce.mzs_box);
                    }
                    else
                    {
                        var mz = ce.distributions_withIso.OrderByDescending(p => p.intensity).First().isoEnvelop.ExperimentIsoEnvelop.First().Mz;
                        if (DynamicExclusionList.isNotInExclusionList(mz, Parameters.MS1IonSelecting.ExclusionTolerance))
                        {
                            DataDependentScan.PlaceMS2Scan(m_scans, Parameters, mz);
                        }
                    }

                    placeScanCount++;

                    lock (lockerExclude)
                    {
                        DynamicDBCExclusionList.DBCExclusionList.Enqueue(new DynamicDBCValue(mzs, 0, DateTime.Now));
                        foreach (var x in ce.distributions_withIso)
                        {
                            var mz = x.isoEnvelop.ExperimentIsoEnvelop.First().Mz;
                            if (DynamicExclusionList.isNotInExclusionList(mz, Parameters.MS1IonSelecting.ExclusionTolerance))
                            {
                                DynamicExclusionList.exclusionList.Enqueue(new Tuple <double, int, DateTime>(mz, x.charge, DateTime.Now));
                                Console.WriteLine("1 ExclusionList Enqueue: {0}", mz);
                            }
                        }
                    }
                }
                else
                {
                    Console.WriteLine("DynamicDBCExclusionList did match.");
                }
            }

            if (placeScanCount >= Parameters.MS1IonSelecting.TopN)
            {
                return;
            }

            foreach (var iso in isoEnvelops)
            {
                if (placeScanCount >= Parameters.MS1IonSelecting.TopN)
                {
                    return;
                }

                if (DynamicExclusionList.isNotInExclusionList(iso.ExperimentIsoEnvelop.First().Mz, Parameters.MS1IonSelecting.ExclusionTolerance))
                {
                    var dataTime = DateTime.Now;
                    lock (lockerExclude)
                    {
                        DynamicExclusionList.exclusionList.Enqueue(new Tuple <double, int, DateTime>(iso.ExperimentIsoEnvelop.First().Mz, iso.Charge, dataTime));
                        Console.WriteLine("2 ExclusionList Enqueue: {0}", iso.ExperimentIsoEnvelop.First().Mz);
                    }

                    DataDependentScan.PlaceMS2Scan(m_scans, Parameters, iso.ExperimentIsoEnvelop.First().Mz);
                    placeScanCount++;
                }
            }
        }