public class SpectrumIndex extends Object
Modifier and Type | Field and Description |
---|---|
double[] |
intensityArray
The mz array of the spectrum.
|
double |
intensityLimit
The intensity limit used for the index.
|
double[] |
mzArray
The mz array of the spectrum.
|
double |
tolerance
The mass tolerance.
|
Constructor and Description |
---|
SpectrumIndex()
Constructor for an empty index.
|
SpectrumIndex(double[] mz,
double[] intensity,
double intensityLimit,
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.
|
int[] |
getMatchingPeaks(double queryMz)
Returns the peaks matching the given m/z.
|
ArrayList<Integer> |
getPeaksInBin(int bin)
Returns the indexes of the peaks at the given bin indexed by m/z.
|
HashMap<Integer,ArrayList<Integer>> |
getPeaksMap()
Returns the peaks map.
|
boolean |
getPpm()
Returns whether the precursor mass tolerance is in ppm.
|
double |
getPrecursorToleance()
Returns the precursor tolerance.
|
Set<Integer> |
getRawBins()
Returns the bins in the map as collection of keys from the map.
|
double |
getScalingFactor()
Returns the scaling factor.
|
double |
getTotalIntensity()
Returns the total intensity of the peaks above the intensity threshold.
|
void |
setBinMax(Integer binMax)
Sets the highest bin in index.
|
void |
setBinMin(Integer binMin)
Sets the lowest bin in index.
|
void |
setPpm(boolean ppm)
Sets whether the precursor mass tolerance is in ppm.
|
void |
setScalingFactor(double scalingFactor)
Sets the scaling factor.
|
void |
setTotalIntensity(double totalIntensity)
Set the total intensity.
|
public final double tolerance
public final double[] mzArray
public final double[] intensityArray
public final double intensityLimit
public SpectrumIndex()
public SpectrumIndex(double[] mz, double[] intensity, double intensityLimit, double tolerance, boolean ppm)
mz
- array of the mz of the fragment ionsintensity
- array of the intensity of the fragment ionsintensityLimit
- a lower limit for the intensity of the peaks to
indextolerance
- the tolerance to useppm
- boolean indicating whether the tolerance is in ppmpublic HashMap<Integer,ArrayList<Integer>> getPeaksMap()
public boolean getPpm()
public double getPrecursorToleance()
public double getScalingFactor()
public int getBin(double mz)
mz
- the m/zpublic int[] getMatchingPeaks(double queryMz)
queryMz
- a m/z to querypublic ArrayList<Integer> getBins()
public Set<Integer> getRawBins()
public ArrayList<Integer> getPeaksInBin(int bin)
bin
- the bin numberpublic double getMass(int bin)
bin
- the bin numberpublic Integer getBinMax()
public Integer getBinMin()
public double getTotalIntensity()
public void setBinMax(Integer binMax)
binMax
- the highest bin in indexpublic void setBinMin(Integer binMin)
binMin
- the lowest bin in indexpublic void setPpm(boolean ppm)
ppm
- whether the precursor mass tolerance is in ppmpublic void setScalingFactor(double scalingFactor)
scalingFactor
- the scaling factorpublic void setTotalIntensity(double totalIntensity)
totalIntensity
- the total intensityCopyright © 2021. All rights reserved.