Пример #1
0
        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++;
                }
            }
        }
Пример #2
0
        internal DataReceiver(Parameters parameters)
        {
            Parameters           = parameters;
            DynamicExclusionList = new DynamicExclusionList();

            switch (Parameters.GeneralSetting.MethodType)
            {
            case MethodTypes.ShotGun:
                AddScanIntoQueueAction = AddScanIntoQueue_ShotGun;
                Console.WriteLine("AddScanIntoQueueAction = ShotGun.");
                break;

            case MethodTypes.StaticBoxCar:
                AddScanIntoQueueAction = AddScanIntoQueue_StaticBox;
                Console.WriteLine("AddScanIntoQueueAction = StaticBox.");
                break;

            case MethodTypes.DynamicBoxCar_BU:
                Boxes = new List <List <Tuple <double, double, double> > >();
                AddScanIntoQueueAction = AddScanIntoQueue_BynamicBoxCar_BU;
                Console.WriteLine("AddScanIntoQueueAction = DynamicBoxCar_BU.");
                break;

            case MethodTypes.DynamicBoxCar_TD:
                DynamicDBCExclusionList = new DynamicDBCExclusionList();
                AddScanIntoQueueAction  = AddScanIntoQueue_DynamicBoxCar_TD;
                Console.WriteLine("AddScanIntoQueueAction = DynamicBoxCar_TD.");
                break;

            case MethodTypes.UserDefined:
                AddScanIntoQueueAction = AddScanIntoQueue_UserDefined;
                Console.WriteLine("AddScanIntoQueueAction = UserDefined.");
                break;

            default:
                break;
            }
        }
Пример #3
0
        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++;
                }
            }
        }