Beispiel #1
0
        public void ComputeMonoisotopicPeakIntensity(IMzSpectrum <IMzPeak> precursorSpectrum)
        {
            var thePeak = precursorSpectrum.GetClosestPeak(SelectedIonMonoisotopicGuessMz.Value);

            SelectedIonMonoisotopicGuessIntensity = thePeak.Intensity;
            SelectedIonMonoisotopicGuessMz        = thePeak.Mz;
        }
Beispiel #2
0
        public void ComputeSelectedPeakIntensity(IMzSpectrum <IMzPeak> precursorSpectrum)
        {
            var thePeak = precursorSpectrum.GetClosestPeak(SelectedIonMZ);

            SelectedIonIntensity = thePeak.Intensity;
            SelectedIonMZ        = thePeak.Mz;
        }
Beispiel #3
0
        public void RefineSelectedMzAndIntensity(IMzSpectrum <IMzPeak> precursorSpectrum)
        {
            var thePeak = precursorSpectrum.GetClosestPeak(IsolationMz);

            SelectedIonIntensity = thePeak.Intensity;
            SelectedIonMZ        = thePeak.Mz;
        }
Beispiel #4
0
        public override IMsDataScan <IMzSpectrum <IMzPeak> > GetOneBasedScan(int oneBasedScanNumber)
        {
            if (Scans[oneBasedScanNumber - 1] == null)
            {
                var representativeScanNumber = oneBasedScanNumber + (numScansToAverage - 1) / 2;
                var representative           = raw.GetOneBasedScan(representativeScanNumber);
                if (representative.MsnOrder != 1)
                {
                    throw new MzLibException("Scan " + representativeScanNumber + " is not MS1 scan");
                }
                int      msnOrder = 1;
                Polarity polarity = representative.Polarity;
                if (!representative.IsCentroid)
                {
                    throw new MzLibException("Scan " + representativeScanNumber + " is not centroid scan");
                }
                bool           isCentroid    = true;
                double         retentionTime = representative.RetentionTime;
                MZAnalyzerType mzAnalyzer    = representative.MzAnalyzer;

                IMzSpectrum <IMzPeak> peaks = CombinePeaks(raw.Where(b => b.OneBasedScanNumber >= oneBasedScanNumber && b.OneBasedScanNumber <= oneBasedScanNumber + numScansToAverage - 1).Select(b => b.MassSpectrum).ToList(), ppmToleranceForPeakCombination);

                MzRange scanWindowRange = representative.ScanWindowRange;

                double totalIonCurrent = peaks.SumOfAllY;
                double injectionTime   = double.NaN;
                double[,] noiseData = null;

                Scans[oneBasedScanNumber - 1] = new MsDataScan <IMzSpectrum <IMzPeak> >(peaks, oneBasedScanNumber, msnOrder, isCentroid, polarity, retentionTime, scanWindowRange, null, mzAnalyzer, totalIonCurrent, injectionTime, noiseData, "scan=" + oneBasedScanNumber);
            }
            return(Scans[oneBasedScanNumber - 1]);
        }
Beispiel #5
0
        public void ComputeMonoisotopicPeakIntensity(IMzSpectrum <IMzPeak> precursorSpectrum)
        {
            if (precursorSpectrum.Size == 0)
            {
                throw new MzLibException("Could not compute monoisotopic peak intensity because precursorSpectrum.Size == 0");
            }
            var thePeak = precursorSpectrum.GetClosestPeakIndex(SelectedIonMonoisotopicGuessMz.Value);

            SelectedIonMonoisotopicGuessIntensity = precursorSpectrum.YArray[thePeak.Value];
            SelectedIonMonoisotopicGuessMz        = precursorSpectrum.XArray[thePeak.Value];
        }
Beispiel #6
0
        public void ComputeSelectedPeakIntensity(IMzSpectrum <IMzPeak> precursorSpectrum)
        {
            if (precursorSpectrum.Size == 0)
            {
                throw new MzLibException("Could not compute selected peak intensity because precursorSpectrum.Size == 0");
            }
            var thePeak = precursorSpectrum.GetClosestPeakIndex(SelectedIonMZ);

            SelectedIonIntensity = precursorSpectrum.YArray[thePeak.Value];
            SelectedIonMZ        = precursorSpectrum.XArray[thePeak.Value];
        }
Beispiel #7
0
        public IEnumerable <IsotopicEnvelope> GetIsolatedMassesAndCharges(IMzSpectrum <IMzPeak> precursorSpectrum, int minAssumedChargeState, int maxAssumedChargeState, double deconvolutionTolerancePpm, double intensityRatio)
        {
            if (IsolationRange == null)
            {
                yield break;
            }

            foreach (var haha in precursorSpectrum.Deconvolute(new MzRange(IsolationRange.Minimum - 8.5, IsolationRange.Maximum + 8.5), minAssumedChargeState, maxAssumedChargeState, deconvolutionTolerancePpm, intensityRatio)
                     .Where(b => b.peaks.Any(cc => isolationRange.Contains(cc.mz))))
            {
                yield return(haha);
            }
        }
Beispiel #8
0
        public void RefineSelectedMzAndIntensity(IMzSpectrum <IMzPeak> precursorSpectrum)
        {
            if (!IsolationMz.HasValue)
            {
                throw new MzLibException("Could not refine selected m/z and intensity because !IsolationMz.HasValue");
            }
            if (precursorSpectrum.Size == 0)
            {
                throw new MzLibException("Could not refine selected m/z and intensity because precursorSpectrum.Size == 0");
            }
            var thePeak = precursorSpectrum.GetClosestPeakIndex(IsolationMz.Value);

            SelectedIonIntensity = precursorSpectrum.YArray[thePeak.Value];
            SelectedIonMZ        = precursorSpectrum.XArray[thePeak.Value];
        }
Beispiel #9
0
        public IEnumerable <Tuple <List <IMzPeak>, int> > GetIsolatedMassesAndCharges(IMzSpectrum <IMzPeak> precursorSpectrum, int maxAssumedChargeState, Tolerance massTolerance, double intensityRatio)
        {
            if (IsolationRange == null)
            {
                yield break;
            }

            foreach (var haha in precursorSpectrum.Deconvolute(new MzRange(IsolationRange.Minimum - 8.5, IsolationRange.Maximum + 8.5), maxAssumedChargeState, massTolerance, intensityRatio)
                     .Where(b => b.Item1.Any(cc => isolationRange.Contains(cc.Mz))))
            {
                yield return(haha);
            }
        }