OpenMS  2.7.0
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
IMSIsotopeDistribution Class Reference

Represents a distribution of isotopes restricted to the first K elements. More...

#include <OpenMS/CHEMISTRY/MASSDECOMPOSITION/IMS/IMSIsotopeDistribution.h>

Collaboration diagram for IMSIsotopeDistribution:
[legend]

Classes

struct  Peak
 Structure that represents an isotope peak - pair of mass and abundance. More...
 

Public Types

typedef double mass_type
 Type of isotope mass. More...
 
typedef double abundance_type
 Type of isotope abundance. More...
 
typedef unsigned int nominal_mass_type
 Type of isotope nominal mass. More...
 
typedef Peak peak_type
 Type of isotope peak. More...
 
typedef std::vector< peak_typepeaks_container
 Type of container to store peaks. More...
 
typedef peaks_container::iterator peaks_iterator
 Type of iterator over container with peaks. More...
 
typedef peaks_container::const_iterator const_peaks_iterator
 Type of const iterator over container with peaks. More...
 
typedef peaks_container::size_type size_type
 Type of peaks container's size. More...
 
typedef std::vector< mass_typemasses_container
 Type of container with isotope masses. More...
 
typedef masses_container::iterator masses_iterator
 Type of iterator over container with isotope masses. More...
 
typedef masses_container::const_iterator const_masses_iterator
 Type of const iterator over container with isotope masses. More...
 
typedef std::vector< abundance_typeabundances_container
 Type of container with isotope abundances. More...
 
typedef abundances_container::iterator abundances_iterator
 Type of iterator over container with isotope abundances. More...
 
typedef abundances_container::const_iterator const_abundances_iterator
 Type of const iterator over container with isotope abundances. More...
 

Public Member Functions

 IMSIsotopeDistribution (nominal_mass_type nominalMass=0)
 Constructor with nominal mass. More...
 
 IMSIsotopeDistribution (mass_type mass)
 Constructor with single isotope. More...
 
 IMSIsotopeDistribution (const peaks_container &peaks, nominal_mass_type nominalMass=0)
 Constructor with isotopes and nominal mass. More...
 
 IMSIsotopeDistribution (const IMSIsotopeDistribution &distribution)
 Copy constructor. More...
 
 ~IMSIsotopeDistribution ()
 Destructor. More...
 
size_type size () const
 
IMSIsotopeDistributionoperator= (const IMSIsotopeDistribution &distribution)
 
bool operator== (const IMSIsotopeDistribution &distribution) const
 
bool operator!= (const IMSIsotopeDistribution &distribution) const
 
IMSIsotopeDistributionoperator*= (const IMSIsotopeDistribution &distribution)
 
IMSIsotopeDistributionoperator*= (unsigned int pow)
 
mass_type getMass (size_type i) const
 
abundance_type getAbundance (size_type i) const
 
mass_type getAverageMass () const
 
nominal_mass_type getNominalMass () const
 
void setNominalMass (nominal_mass_type nominalMass)
 
masses_container getMasses () const
 
abundances_container getAbundances () const
 
void normalize ()
 
bool empty () const
 

Static Public Attributes

static abundance_type ABUNDANCES_SUM_ERROR
 Error to be allowed for isotope distribution. More...
 
static size_type SIZE
 Length of isotope distribution. More...
 

Private Member Functions

void setMinimumSize_ ()
 Sets peaks/isotopes container minimum size. More...
 

Private Attributes

peaks_container peaks_
 Container for isotopes. More...
 
nominal_mass_type nominal_mass_
 Nominal mass of distribution. More...
 

Detailed Description

Represents a distribution of isotopes restricted to the first K elements.

Represents a distribution of isotopes of chemical elements as a list of peaks each as a pair of mass and abundance. IsotopeDistribution unlike IsotopeSpecies has one abundance per a nominal mass. Here is an example in the format (mass; abundance %) for molecule H2O (values are taken randomly):

To the sake of faster computations distribution is restricted to the first K elements, where K can be set by adjusting size SIZE of distribution.

Note
For the elements most abundant in living beings (CHNOPS) this restriction is negligible, since abundances decrease dramatically in isotopes order and are usually of no interest starting from +10 isotope.

IsotopeDistribution implements folding with other distribution using an algorithm described in details in paper: Boecker et al. "Decomposing metabolic isotope patterns" WABI 2006. doi: 10.1007/11851561_2

Folding with itself is done using Russian Multiplication Scheme.

Author
Anton Pervukhin Anton.nosp@m..Per.nosp@m.vukhi.nosp@m.n@Ce.nosp@m.BiTec.nosp@m..Uni.nosp@m.-Biel.nosp@m.efel.nosp@m.d.DE

Member Typedef Documentation

◆ abundance_type

typedef double abundance_type

Type of isotope abundance.

◆ abundances_container

typedef std::vector<abundance_type> abundances_container

Type of container with isotope abundances.

◆ abundances_iterator

typedef abundances_container::iterator abundances_iterator

Type of iterator over container with isotope abundances.

◆ const_abundances_iterator

typedef abundances_container::const_iterator const_abundances_iterator

Type of const iterator over container with isotope abundances.

◆ const_masses_iterator

typedef masses_container::const_iterator const_masses_iterator

Type of const iterator over container with isotope masses.

◆ const_peaks_iterator

