java.lang.Object
com.compomics.util.experiment.mass_spectrometry.spectra.SpectrumUtil

public class SpectrumUtil
extends Object
Utilities functions to handle spectra.
Author:
Marc Vaudel
  • Constructor Details

  • Method Details

    • getIntensityLimit

      public static double getIntensityLimit​(Spectrum spectrum, AnnotationParameters.IntensityThresholdType intensityThresholdType, double thresholdValue)
      Returns the limit in intensity according to the given threshold.
      Parameters:
      spectrum - The spectrum.
      intensityThresholdType - The type of intensity threshold.
      thresholdValue - The threshold value.
      Returns:
      the intensity limit
    • getPeaksAboveIntensityThreshold

      public static double[][] getPeaksAboveIntensityThreshold​(Spectrum spectrum, AnnotationParameters.IntensityThresholdType intensityThresholdType, double thresholdValue)
      Returns the peaks above intensity threshold as an array of double (mz, intensity).
      Parameters:
      spectrum - The spectrum.
      intensityThresholdType - The type of intensity threshold.
      thresholdValue - The threshold value.
      Returns:
      The peaks above intensity threshold.
    • getWindowIndexes

      public static int[] getWindowIndexes​(Spectrum spectrum, double mzMin, double mzMax)
      Returns the start (inclusive) and end (exclusive) indexes of the peaks between mzMin (inclusive) and mzMax (exclusive).
      Parameters:
      spectrum - The spectrum to inspect.
      mzMin - The inclusive lower boundary to use.
      mzMax - The exclusive upper boundary to use.
      Returns:
      The start and end indexes of the peaks between mzMin (inclusive) and mzMax (exclusive).
    • getNPeaksAboveThreshold

      public static int getNPeaksAboveThreshold​(Spectrum spectrum, int startIndex, int endIndex, double intensityThreshold)
      Returns the number of peaks between the start index (inclusive) and the end index (exclusive) above the intensity threshold (inclusive).
      Parameters:
      spectrum - The spectrum.
      startIndex - The start index (inclusive).
      endIndex - The end index (exclusive).
      intensityThreshold - The intensity threshold (inclusive).
      Returns:
      The number of peaks between the start index (inclusive) and the end index (exclusive) above the intensity threshold (inclusive).