Last update: 2011-06-23

org.proteios.core
Class PeakList

java.lang.Object
  extended by org.proteios.core.BasicItem<D>
      extended by org.proteios.core.OwnedItem<D>
          extended by org.proteios.core.SharedItem<D>
              extended by org.proteios.core.CommonItem<D>
                  extended by org.proteios.core.AnnotatedItem<PeakListData>
                      extended by org.proteios.core.PeakList
All Implemented Interfaces:
Comparable<PeakList>, AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Removable, Shareable

public class PeakList
extends AnnotatedItem<PeakListData>
implements Comparable<PeakList>

This class represent peaklist items. A peaklist has information about the peaks in an experiment.

Version:
2.0
Author:
Olle
Last modified
$Date: 2006-06-01 12:33:12Z $

Field Summary
static int MAX_COMBINATIONMETHOD_LENGTH
          The maximum length of the combinationMethod string that can be stored in the database.
static int MAX_DESCRIPTION_LENGTH
          The maximum length of the description string that can be stored in the database.
static Item TYPE
          The type of item represented by this class.
 
Fields inherited from interface org.proteios.core.Nameable
MAX_NAME_LENGTH
 
Method Summary
 void addPeak(Peak peak)
           
 Float calculateTotalIntensity()
          Count the total intensity of all peaks in this peaklist
 int compareTo(PeakList p)
           
 Float findBasePeakIntensity()
          Find the most intense peak in this peaklist and return the intensity
 List<Acquisition> getAcquisitionList()
          Get the Acquisition acquisitionList.
 ItemQuery<Acquisition> getAcquisitionsQuery()
          Get a query that returns all Acquisition items created from this peaklist.
 Set<Annotatable> getAnnotatableParents()
          Always null.
 Float getBasePeakIntensity()
          Get the base peak intensity.
static PeakList getById(DbControl dc, int id)
          Get a PeakList item when you know the id.
 String getCombinationMethod()
          Get the combination method of this PeakList.
 String getDescription()
          Get the description of this PeakList.
 int getMsLevel()
          Get the msLevel
 Float getMzRangeStart()
          Get the start of the mzRange.
 Float getMzRangeStop()
          Get the stop of the mzRange.
 List<Peak> getPeakArrayList()
          Get the Peak peakArrayList.
 PeakListSet getPeakListSet()
          Get the PeakListSet this peakList is created from.
 ItemQuery<Peak> getPeaksQuery()
          Get a query that returns all Peak items created from this peaklist.
 List<Precursor> getPrecursorList()
          Get the Precursor precursorList.
 ItemQuery<Precursor> getPrecursorsQuery()
          Get a query that returns all Precursor items created from this peaklist.
static ItemQuery<PeakList> getQuery()
          Get a query that returns peaklist items.
 int getSpectrumId()
          Get the spectrumId
 InstrumentConfiguration getSpectrumInstrument()
          Get the InstrumentConfiguration spectrumInstrument.
 Float getTimeInMinutes()
          Get the time in minutes.
 Float getTotalIntensity()
          Get the total peak intensity.
 Item getType()
          Get the type of item represented by the object.
 boolean isIntensityDoublePrecision()
          Get the intensityDoublePrecision flag
 boolean isMonoisotopic()
          Get the monoisotopic flag
 boolean isMzDoublePrecision()
          Get the mzDoublePrecision flag
 boolean isUsed()
          Check that: no item has been created from this peaklist
 void setAcquisitionList(List<Acquisition> acquisitionList)
          Set the Acquisition acquisitionList.
 void setBasePeakIntensity(Float basePeakIntensity)
          Set the base peak intensity
 void setCombinationMethod(String combinationMethod)
          Set the combination method for this PeakList item.
 void setDescription(String description)
          Set the description for this PeakList item.
 void setIntensityDoublePrecision(boolean doublePrecision)
          Set the intensityDoublePrecision flag
 void setMonoisotopic(boolean monoisotopic)
          Set the monoisotopic flag
 void setMsLevel(int msLevel)
          Set the msLevel.
 void setMzDoublePrecision(boolean doublePrecision)
          Set the mzDoublePrecision flag
 void setMzRangeStart(Float mzRangeStart)
          Set the start of the mzRange
 void setMzRangeStop(Float mzRangeStop)
          Set the stop of the mzRange
 void setPeakArrayList(List<Peak> peakArrayList)
          Set the Peak peakArrayList.
 void setPeakListSet(PeakListSet peakListSet)
          Set the PeakListSet this peakList is created from.
 void setPrecursorList(List<Precursor> precursorList)
          Set the Precursor precursorList.
 void setSpectrumId(int spectrumId)
          Set the spectrumId.
 void setSpectrumInstrument(InstrumentConfiguration spectrumInstrument)
          Set the InstrumentConfiguration spectrumInstrument.
 void setTimeInMinutes(Float timeInMinutes)
          Set the time in minutes
 void setTotalIntensity(Float totalIntensity)
          Set the total intensity
 
