|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object peakml.Annotatable peakml.IPeak peakml.Spectrum<gPeak>
gPeak
- The type of peak stored in the spectrum, either Centroid
or Profile
.public class Spectrum<gPeak extends Peak>
Type-binding for a spectrum (a single measurement on a mass spectrometer). It's
simply an extension of IPeakSet
, which contains all the needed functionality
already but has not been made specific. In the implementation of this class
the only types that are allowed are those that inherit from Peak
.
Nested Class Summary | |
---|---|
static class |
Spectrum.DataFormat
The format (centroid or profile) of the data |
static class |
Spectrum.Type
The type of data stored in the spectrum. |
Nested classes/interfaces inherited from class peakml.IPeak |
---|
IPeak.AnnotationAscending, IPeak.AnnotationDescending, IPeak.MatchCompare<Type>, IPeak.RelationCompare<Type> |
Field Summary |
---|
Constructor Summary | |
---|---|
Spectrum(PeakData<gPeak> peakdata)
Calls the constructor Spectrum(PeakData, Type, Polarity, double) and assumes
for type Spectrum.Type.MS1 , for polarity Polarity.NEUTRAL and for precursormass -1. |
|
Spectrum(PeakData<gPeak> peakdata,
Polarity polarity)
Calls the constructor Spectrum(PeakData, Type, Polarity, double) and assumes
for type Spectrum.Type.MS1 and for precursormass -1. |
|
Spectrum(PeakData<gPeak> peakdata,
Spectrum.Type type,
Polarity polarity)
Calls the constructor Spectrum(PeakData, Type, Polarity, double) and assumes
for precursor mass -1. |
|
Spectrum(PeakData<gPeak> peakdata,
Spectrum.Type type,
Polarity polarity,
double precursormass)
Standard constructor for the spectrum. |
Method Summary | |
---|---|
void |
addMSnSpectrum(Spectrum<gPeak> spectrum)
Adds the given MSn spectrum to the list. |
double |
getIntensity()
Retrieves the measured intensity for this peak. |
double |
getMass()
Retrieves the mass of this peak. |
int |
getMeasurementID()
Returns an optional measurement-id for this peak. |
Spectrum<gPeak> |
getMSnSpectrum(int index)
Returns the MSn spectrum at the given index. |
int |
getNrMSnSpecra()
Returns the number of MSn spectra associated with this spectrum. |
int |
getNrPeaks()
Returns the number of peaks associated to this spectrum. |
int |
getPatternID()
Returns an optional id for the peak. |
PeakData<gPeak> |
getPeakData()
Returns the PeakData container associated to this spectrum. |
java.util.Vector<gPeak> |
getPeaks()
Returns a vector with all the peaks. |
Polarity |
getPolarity()
Returns the polarity of the data in the spectrum. |
double |
getRetentionTime()
Retrieves the retention time for this peak. |
int |
getScanID()
Retrieves the scan-id for this peak. |
Signal |
getSignal()
Calculates the signal for this IPeak object. |
Spectrum.Type |
getType()
Returns the type of the spectrum. |
java.util.Iterator<gPeak> |
iterator()
|
void |
setIntensity(double intensity)
Sets the intensity of this peak, for more information on mass see IPeak.getIntensity() . |
void |
setMass(double mass)
Sets the mass of this peak, for more information on mass see IPeak.getMass() . |
void |
setMeasurementID(int id)
Sets the profile-id of this peak, for more information on mass see IPeak.getMeasurementID() . |
void |
setPatternID(int id)
Sets the pattern-id of this peak, for more information on mass see IPeak.getPatternID() . |
void |
setRetentionTime(double retentiontime)
Sets the retention time for this peak, for more information on retention time see IPeak.setRetentionTime(double) . |
void |
setScanID(int scan)
Sets the scan-id for this peak, for more information on scan-id see IPeak.getScanID() . |
Methods inherited from class peakml.IPeak |
---|
findRelatedPeaks, getBestPeakOnMass, getBestPeakOnRT, match, match, peaksOfMeasurements, sha1, unpack |
Methods inherited from class peakml.Annotatable |
---|
addAnnotation, addAnnotation, addAnnotation, addAnnotation, addAnnotation, addAnnotations, getAnnotation, getAnnotations, removeAllAnnotations, removeAnnotation |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Spectrum(PeakData<gPeak> peakdata)
Spectrum(PeakData, Type, Polarity, double)
and assumes
for type Spectrum.Type.MS1
, for polarity Polarity.NEUTRAL
and for precursormass -1.
peakdata
- The PeakData
instance containing the data of this spectrum.public Spectrum(PeakData<gPeak> peakdata, Polarity polarity)
Spectrum(PeakData, Type, Polarity, double)
and assumes
for type Spectrum.Type.MS1
and for precursormass -1.
peakdata
- The PeakData
instance containing the data of this spectrum.polarity
- The polarity of the measurement (positive, negative, neutral).public Spectrum(PeakData<gPeak> peakdata, Spectrum.Type type, Polarity polarity)
Spectrum(PeakData, Type, Polarity, double)
and assumes
for precursor mass -1.
peakdata
- The PeakData
instance containing the data of this spectrum.type
- The type of spectrum (ms, msn, pda)polarity
- The polarity of the measurement (positive, negative, neutral).public Spectrum(PeakData<gPeak> peakdata, Spectrum.Type type, Polarity polarity, double precursormass)
IPeakSet.IPeakSet(List)
. When the spectrum is made up of profile data,
the peak selection must already have been performed and all the data-points making
up a peak in the spectrum have been stored within the Profile
class.
peakdata
- The PeakData
instance containing the data of this spectrum.type
- The type of spectrum (ms, msn, pda)polarity
- The polarity of the measurement (positive, negative, neutral).precursormass
- The precursor mass, only valid if type is Spectrum.Type.MSn
.Method Detail |
---|
public Spectrum.Type getType()
public Polarity getPolarity()
public int getNrPeaks()
public int getNrMSnSpecra()
public Spectrum<gPeak> getMSnSpectrum(int index) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
- Thrown when the index is out of bounds.public void addMSnSpectrum(Spectrum<gPeak> spectrum)
spectrum
- The MSn spectrum to be added.public java.util.Vector<gPeak> getPeaks()
public PeakData<gPeak> getPeakData()
PeakData
container associated to this spectrum.
public double getRetentionTime()
IPeak
double rt = peak.getRetentionTime(); int minutes = (int) (rt / 60); int seconds = (int) (rt % 60);
getRetentionTime
in class IPeak
public void setRetentionTime(double retentiontime)
IPeak
IPeak.setRetentionTime(double)
. It is possible that the class
implementing this interface does not support this method.
setRetentionTime
in class IPeak
retentiontime
- The new retention time for this peak.public int getScanID()
IPeak
getScanID
in class IPeak
public void setScanID(int scan)
IPeak
IPeak.getScanID()
. It is possible that the class implementing this
interface does not support this method.
setScanID
in class IPeak
scan
- The new scan for this peak.public double getIntensity()
IPeak
getIntensity
in class IPeak
public void setIntensity(double intensity)
IPeak
IPeak.getIntensity()
. It is possible that the class implementing this interface
does not support this method.
setIntensity
in class IPeak
intensity
- The new intensity for this peak.public double getMass()
IPeak
getMass
in class IPeak
public void setMass(double mass)
IPeak
IPeak.getMass()
. It is possible that the class implementing this interface
does not support this method.
setMass
in class IPeak
mass
- The new mass for this peak.public int getMeasurementID()
IPeak
Header
.
getMeasurementID
in class IPeak
public void setMeasurementID(int id)
IPeak
IPeak.getMeasurementID()
. It is possible that the class implementing this
interface does not support this method.
setMeasurementID
in class IPeak
id
- The new profile-id for this peak.public int getPatternID()
IPeak
getPatternID
in class IPeak
public void setPatternID(int id)
IPeak
IPeak.getPatternID()
. It is possible that the class implementing this
interface does not support this method.
setPatternID
in class IPeak
id
- The new id for this peakspublic Signal getSignal()
IPeak
getSignal
in class IPeak
public java.util.Iterator<gPeak> iterator()
iterator
in interface java.lang.Iterable<gPeak extends Peak>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |