public void ComputeMonoisotopicPeakIntensity(MzSpectrum precursorSpectrum) { if (precursorSpectrum.Size == 0) { throw new MzLibException("Could not compute monoisotopic peak intensity because the precursor scan contains no peaks"); } int thePeak = precursorSpectrum.GetClosestPeakIndex(SelectedIonMonoisotopicGuessMz.Value); SelectedIonMonoisotopicGuessIntensity = precursorSpectrum.YArray[thePeak]; SelectedIonMonoisotopicGuessMz = precursorSpectrum.XArray[thePeak]; }
public void ComputeSelectedPeakIntensity(MzSpectrum precursorSpectrum) { if (precursorSpectrum.Size == 0) { throw new MzLibException("Could not compute selected peak intensity because the precursor scan contains no peaks"); } var thePeak = precursorSpectrum.GetClosestPeakIndex(SelectedIonMZ.Value); SelectedIonIntensity = precursorSpectrum.YArray[thePeak.Value]; SelectedIonMZ = precursorSpectrum.XArray[thePeak.Value]; }
public void RefineSelectedMzAndIntensity(MzSpectrum precursorSpectrum) { if (!IsolationMz.HasValue) { throw new MzLibException("Could not define precursor ion because the isolation m/z window is undefined in the spectra file"); } if (precursorSpectrum.Size == 0) { throw new MzLibException("Could not define precursor ion because the precursor scan contains no peaks"); } int thePeak = precursorSpectrum.GetClosestPeakIndex(IsolationMz.Value); SelectedIonIntensity = precursorSpectrum.YArray[thePeak]; SelectedIonMZ = precursorSpectrum.XArray[thePeak]; }