peakml
Class BackgroundIon<gPeak extends Peak>

java.lang.Object
  extended by peakml.Annotatable
      extended by peakml.IPeak
          extended by peakml.BackgroundIon<gPeak>
All Implemented Interfaces:
java.lang.Iterable<gPeak>

public class BackgroundIon<gPeak extends Peak>
extends IPeak
implements java.lang.Iterable<gPeak>

Implementation of a background ion, useable for all types of mass spectrometry (e.g. not only 2D methods like LC-MS). This class maintains a list of peaks (minimal size of 1 and either Centroid or Profile), which make up the background ion. When a list of Centroid is maintained the background ion is 2D, but if a list of Profile is maintained the background ion is 3D.

The constructor of this class automatically calculates a number of properties, like: mass, intensity and scan out of the peaks associated with the background ion. The calculations are performed with IPeakSet.


Nested Class Summary
 
Nested classes/interfaces inherited from class peakml.IPeak
IPeak.AnnotationAscending, IPeak.AnnotationDescending, IPeak.MatchCompare<Type>, IPeak.RelationCompare<Type>
 
Field Summary
 
Fields inherited from class peakml.IPeak
relationid, sort_intensity_ascending, sort_intensity_descending, sort_mass_ascending, sort_mass_descending, sort_patternid_ascending, sort_patternid_descending, sort_profileid_ascending, sort_profileid_descending, sort_retentiontime_ascending, sort_retentiontime_descending, sort_scanid_ascending, sort_scanid_descending
 
Constructor Summary
BackgroundIon(PeakData<gPeak> peakdata)
           
 
Method Summary
 double getIntensity()
          Retrieves the measured intensity for this peak.
 double getMass()
          Retrieves the mass of this peak.
 double getMaxMass()
          Returns the highest mass of the peaks in this background ion.
 double getMaxRetentionTime()
          Returns the retention time where this background ion ends.
 int getMaxScanID()
          Returns the scan-id where this background ion ends.
 double getMeanIntensity()
          Returns the mean intensity of the peaks in this background ion.
 double getMeanMass()
          Returns the mean mass of the peaks in this background ion.
 int getMeasurementID()
          Returns an optional measurement-id for this peak.
 double getMedianIntensity()
          Returns the median intensity of the peaks in this background ion.
 double getMedianMass()
          Returns the median mass of the peaks in this background ion.
 double getMinMass()
          Returns the lowest mass of the peaks in this background ion.
 double getMinRetentionTime()
          Returns the retention time where this background ion starts.
 int getMinScanID()
          Returns the scan-id where this background ion starts.
 int getPatternID()
          Returns an optional id for the peak.
 PeakData<gPeak> getPeakData()
           
 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.
 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

BackgroundIon

public BackgroundIon(PeakData<gPeak> peakdata)
Method Detail

getPeakData

public PeakData<gPeak> getPeakData()

getMass

public double getMass()
Description copied from class: IPeak
Retrieves the mass of this peak. For a single peak implementation this would be the real mass, but for a chromatographic peak for example this would consist of the mean of a cluster of peaks.

Specified by:
getMass in class IPeak
Returns:
The mass of the peak.

setMass

public void setMass(double mass)
Description copied from class: IPeak
Sets the mass of this peak, for more information on mass see IPeak.getMass(). It is possible that the class implementing this interface does not support this method.

Specified by:
setMass in class IPeak
Parameters:
mass - The new mass for this peak.

getIntensity

public double getIntensity()
Description copied from class: IPeak
Retrieves the measured intensity for this peak. For a single peak implementation this would be the real measured intensity, but for a chromatographic peak for example this would consist of the mean measured intensity for a cluster of peaks.

Specified by:
getIntensity in class IPeak
Returns:
The measured intensity of the peak.

setIntensity

public void setIntensity(double intensity)
Description copied from class: IPeak
Sets the intensity of this peak, for more information on mass see IPeak.getIntensity(). It is possible that the class implementing this interface does not support this method.

Specified by:
setIntensity in class IPeak
Parameters:
intensity - The new intensity for this peak.

getScanID

public int getScanID()
Description copied from class: IPeak
Retrieves the scan-id for this peak. For a single peak implementation this would be the scan at which it was measured, but for a chromatographic peak for example this would be the scan with the most intense peak.

Specified by:
getScanID in class IPeak
Returns:
The scan at which the peak was measured.

setScanID

public void setScanID(int scan)
Description copied from class: IPeak
Sets the scan-id for this peak, for more information on scan-id see IPeak.getScanID(). It is possible that the class implementing this interface does not support this method.

