public abstract class Spectrum extends ExperimentObject
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
fileName
Spectrum file name.
|
protected int |
level
The MS level.
|
protected java.util.HashMap<java.lang.Double,Peak> |
peakList
Peak list.
|
protected java.lang.String |
scanNumber
Scan number or range.
|
protected double |
scanStartTime
The time point when the spectrum was recorded (scan start time in mzML
files).
|
static java.lang.String |
SPECTRUM_KEY_SPLITTER
The splitter in the key between spectrumFile and spectrumTitle.
|
protected java.lang.String |
spectrumTitle
Spectrum title.
|
Constructor and Description |
---|
Spectrum() |
Modifier and Type | Method and Description |
---|---|
void |
addPeak(Peak aPeak)
Adds a peak to the spectrum peak list.
|
java.util.HashMap<java.lang.Double,Peak> |
getDesignaledPeakList(java.util.ArrayList<IonMatch> matches)
Returns the peak list of this spectrum without matched peaks.
|
java.lang.String |
getFileName()
Returns the file name.
|
double |
getIntensityLimit(double intensityLimit)
Returns the intensity limit.
|
double[] |
getIntensityValuesAsArray()
Returns the intensity values as an array.
|
double[][] |
getJFreePeakList()
Format the peaks so they can be plot in JFreeChart.
|
int |
getLevel()
Returns at which level the spectrum was recorded.
|
double |
getMaxIntensity()
Returns the max intensity value.
|
double |
getMaxMz()
Returns the max mz value.
|
double |
getMinMz()
Returns the min mz value.
|
double[][] |
getMzAndIntensityAsArray()
Returns the m/z and intensity values as an array in increasing order
sorted on m/z value.
|
double[] |
getMzValuesAsArray()
Returns the mz values as an array.
|
java.util.Collection<Peak> |
getPeakList()
Returns the peak list.
|
java.util.HashMap<java.lang.Double,Peak> |
getPeakMap()
Returns a peak map where peaks are indexed by their m/z.
|
java.util.ArrayList<java.lang.Double> |
getPeaksAboveIntensityThreshold(double threshold)
Returns an array containing the intensity of all peak above the provided
threshold.
|
java.util.HashMap<java.lang.Double,Peak> |
getRecalibratedPeakList(java.util.HashMap<java.lang.Double,java.lang.Double> mzCorrections)
Returns a recalibrated peak list.
|
java.lang.String |
getScanNumber()
Getter for the scan number.
|
double |
getScanStartTime()
Returns the scan start time.
|
static java.lang.String |
getSpectrumFile(java.lang.String spectrumKey)
Convenience method to retrieve the name of a file from the spectrum key.
|
java.lang.String |
getSpectrumKey()
Returns the key of the spectrum.
|
static java.lang.String |
getSpectrumKey(java.lang.String spectrumFile,
java.lang.String spectrumTitle)
Convenience method returning the key for a spectrum.
|
java.lang.String |
getSpectrumTitle()
Returns the spectrum title.
|
static java.lang.String |
getSpectrumTitle(java.lang.String spectrumKey)
Convenience method to retrieve the name of a spectrum from the spectrum
key.
|
java.util.HashMap<java.lang.Double,Peak> |
getSubSpectrum(double mzMin,
double mzMax)
Returns the part of the spectrum contained between mzMin (inclusive) and
mzMax (exclusive) as a peak list
|
double |
getTotalIntensity()
Returns the total intensity of the spectrum.
|
void |
removePeakList()
This method will remove the peak list in order to reduce memory
consumption of the model.
|
void |
setPeakList(java.util.HashMap<java.lang.Double,Peak> peakList)
Sets the peak list.
|
void |
setPeaks(java.util.ArrayList<Peak> peaks)
Set the peaks.
|
void |
setScanNumber(java.lang.String scanNumber)
Setter for the scan number or range.
|
void |
setScanStartTime(double scanStartTime)
Sets the scan start time.
|
void |
setSpectrumTitle(java.lang.String spectrumTitle)
Set the spectrum title.
|
addUrParam, getParameterKey, getUrParam
protected java.lang.String spectrumTitle
protected java.lang.String fileName
protected int level
protected java.util.HashMap<java.lang.Double,Peak> peakList
protected java.lang.String scanNumber
protected double scanStartTime
public static final java.lang.String SPECTRUM_KEY_SPLITTER
public static java.lang.String getSpectrumKey(java.lang.String spectrumFile, java.lang.String spectrumTitle)
spectrumFile
- The spectrum filespectrumTitle
- The spectrum titlepublic static java.lang.String getSpectrumFile(java.lang.String spectrumKey)
spectrumKey
- the spectrum keypublic static java.lang.String getSpectrumTitle(java.lang.String spectrumKey)
spectrumKey
- the spectrum keypublic void setSpectrumTitle(java.lang.String spectrumTitle)
spectrumTitle
- the title to setpublic java.lang.String getSpectrumKey()
public java.lang.String getSpectrumTitle()
public double[][] getJFreePeakList()
public java.util.HashMap<java.lang.Double,Peak> getPeakMap()
public void addPeak(Peak aPeak)
aPeak
- the peak to addpublic void setPeaks(java.util.ArrayList<Peak> peaks)
peaks
- the peaks to setpublic java.lang.String getScanNumber()
public void setScanNumber(java.lang.String scanNumber)
scanNumber
- or rangepublic java.lang.String getFileName()
public int getLevel()
public java.util.Collection<Peak> getPeakList()
public void setPeakList(java.util.HashMap<java.lang.Double,Peak> peakList)
peakList
- HashSet of peaks containing the peaks of the spectrumpublic double getScanStartTime()
public void setScanStartTime(double scanStartTime)
scanStartTime
- the time point when the spectrum was recordedpublic void removePeakList()
public double[] getMzValuesAsArray()
public double[] getIntensityValuesAsArray()
public double[][] getMzAndIntensityAsArray()
public double getTotalIntensity()
public double getMaxIntensity()
public double getMaxMz()
public double getMinMz()
public java.util.ArrayList<java.lang.Double> getPeaksAboveIntensityThreshold(double threshold)
threshold
- the lower thresholdpublic double getIntensityLimit(double intensityLimit)
intensityLimit
- the intensity limit in percent, e.g., 0.75public java.util.HashMap<java.lang.Double,Peak> getRecalibratedPeakList(java.util.HashMap<java.lang.Double,java.lang.Double> mzCorrections) throws java.lang.IllegalArgumentException
mzCorrections
- the m/z corrections to applyjava.lang.IllegalArgumentException
public java.util.HashMap<java.lang.Double,Peak> getDesignaledPeakList(java.util.ArrayList<IonMatch> matches)
matches
- the ion matchespublic java.util.HashMap<java.lang.Double,Peak> getSubSpectrum(double mzMin, double mzMax)
mzMin
- mzMax
- Copyright © 2013. All Rights Reserved.