public class SpectrumIndex extends Object implements UrParameter
Modifier and Type | Field and Description |
---|---|
double |
intensityLimit
The intensity limit used for the index.
|
serialVersionUID
Constructor and Description |
---|
SpectrumIndex()
Constructor for an empty index.
|
SpectrumIndex(HashMap<Double,Peak> peaks,
double intenstiyLimit,
double tolerance,
boolean ppm)
Builds a new index.
|
Modifier and Type | Method and Description |
---|---|
int |
getBin(double mz)
Returns the bin corresponding to the given m/z.
|
Integer |
getBinMax()
Returns the highest bin.
|
Integer |
getBinMin()
Returns the lowest bin.
|
ArrayList<Integer> |
getBins()
Returns the bins in the map as a list.
|
Double |
getMass(int bin)
Returns the mass associated with the given bin, the middle of the bin.
|
ArrayList<Peak> |
getMatchingPeaks(double mz)
Returns the peaks matching the given m/z.
|
String |
getParameterKey()
This method returns the key of the paramter.
|
HashMap<Double,Peak> |
getPeaksInBin(Integer bin)
Returns the peaks at the given bin indexed by m/z.
|
Set<Integer> |
getRawBins()
Returns the bins in the map as collection of keys from the map.
|
double |
getTotalIntensity()
Returns the total intensity of the peaks above the intensity threshold.
|
public final double intensityLimit
public SpectrumIndex()
public SpectrumIndex(HashMap<Double,Peak> peaks, double intenstiyLimit, double tolerance, boolean ppm)
peaks
- map of the peaks indexed by m/zintenstiyLimit
- a lower limit for the intensity of the peaks to
indextolerance
- the tolerance to useppm
- boolean indicating whether the tolerance is in ppmpublic int getBin(double mz)
mz
- the m/zpublic ArrayList<Peak> getMatchingPeaks(double mz)
mz
- a m/z to querypublic ArrayList<Integer> getBins()
public Set<Integer> getRawBins()
public HashMap<Double,Peak> getPeaksInBin(Integer bin)
bin
- the bin numberpublic Double getMass(int bin)
bin
- the bin numberpublic Integer getBinMax()
public Integer getBinMin()
public double getTotalIntensity()
public String getParameterKey()
UrParameter
getParameterKey
in interface UrParameter
Copyright © 2018. All rights reserved.