Class PrecursorMap
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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
PrecursorMap.PrecursorWithTitle
Convenience class storing the precursor and corresponding spectrum title. -
Constructor Summary
Constructors Constructor Description PrecursorMap()
Empty default constructorPrecursorMap(HashMap<String,Precursor> precursors, double precursorTolerance, boolean ppm)
Builds a precursor map. -
Method Summary
Modifier and Type Method Description ArrayList<Integer>
getBins()
Returns the bins in the map.Double
getMass(int bin)
Returns the mass associated with the given bin, the middle of the bin.ArrayList<PrecursorMap.PrecursorWithTitle>
getMatchingSpectra(double referenceMz)
Returns a list containing the precursors matching the given m/z.Double
getMaxMz()
Returns the maximal m/z encountered among the precursors.Double
getMinMz()
Returns the minimal m/z encountered among the precursors.HashMap<Double,ArrayList<PrecursorMap.PrecursorWithTitle>>
getPrecursorsInBin(int bin)
Returns the precursors at the given bin indexed by mass.
-
Constructor Details
-
PrecursorMap
public PrecursorMap()Empty default constructor -
PrecursorMap
Builds a precursor map.- Parameters:
precursors
- map of the precursors indexed by spectrum titleprecursorTolerance
- the precursor mass tolerance to useppm
- boolean indicating whether the tolerance is in ppm
-
-
Method Details
-
getMatchingSpectra
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
Returns the bins in the map.- Returns:
- the bins in the map
-
getPrecursorsInBin
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
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
Returns the minimal m/z encountered among the precursors.- Returns:
- the minimal m/z encountered among the precursors
-
getMaxMz
Returns the maximal m/z encountered among the precursors.- Returns:
- the maximal m/z encountered among the precursors
-