Methods inherited from class org.proteios.core.CommonItem
getName, isRemoved, setName, setRemoved
 
Methods inherited from class org.proteios.core.SharedItem
getItemKey, getProjectKey, isShared, setItemKey, setProjectKey
 
Methods inherited from class org.proteios.core.OwnedItem
getOwner, setOwner
 
Methods inherited from class org.proteios.core.BasicItem
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.proteios.core.Identifiable
getId, getVersion
 
Methods inherited from interface org.proteios.core.AccessControlled
checkPermission, hasPermission
 
Methods inherited from interface org.proteios.core.Ownable
getOwner, setOwner
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
Item.PROTEIOS_PEAKLIST, getType()

MAX_COMBINATIONMETHOD_LENGTH

public static final int MAX_COMBINATIONMETHOD_LENGTH
The maximum length of the combinationMethod string that can be stored in the database.

See Also:
setCombinationMethod(String), Constant Field Values

MAX_DESCRIPTION_LENGTH

public static final int MAX_DESCRIPTION_LENGTH
The maximum length of the description string that can be stored in the database.

See Also:
setDescription(String), Constant Field Values
Method Detail

compareTo

public int compareTo(PeakList p)
Specified by:
compareTo in interface Comparable<PeakList>

getById

public static PeakList getById(DbControl dc,
                               int id)
                        throws ItemNotFoundException,
                               BaseException
Get a PeakList item when you know the id.

Parameters:
dc - The DbControl which will be used for database access.
id - The id of the item to load
Returns:
The PeakList item
Throws:
ItemNotFoundException - If an item with the specified id is not found
BaseException - If there is another error

getQuery

public static ItemQuery<PeakList> getQuery()
Get a query that returns peaklist items.

Returns:
An ItemQuery object.

getType

public Item getType()
Description copied from interface: Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.

Specified by:
getType in interface Identifiable
Returns:
A value indicating the type of item

getAnnotatableParents

public Set<Annotatable> getAnnotatableParents()
                                       throws BaseException
Always null.

Throws:
BaseException

isUsed

public boolean isUsed()
               throws BaseException
Check that:

Specified by:
isUsed in class BasicItem<PeakListData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException

getPeakListSet

public PeakListSet getPeakListSet()
                           throws BaseException
Get the PeakListSet this peakList is created from.

Returns:
The PeakListSet item or null if not known
Throws:
BaseException - If there is another error

setPeakListSet

public void setPeakListSet(PeakListSet peakListSet)
                    throws BaseException
Set the PeakListSet this peakList is created from.

Parameters:
peakListSet - The new PeakListSet item
Throws:
BaseException - If there is another error

getCombinationMethod

public String getCombinationMethod()
Get the combination method of this PeakList.

Returns:
the combination method of this peak list

setCombinationMethod

public void setCombinationMethod(String combinationMethod)
                          throws InvalidDataException
