Class PrecursorMap
java.lang.Object
com.compomics.util.experiment.mass_spectrometry.indexes.PrecursorMap
This map stores the precursors indexed by mass.
- Author:
- Marc Vaudel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassConvenience class storing the precursor and corresponding spectrum title. -
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructorPrecursorMap(HashMap<String, Precursor> precursors, double precursorTolerance, boolean ppm) Builds a precursor map. -
Method Summary
Modifier and TypeMethodDescriptiongetBins()Returns the bins in the map.getMass(int bin) Returns the mass associated with the given bin, the middle of the bin.getMatchingSpectra(double referenceMz) Returns a list containing the precursors matching the given m/z.getMaxMz()Returns the maximal m/z encountered among the precursors.getMinMz()Returns the minimal m/z encountered among the precursors.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
-