java.lang.Object
com.compomics.util.experiment.mass_spectrometry.indexes.PrecursorMap

public class PrecursorMap
extends Object
This map stores the precursors indexed by mass.
Author:
Marc Vaudel
  • Constructor Details

    • PrecursorMap

      public PrecursorMap()
      Empty default constructor
    • PrecursorMap

      public PrecursorMap​(HashMap<String,​Precursor> precursors, double precursorTolerance, boolean ppm)
      Builds a precursor map.
      Parameters:
      precursors - map of the precursors indexed by spectrum title
      precursorTolerance - the precursor mass tolerance to use
      ppm - boolean indicating whether the tolerance is in ppm
  • Method Details

    • getMatchingSpectra

      public ArrayList<PrecursorMap.PrecursorWithTitle> getMatchingSpectra​(double referenceMz)
      Returns a list containing the precursors matching the given m/z. TODO: check only one/two bins when possible
      Parameters:
      referenceMz - a mz to query
      Returns:
      a list containing the precursors matching the given m/z
    • getBins

      public ArrayList<Integer> getBins()
      Returns the bins in the map.
      Returns:
      the bins in the map
    • getPrecursorsInBin

      public HashMap<Double,​ArrayList<PrecursorMap.PrecursorWithTitle>> getPrecursorsInBin​(int bin)
      Returns the precursors at the given bin indexed by mass. Null if none found.
      Parameters:
      bin - the bin number
      Returns:
      the precursors at the given bin
    • getMass

      public Double getMass​(int bin)
      Returns the mass associated with the given bin, the middle of the bin.
      Parameters:
      bin - the bin number
      Returns:
      the mass associated with the given bin
    • getMinMz

      public Double getMinMz()
      Returns the minimal m/z encountered among the precursors.
      Returns:
      the minimal m/z encountered among the precursors
    • getMaxMz

      public Double getMaxMz()
      Returns the maximal m/z encountered among the precursors.
      Returns:
      the maximal m/z encountered among the precursors