public LcMsPeakMatrix(LcMsRun run, LcMsFeatureLikelihood scorer = null, int minScanCharge = 1, int maxScanCharge = 60, int maxThreadCount = 0) { Run = run; _maxThreadCount = maxThreadCount; _ms1PeakList = new List<Ms1Peak>(); Ms1Spectra = new List<Ms1Spectrum>(); var ms1ScanNums = run.GetMs1ScanVector(); NColumns = ms1ScanNums.Length; MinSearchCharge = minScanCharge; MaxSearchCharge = maxScanCharge; NRows = Math.Min(MaxSearchCharge - MinSearchCharge + 1, 35); for (var i = 0; i < Math.Min(ms1ScanNums.Length, ushort.MaxValue); i++) { var ms1Spec = run.GetMs1Spectrum(ms1ScanNums[i]); Ms1Spectra.Add(ms1Spec); foreach (var peak in ms1Spec.Peaks) _ms1PeakList.Add(peak as Ms1Peak); } _ms1PeakList.Sort(); _distProfileAcrossCharge = new double[NRows]; _corrProfileAcrossCharge = new double[NRows]; _intensityAcrossCharge = new double[NRows]; _summedEnvelopeColRange = new int[NRows, 2]; _featureMatrix = null; Comparer = new MzComparerWithBinning(27); // 16ppm _scorer = scorer; _seedEnvelopes = new List<KeyValuePair<double, ObservedIsotopeEnvelope>>(); _ms1Filter = null; }
private Tuple<int, int> GetMinMaxMs1ScanNum(LcMsRun run, double minTime, double maxTime) { var ms1ScanNums = run.GetMs1ScanVector(); var minScanNum = -1; var maxScanNum = -1; for(var i = 1; i < ms1ScanNums.Length; i++) { var time = run.GetElutionTime(ms1ScanNums[i]); if (minScanNum < 0 && time > minTime) { minScanNum = ms1ScanNums[i - 1]; } if (maxScanNum < 0 && time > maxTime) { maxScanNum = ms1ScanNums[i]; break; } } return new Tuple<int, int>(minScanNum, maxScanNum); }