typedef peaks_container::const_iterator const_peaks_iterator

Type of const iterator over container with peaks.

◆ mass_type

typedef double mass_type

Type of isotope mass.

◆ masses_container

typedef std::vector<mass_type> masses_container

Type of container with isotope masses.

◆ masses_iterator

typedef masses_container::iterator masses_iterator

Type of iterator over container with isotope masses.

◆ nominal_mass_type

typedef unsigned int nominal_mass_type

Type of isotope nominal mass.

◆ peak_type

typedef Peak peak_type

Type of isotope peak.

◆ peaks_container

typedef std::vector<peak_type> peaks_container

Type of container to store peaks.

◆ peaks_iterator

typedef peaks_container::iterator peaks_iterator

Type of iterator over container with peaks.

◆ size_type

typedef peaks_container::size_type size_type

Type of peaks container's size.

Constructor & Destructor Documentation

◆ IMSIsotopeDistribution() [1/4]

IMSIsotopeDistribution ( nominal_mass_type  nominalMass = 0)
inlineexplicit

Constructor with nominal mass.

◆ IMSIsotopeDistribution() [2/4]

IMSIsotopeDistribution ( mass_type  mass)
inlineexplicit

Constructor with single isotope.

◆ IMSIsotopeDistribution() [3/4]

IMSIsotopeDistribution ( const peaks_container peaks,
nominal_mass_type  nominalMass = 0 
)
inline

Constructor with isotopes and nominal mass.

◆ IMSIsotopeDistribution() [4/4]

IMSIsotopeDistribution ( const IMSIsotopeDistribution distribution)
inline

Copy constructor.

◆ ~IMSIsotopeDistribution()

Destructor.

Member Function Documentation

◆ empty()

bool empty ( ) const
inline

Returns true if the distribution has no peaks, false - otherwise.

Returns
True if the distribution has no peaks, false - otherwise.

◆ getAbundance()

abundance_type getAbundance ( size_type  i) const
inline

Gets an abundance of isotope i.

Parameters
iAn index of isotope.
Returns
An abundance of isotope i.

◆ getAbundances()

abundances_container getAbundances ( ) const

Gets abundances of isotopes.

Returns
Abundances of isotopes.

◆ getAverageMass()

mass_type getAverageMass ( ) const

Gets an average mass of all isotopes.

Returns
An average mass of all isotopes.

◆ getMass()

mass_type getMass ( size_type  i) const
inline

Gets a mass of isotope i.

Parameters
iAn index of isotope.
Returns
Mass of isotope i.

◆ getMasses()

masses_container getMasses ( ) const

Gets masses of isotopes.

Returns
Masses of isotopes.

◆ getNominalMass()

nominal_mass_type getNominalMass ( ) const
inline

Gets a nominal mass of distribution.

Returns
The nominal mass of the distribution.

◆ normalize()

void normalize ( )

Normalizes distribution, i.e. scaling abundances to be summed up to 1 with an error ABUNDANCES_SUM_ERROR allowed.

◆ operator!=()

bool operator!= ( const IMSIsotopeDistribution distribution) const

Inequality operator. Returns true, if a given distribution is unequal to this one, false - otherwise.

Returns
true, if a given distribution is unequal to this distribution, false - otherwise

◆ operator*=() [1/2]

IMSIsotopeDistribution& operator*= ( const IMSIsotopeDistribution distribution)

Operator for folding this distribution with a given distribution.

Note
Operator is unary, so result is stored in this object itself.
Parameters
distributionDistribution to be folded with this one.
Returns
Reference to this object.
See also
IsotopeDistribution& operator *=(unsigned int)

◆ operator*=() [2/2]

IMSIsotopeDistribution& operator*= ( unsigned int  pow)

Operator for folding this distribution with itself pow times.

Note
Operator is unary, so result is stored in this object itself.
Parameters
powNumber of times this distribution is to be folded with itself.
Returns
Reference to this object.
See also
IsotopeDistribution& operator *=(const IsotopeDistribution&)

◆ operator=()

IMSIsotopeDistribution& operator= ( const IMSIsotopeDistribution distribution)

Assignment operator.

Parameters
distributionIsotope distribution to be assigned to this one.
Returns
Reference to this object.

◆ operator==()

bool operator== ( const IMSIsotopeDistribution distribution) const

Equality operator. Returns true, if a given distribution is equal to this one, false - otherwise.

Returns
true, if a given distribution is equal to this distribution, false - otherwise

◆ setMinimumSize_()

void setMinimumSize_ ( )
private

Sets peaks/isotopes container minimum size.

◆ setNominalMass()

void setNominalMass ( nominal_mass_type  nominalMass)
inline

Sets a nominal mass for distribution.

Parameters
nominalMassThe new nominal mass for the distribution.

◆ size()

size_type size ( ) const
inline

Gets size of isotope distribution.

Note
Size is not smaller than predefined SIZE.
Returns
Size of isotope distribution.

Member Data Documentation

◆ ABUNDANCES_SUM_ERROR

abundance_type ABUNDANCES_SUM_ERROR
static

Error to be allowed for isotope distribution.

◆ nominal_mass_

nominal_mass_type nominal_mass_
private

Nominal mass of distribution.

◆ peaks_

peaks_container peaks_
private

Container for isotopes.

◆ SIZE

size_type SIZE
static

Length of isotope distribution.