Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes

Sample Class Reference
[Metadata]

Meta information about the sample. More...

#include <OpenMS/METADATA/Sample.h>

Inheritance diagram for Sample:
MetaInfoInterface

List of all members.

Public Types

enum  SampleState {
  SAMPLENULL, SOLID, LIQUID, GAS,
  SOLUTION, EMULSION, SUSPENSION, SIZE_OF_SAMPLESTATE
}
 

state of aggregation of the sample

More...

Public Member Functions

 Sample ()
 default constructor
 Sample (const Sample &source)
 copy constructor
 ~Sample ()
 desctuctor
Sampleoperator= (const Sample &source)
 assignment operator
bool operator== (const Sample &rhs) const
 Equality operator.
const StringgetName () const
 retuns the sample name (default: "")
void setName (const String &name)
 sets the sample name
const StringgetOrganism () const
 retuns the sample name (default: "")
void setOrganism (const String &organism)
 sets the sample name
const StringgetNumber () const
 returns the sample number (default: "")
void setNumber (const String &number)
 sets the sample number (e.g. sample ID)
const StringgetComment () const
 returns the comment (default: "")
void setComment (const String &comment)
 sets the comment (may contain newline characters)
SampleState getState () const
 returns the state of aggregation (default: SAMPLENULL)
void setState (SampleState state)
 sets the state of aggregation
DoubleReal getMass () const
 returns the mass (in gram) (default: 0.0)
void setMass (DoubleReal mass)
 sets the mass (in gram)
DoubleReal getVolume () const
 returns the volume (in ml) (default: 0.0)
void setVolume (DoubleReal volume)
 sets the volume (in ml)
DoubleReal getConcentration () const
 returns the concentration (in g/l) (default: 0.0)
void setConcentration (DoubleReal concentration)
 sets the concentration (in g/l)
std::vector< Sample > & getSubsamples ()
 returns a mutable reference to the vector of subsamples that were combined to create this sample
const std::vector< Sample > & getSubsamples () const
 returns a const referenct to the vector of subsamples that were combined to create this sample
void setSubsamples (const std::vector< Sample > &subsamples)
 sets the vector of subsamples that were combined to create this sample
void addTreatment (const SampleTreatment &treatment, Int before_position=-1)
 adds a sample treatment before the given postion (default is the end of the list). Sample treatments are ordered in the order of application to the sample. If before_position is smaller than 0, the sample treatment is appended to the list.
SampleTreatmentgetTreatment (UInt position)
 returns a mutable reference to the sample treatment at the given position
const SampleTreatmentgetTreatment (UInt position) const
 returns a const reference to the sample treatment at the given position
void removeTreatment (UInt position)
 removes the sample treatment at the given position
Int countTreatments () const
 returns the number of sample treatments

Static Public Attributes

static const std::string NamesOfSampleState [SIZE_OF_SAMPLESTATE]
 Names of sample states.

Protected Attributes

String name_
String number_
String comment_
String organism_
SampleState state_
DoubleReal mass_
DoubleReal volume_
DoubleReal concentration_
std::vector< Samplesubsamples_
std::list< SampleTreatment * > treatments_

Detailed Description

Meta information about the sample.

It contains basic descriptions like name, number (i.e. order number), mass, volume, concentration, state and a comment.

Additionally sample treatments like Digestion, Modification or Tagging can be added.

A Sample can be composed of other samples.


Member Enumeration Documentation

state of aggregation of the sample

Enumerator:
SAMPLENULL 
SOLID 
LIQUID 
GAS 
SOLUTION 
EMULSION 
SUSPENSION 
SIZE_OF_SAMPLESTATE 

Constructor & Destructor Documentation

Sample (  ) 

default constructor

Sample ( const Sample source  ) 

copy constructor

~Sample (  ) 

desctuctor


Member Function Documentation

void addTreatment ( const SampleTreatment treatment,
Int  before_position = -1 
)

adds a sample treatment before the given postion (default is the end of the list). Sample treatments are ordered in the order of application to the sample. If before_position is smaller than 0, the sample treatment is appended to the list.

Exceptions:
Exception::IndexOverflow is thrown if the position is invalid.
Int countTreatments (  )  const

returns the number of sample treatments

const String& getComment (  )  const

returns the comment (default: "")

Referenced by MzMLHandler< MapType >::writeTo().

DoubleReal getConcentration (  )  const

returns the concentration (in g/l) (default: 0.0)

Referenced by MzMLHandler< MapType >::writeTo(), and MzDataHandler< MapType >::writeTo().

DoubleReal getMass (  )  const

returns the mass (in gram) (default: 0.0)

Referenced by MzMLHandler< MapType >::writeTo(), and MzDataHandler< MapType >::writeTo().

const String& getName (  )  const

retuns the sample name (default: "")

Referenced by MzMLHandler< MapType >::writeTo(), and MzDataHandler< MapType >::writeTo().

const String& getNumber (  )  const

returns the sample number (default: "")

Referenced by MzMLHandler< MapType >::writeTo(), and MzDataHandler< MapType >::writeTo().

const String& getOrganism (  )  const

retuns the sample name (default: "")

SampleState getState (  )  const

returns the state of aggregation (default: SAMPLENULL)

Referenced by MzMLHandler< MapType >::writeTo(), and MzDataHandler< MapType >::writeTo().

std::vector<Sample>& getSubsamples (  ) 

returns a mutable reference to the vector of subsamples that were combined to create this sample

const std::vector<Sample>& getSubsamples (  )  const

returns a const referenct to the vector of subsamples that were combined to create this sample

SampleTreatment& getTreatment ( UInt  position  ) 

returns a mutable reference to the sample treatment at the given position

Exceptions:
Exception::IndexOverflow is thrown if the position is invalid.
const SampleTreatment& getTreatment ( UInt  position  )  const

returns a const reference to the sample treatment at the given position

Exceptions:
Exception::IndexOverflow is thrown if the position is invalid.
DoubleReal getVolume (  )  const

returns the volume (in ml) (default: 0.0)

Referenced by MzMLHandler< MapType >::writeTo(), and MzDataHandler< MapType >::writeTo().

Sample& operator= ( const Sample source  ) 

assignment operator

bool operator== ( const Sample rhs  )  const

Equality operator.

void removeTreatment ( UInt  position  ) 

removes the sample treatment at the given position

Exceptions:
Exception::IndexOverflow is thrown if the position is invalid.
void setComment ( const String comment  ) 

sets the comment (may contain newline characters)

void setConcentration ( DoubleReal  concentration  ) 

sets the concentration (in g/l)

void setMass ( DoubleReal  mass  ) 

sets the mass (in gram)

void setName ( const String name  ) 

sets the sample name

void setNumber ( const String number  ) 

sets the sample number (e.g. sample ID)

void setOrganism ( const String organism  ) 

sets the sample name

void setState ( SampleState  state  ) 

sets the state of aggregation

void setSubsamples ( const std::vector< Sample > &  subsamples  ) 

sets the vector of subsamples that were combined to create this sample

void setVolume ( DoubleReal  volume  ) 

sets the volume (in ml)


Member Data Documentation

String comment_ [protected]
DoubleReal mass_ [protected]
String name_ [protected]
const std::string NamesOfSampleState[SIZE_OF_SAMPLESTATE] [static]

Names of sample states.

String number_ [protected]
String organism_ [protected]
SampleState state_ [protected]
std::vector<Sample> subsamples_ [protected]
std::list<SampleTreatment *> treatments_ [protected]
DoubleReal volume_ [protected]

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:56 using doxygen 1.7.1