Set the combination method for this PeakList item. The value may be null but must not be longer than the value specified by the MAX_COMBINATIONMETHOD_LENGTH constant.

Parameters:
combinationMethod - The new combination method for this item
Throws:
InvalidDataException - If the combinationMethod is longer than MAX_COMBINATIONMETHOD_LENGTH

getDescription

public String getDescription()
Get the description of this PeakList.

Specified by:
getDescription in interface Nameable
Overrides:
getDescription in class CommonItem<PeakListData>
Returns:
the description of this peak list

setDescription

public void setDescription(String description)
                    throws InvalidDataException
Set the description for this PeakList item. The value may be null but must not be longer than the value specified by the MAX_DESCRIPTION_LENGTH constant.

Specified by:
setDescription in interface Nameable
Overrides:
setDescription in class CommonItem<PeakListData>
Parameters:
description - The new description for this item
Throws:
InvalidDataException - If the description is longer than MAX_DESCRIPTION_LENGTH

isMzDoublePrecision

public boolean isMzDoublePrecision()
Get the mzDoublePrecision flag

Returns:
the mzDoublePrecision flag

setMzDoublePrecision

public void setMzDoublePrecision(boolean doublePrecision)
Set the mzDoublePrecision flag

Parameters:
doublePrecision - The mzDoublePrecision flag

isIntensityDoublePrecision

public boolean isIntensityDoublePrecision()
Get the intensityDoublePrecision flag

Returns:
the intensityDoublePrecision flag

setIntensityDoublePrecision

public void setIntensityDoublePrecision(boolean doublePrecision)
Set the intensityDoublePrecision flag

Parameters:
doublePrecision - The intensityDoublePrecision flag

isMonoisotopic

public boolean isMonoisotopic()
Get the monoisotopic flag

Returns:
the monoisotopic flag

setMonoisotopic

public void setMonoisotopic(boolean monoisotopic)
Set the monoisotopic flag

Parameters:
monoisotopic - The monoisotopic flag

getMsLevel

public int getMsLevel()
Get the msLevel

Returns:
the msLevel value

setMsLevel

public void setMsLevel(int msLevel)
                throws InvalidDataException
Set the msLevel.

Parameters:
msLevel - The msLevel value
Throws:
InvalidDataException - If the msLevel is lower than zero

getTotalIntensity

public Float getTotalIntensity()
Get the total peak intensity. Try to calculate and set it if it was not given TODO: Commit to database and perform checks

Returns:
A Float holding the totalIntensity

calculateTotalIntensity

public Float calculateTotalIntensity()
Count the total intensity of all peaks in this peaklist

Returns:
A Float holding the totalIntensity

setTotalIntensity

public void setTotalIntensity(Float totalIntensity)
                       throws InvalidDataException,
                              BaseException
Set the total intensity

Parameters:
totalIntensity - The totalIntensity value
Throws:
InvalidDataException - If totalIntensity is below zero
BaseException

getBasePeakIntensity

public Float getBasePeakIntensity()
Get the base peak intensity.

Returns:
A Float holding the base peak intensity

setBasePeakIntensity

public void setBasePeakIntensity(Float basePeakIntensity)
                          throws InvalidDataException,
                                 BaseException
Set the base peak intensity

Parameters:
basePeakIntensity - The basePeakIntensity value
Throws:
InvalidDataException - If basePeakIntensity is below zero
BaseException

findBasePeakIntensity

public Float findBasePeakIntensity()
Find the most intense peak in this peaklist and return the intensity

Returns:
A Float holding the intensity

getMzRangeStart

public Float getMzRangeStart()
Get the start of the mzRange.

Returns:
A Float holding the mzRangeStart

setMzRangeStart

public void setMzRangeStart(Float mzRangeStart)
                     throws InvalidDataException,
                            BaseException
Set the start of the mzRange

Parameters:
mzRangeStart - The msRangeStart value
Throws:
InvalidDataException - If mzRangeStart is below zero
BaseException

