|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.massspectrometry.Spectrum
public abstract class Spectrum
This class models a spectrum
Field Summary | |
---|---|
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 timepoint 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 Summary | |
---|---|
Spectrum()
|
Method Summary | |
---|---|
void |
addPeak(Peak aPeak)
Adds a peak to the spectrum peak list. |
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 acending 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.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. |
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 |
setScanNumber(java.lang.String scanNumber)
Setter for the scan number or range. |
void |
setScanStartTime(double scanStartTime)
Sets the scan start time. |
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject |
---|
addUrParam, getParameterKey, getUrParam |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public Spectrum()
Method Detail |
---|
public static java.lang.String getSpectrumKey(java.lang.String spectrumFile, java.lang.String spectrumTitle)
spectrumFile
- The spectrum filespectrumTitle
- The spectrum title
public static java.lang.String getSpectrumFile(java.lang.String spectrumKey)
spectrumKey
- the spectrum key
public static java.lang.String getSpectrumTitle(java.lang.String spectrumKey)
spectrumKey
- the spectrum key
public 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 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 timepoint 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 threshold
public double getIntensityLimit(double intensityLimit)
intensityLimit
- the intensity limit in percent, e.g., 0.75
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |