Пример #1
0
        public void Create(Run run, bool sumAllScans = true, bool processMSMS = true)
        {
            ScanSetList = new List <ScanSet>();


            var minScan = GetMinScan(run);
            var maxScan = GetMaxScan(run);


            if (sumAllScans)
            {
                //find first MS1 scan

                var firstMS1Scan = -1;
                for (var i = minScan; i <= maxScan; i++)
                {
                    if (run.GetMSLevel(i) == 1)
                    {
                        firstMS1Scan = i;
                        break;
                    }
                }

                if (firstMS1Scan == -1)   //never found a single MS1 scan in the whole dataset
                {
                }
                else
                {
                    var scanSetFactory = new ScanSetFactory();
                    var scanset        = scanSetFactory.CreateScanSet(run, firstMS1Scan, minScan, maxScan);

                    ScanSetList.Add(scanset);
                }
            }
            else
            {
                for (var i = minScan; i <= maxScan; i++)
                {
                    var mslevel = run.GetMSLevel(i);

                    if (mslevel == 1 || processMSMS)
                    {
                        ScanSetList.Add(new ScanSet(i));
                    }
                }
            }
        }