getMzRangeStop

public Float getMzRangeStop()
Get the stop of the mzRange.

Returns:
A Float holding the mzRangeStop

setMzRangeStop

public void setMzRangeStop(Float mzRangeStop)
                    throws InvalidDataException,
                           BaseException
Set the stop of the mzRange

Parameters:
mzRangeStop - The msRangeStop value
Throws:
InvalidDataException - If mzRangeStop is below zero
BaseException

getSpectrumId

public int getSpectrumId()
Get the spectrumId

Returns:
the spectrumId value

setSpectrumId

public void setSpectrumId(int spectrumId)
Set the spectrumId.

Parameters:
spectrumId - The spectrumId value

getSpectrumInstrument

public InstrumentConfiguration getSpectrumInstrument()
                                              throws BaseException
Get the InstrumentConfiguration spectrumInstrument.

Returns:
An InstrumentConfiguration object
Throws:
BaseException - If there is another error

setSpectrumInstrument

public void setSpectrumInstrument(InstrumentConfiguration spectrumInstrument)
                           throws InvalidDataException
Set the InstrumentConfiguration spectrumInstrument.

Parameters:
spectrumInstrument - The new InstrumentConfiguration item
Throws:
InvalidDataException - If spectrumInstrument is null
BaseException - If there is another error

getTimeInMinutes

public Float getTimeInMinutes()
Get the time in minutes.

Returns:
A Float holding the timeInMinutes

setTimeInMinutes

public void setTimeInMinutes(Float timeInMinutes)
                      throws InvalidDataException,
                             BaseException
Set the time in minutes

Parameters:
timeInMinutes - The timeInMinutes value
Throws:
InvalidDataException - If timeInMinutes is below zero
BaseException

getAcquisitionList

public List<Acquisition> getAcquisitionList()
                                     throws ItemNotFoundException,
                                            BaseException
Get the Acquisition acquisitionList.

Returns:
An Acquisition list object
Throws:
BaseException - If there is another error
ItemNotFoundException

setAcquisitionList

public void setAcquisitionList(List<Acquisition> acquisitionList)
                        throws InvalidDataException
Set the Acquisition acquisitionList.

Parameters:
acquisitionList - The new Acquisition list item
Throws:
BaseException - If there is another error
InvalidDataException

getAcquisitionsQuery

public ItemQuery<Acquisition> getAcquisitionsQuery()
Get a query that returns all Acquisition items created from this peaklist.

Returns:
An ItemQuery object

getPrecursorList

public List<Precursor> getPrecursorList()
                                 throws ItemNotFoundException,
                                        BaseException
Get the Precursor precursorList.

Returns:
A Precursor list object
Throws:
BaseException - If there is another error
ItemNotFoundException

setPrecursorList

public void setPrecursorList(List<Precursor> precursorList)
                      throws InvalidDataException
Set the Precursor precursorList.

Parameters:
precursorList - The new Precursor list item
Throws:
BaseException - If there is another error
InvalidDataException

getPrecursorsQuery

public ItemQuery<Precursor> getPrecursorsQuery()
Get a query that returns all Precursor items created from this peaklist.

Returns:
An ItemQuery object

getPeakArrayList

public List<Peak> getPeakArrayList()
                            throws ItemNotFoundException,
                                   BaseException
Get the Peak peakArrayList.

Returns:
A Peak list object
Throws:
BaseException - If there is another error
ItemNotFoundException

setPeakArrayList

public void setPeakArrayList(List<Peak> peakArrayList)
                      throws InvalidDataException
Set the Peak peakArrayList.

Parameters:
peakArrayList - The new Peak list item
Throws:
BaseException - If there is another error
InvalidDataException

addPeak

public void addPeak(Peak peak)

getPeaksQuery

public ItemQuery<Peak> getPeaksQuery()
Get a query that returns all Peak items created from this peaklist.

Returns:
An ItemQuery object

Last update: 2011-06-23