Specified by:
setScanID in class IPeak
Parameters:
scan - The new scan for this peak.

getRetentionTime

public double getRetentionTime()
Description copied from class: IPeak
Retrieves the retention time for this peak. The retention time is closely linked to the scan-id, which is the index or order at which a particular measurement was made. The time is expressed in seconds (all parsers make sure the time-value stored in a file is converted to this convention) and can easily be converted into minutes and seconds with:
 double rt = peak.getRetentionTime();
 int minutes = (int) (rt / 60);
 int seconds = (int) (rt % 60);
 

Specified by:
getRetentionTime in class IPeak
Returns:
The retention time at which the peak was measured.

setRetentionTime

public void setRetentionTime(double retentiontime)
Description copied from class: IPeak
Sets the retention time for this peak, for more information on retention time see IPeak.setRetentionTime(double). It is possible that the class implementing this interface does not support this method.

Specified by:
setRetentionTime in class IPeak
Parameters:
retentiontime - The new retention time for this peak.

getMeasurementID

public int getMeasurementID()
Description copied from class: IPeak
Returns an optional measurement-id for this peak. This is a convenience mechanism for locating the measurement-information for this peak in the Header.

Specified by:
getMeasurementID in class IPeak
Returns:
The profile-id of this peak.

setMeasurementID

public void setMeasurementID(int id)
Description copied from class: IPeak
Sets the profile-id of this peak, for more information on mass see IPeak.getMeasurementID(). It is possible that the class implementing this interface does not support this method.

Specified by:
setMeasurementID in class IPeak
Parameters:
id - The new profile-id for this peak.

getPatternID

public int getPatternID()
Description copied from class: IPeak
Returns an optional id for the peak. This id can for example be used for peak sequence identification. Beware that this mechanism is highly volatile and can only be used in a single-threaded environment within a strictly controlled environment like a single function or a completely controlled application.

Specified by:
getPatternID in class IPeak
Returns:
The id of this peak.

setPatternID

public void setPatternID(int id)
Description copied from class: IPeak
Sets the pattern-id of this peak, for more information on mass see IPeak.getPatternID(). It is possible that the class implementing this interface does not support this method.

Specified by:
setPatternID in class IPeak
Parameters:
id - The new id for this peaks

getSignal

public Signal getSignal()
Description copied from class: IPeak
Calculates the signal for this IPeak object. For a single data-point this will be a signal of one element. For a collection of IPeaks it will be a compounded version.

Specified by:
getSignal in class IPeak
Returns:
The calculated signal.

getMinScanID

public int getMinScanID()
Returns the scan-id where this background ion starts. This property is calculated by IPeakSet.getMinScanID().

Returns:
The minimum scan-id.

getMaxScanID

public int getMaxScanID()
Returns the scan-id where this background ion ends. This property is calculated by IPeakSet.getMaxScanID().

Returns:
The maximum scan-id.

getMinRetentionTime

public double getMinRetentionTime()
Returns the retention time where this background ion starts. This property is calculated by IPeakSet.getMinRetentionTime().

Returns:
The minimum retention time.

getMaxRetentionTime

public double getMaxRetentionTime()
Returns the retention time where this background ion ends. This property is calculated by IPeakSet.getMaxRetentionTime().

Returns:
The maximum retention time.

getMinMass

public double getMinMass()
Returns the lowest mass of the peaks in this background ion. This property is calculated by IPeakSet.getMinMass().

Returns:
The minimum mass.

getMaxMass

public double getMaxMass()
Returns the highest mass of the peaks in this background ion. This property is calculated by IPeakSet.getMaxMass().

Returns:
The maximum mass.

getMeanMass

public double getMeanMass()
Returns the mean mass of the peaks in this background ion. This property is calculated by IPeakSet.getMeanMass().

Returns:
The mean mass.

getMedianMass

public double getMedianMass()
Returns the median mass of the peaks in this background ion. This property is calculated by IPeakSet.getMedianMass().

Returns:
The median mass.

getMeanIntensity

public double getMeanIntensity()
Returns the mean intensity of the peaks in this background ion. This property is calculated by IPeakSet.getMeanIntensity().

Returns:
The mean intensity.

getMedianIntensity

public double getMedianIntensity()
Returns the median intensity of the peaks in this background ion. This property is calculated by IPeakSet#getMedianRelativeIntensity().

Returns:
The median intensity.

iterator

public java.util.Iterator<gPeak> iterator()
Specified by:
iterator in interface java.lang.Iterable<gPeak extends Peak>