Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Protected Member Functions | Protected Attributes | List of all members
IsotopeDistribution Class Reference

Isotope distribution class. More...

#include <OpenMS/CHEMISTRY/IsotopeDistribution.h>

Public Types

typedefs
typedef std::vector< std::pair< Size, double > > ContainerType
 container type, first holds the weight of the isotope, second the probability More...
 
typedef ContainerType::iterator iterator
 
typedef ContainerType::iterator Iterator
 
typedef ContainerType::const_iterator const_iterator
 
typedef ContainerType::const_iterator ConstIterator
 

Public Member Functions

Constructors and Destructors
 IsotopeDistribution ()
 
 IsotopeDistribution (Size max_isotope)
 Detailed constructor which sets the max_isotope. More...
 
 IsotopeDistribution (const IsotopeDistribution &isotope_distribution)
 Copy constructor. More...
 
virtual ~IsotopeDistribution ()
 Destructor. More...
 
Accessors
void setMaxIsotope (Size max_isotope)
 sets the maximal isotope with max_isotope More...
 
Size getMaxIsotope () const
 returns the currently set maximum isotope More...
 
void set (const ContainerType &distribution)
 overwrites the container which holds the distribution using distribution More...
 
const ContainerTypegetContainer () const
 returns the container which holds the distribution More...
 
Size getMax () const
 returns the maximal weight isotope which is stored in the distribution More...
 
Size getMin () const
 returns the minimal weight isotope which is stored in the distribution More...
 
Size size () const
 returns the size of the distribution which is the number of isotopes in the distribution More...
 
void clear ()
 clears the distribution and resets max isotope to 0 More...
 
void estimateFromPeptideWeight (double average_weight)
 Estimate Peptide Isotopedistribution from weight and number of isotopes that should be reported. More...
 
void renormalize ()
 re-normalizes the sum of the probabilities of the isotopes to 1 More...
 
void trimRight (double cutoff)
 Trims the right side of the isotope distribution to isotopes with a significant contribution. More...
 
void trimLeft (double cutoff)
 Trims the left side of the isotope distribution to isotopes with a significant contribution. More...
 
Operators
IsotopeDistributionoperator= (const IsotopeDistribution &isotope_distribution)
 Assignment operator. More...
 
IsotopeDistribution operator+ (const IsotopeDistribution &isotope_distribution) const
 operator which adds this distribution and the isotope_distribution to return IsotopeDisribution (similar to convolve distributions) More...
 
IsotopeDistributionoperator+= (const IsotopeDistribution &isotope_distribution)
 operator which adds isotope_distribution to this (similar to convolve distributions) More...
 
IsotopeDistribution operator* (Size factor) const
 operator which multiplies this distribution by factor (similar to factor times applying operator '+') More...
 
IsotopeDistributionoperator*= (Size factor)
 operator which multiplies this distribution by factor (similar to factor times applying operator '+=') More...
 
bool operator== (const IsotopeDistribution &isotope_distribution) const
 equality operator, returns true if the isotope_distribution is identical to this, false else More...
 
bool operator!= (const IsotopeDistribution &isotope_distribution) const
 inequality operator, returns true if the isotope_distribution differs from this, false else More...
 
Iterators
Iterator begin ()
 
Iterator end ()
 
ConstIterator begin () const
 
ConstIterator end () const
 

Protected Member Functions

void convolve_ (ContainerType &result, const ContainerType &left, const ContainerType &right) const
 convolves the distributions left and right and stores the result in result More...
 
void convolvePow_ (ContainerType &result, const ContainerType &input, Size factor) const
 convolves the distribution input factor times and stores the result in result More...
 
void convolveSquare_ (ContainerType &result, const ContainerType &input) const
 convolves the distribution input with itself and stores the result in result More...
 

Protected Attributes

Size max_isotope_
 maximal isotopes which is used to calculate the distribution More...
 
ContainerType distribution_
 stores the isotope distribution More...
 

Detailed Description

Isotope distribution class.

Holds an isotope distribution with the weight value and according probability. Distribution can be add using the '+' or '+=' operators.

The most important value which should be set is the max isotope value. This value can be set using the setMaxIsotope method. It is an upper bound for the number of isotopes which are calculated. E.g. if it is set to 3, only the first three isotopes, Monoisotopic mass, +1 and +2 are calculated. By default all possible isotopes are calculated, which leads to a large number of values, if the mass value is large!

Member Typedef Documentation

typedef ContainerType::const_iterator const_iterator
typedef ContainerType::const_iterator ConstIterator
typedef std::vector<std::pair<Size, double> > ContainerType

container type, first holds the weight of the isotope, second the probability

typedef ContainerType::iterator iterator
typedef ContainerType::iterator Iterator

Constructor & Destructor Documentation

Default constructor, note max_isotope must be set later

See also
setMaxIsotope(Size max_isotope)
IsotopeDistribution ( Size  max_isotope)
explicit

Detailed constructor which sets the max_isotope.

IsotopeDistribution ( const IsotopeDistribution isotope_distribution)

Copy constructor.

virtual ~IsotopeDistribution ( )
virtual

Destructor.

Member Function Documentation

Iterator begin ( )
inline
ConstIterator begin ( ) const
inline
void clear ( )

clears the distribution and resets max isotope to 0

void convolve_ ( ContainerType result,
const ContainerType left,
const ContainerType right 
) const
protected

convolves the distributions left and right and stores the result in result

void convolvePow_ ( ContainerType result,
const ContainerType input,
Size  factor 
) const
protected

convolves the distribution input factor times and stores the result in result

void convolveSquare_ ( ContainerType result,
const ContainerType input 
) const
protected

convolves the distribution input with itself and stores the result in result

Iterator end ( )
inline
ConstIterator end ( ) const
inline
void estimateFromPeptideWeight ( double  average_weight)

Estimate Peptide Isotopedistribution from weight and number of isotopes that should be reported.

Implementation using the averagine model proposed by Senko et al. in "Determination of Monoisotopic Masses and Ion Populations for Large Biomolecules from Resolved Isotopic Distributions"

Referenced by IsotopeMarker::apply(), TOPPMetaProSIP::calculateCorrelation(), MetaProSIPDecomposition::calculateIsotopePatternsFor13CRangeOfAveraginePeptide(), and MetaProSIPDecomposition::calculateIsotopePatternsFor15NRangeOfAveraginePeptide().

const ContainerType& getContainer ( ) const
Size getMax ( ) const

returns the maximal weight isotope which is stored in the distribution

Size getMaxIsotope ( ) const

returns the currently set maximum isotope

Size getMin ( ) const

returns the minimal weight isotope which is stored in the distribution

bool operator!= ( const IsotopeDistribution isotope_distribution) const

inequality operator, returns true if the isotope_distribution differs from this, false else

IsotopeDistribution operator* ( Size  factor) const

operator which multiplies this distribution by factor (similar to factor times applying operator '+')

IsotopeDistribution& operator*= ( Size  factor)

operator which multiplies this distribution by factor (similar to factor times applying operator '+=')

IsotopeDistribution operator+ ( const IsotopeDistribution isotope_distribution) const

operator which adds this distribution and the isotope_distribution to return IsotopeDisribution (similar to convolve distributions)

IsotopeDistribution& operator+= ( const IsotopeDistribution isotope_distribution)

operator which adds isotope_distribution to this (similar to convolve distributions)

IsotopeDistribution& operator= ( const IsotopeDistribution isotope_distribution)

Assignment operator.

bool operator== ( const IsotopeDistribution isotope_distribution) const

equality operator, returns true if the isotope_distribution is identical to this, false else

void renormalize ( )

re-normalizes the sum of the probabilities of the isotopes to 1

The re-normalisation is needed as in distributions with a lot of isotopes (and with high max isotope) the calculations tend to be inexact.

void set ( const ContainerType distribution)
void setMaxIsotope ( Size  max_isotope)

sets the maximal isotope with max_isotope

sets the maximal isotope which is included in the distribution and used to limit the calculations. This is useful as distributions with numerous isotopes tend to have a lot of numerical zeros at the end

Size size ( ) const

returns the size of the distribution which is the number of isotopes in the distribution

void trimLeft ( double  cutoff)

Trims the left side of the isotope distribution to isotopes with a significant contribution.

If the isotope distribution is calculated for large masses (and with high max isotope) it might happen that many entries contain only small numbers. This function can be used to remove these entries.

Do consider normalising the distribution afterwards.

void trimRight ( double  cutoff)

Trims the right side of the isotope distribution to isotopes with a significant contribution.

If the isotope distribution is calculated for large masses (and with high max isotope) it might happen that many entries contain only small numbers. This function can be used to remove these entries.

Do consider normalising the distribution afterwards.

Member Data Documentation

ContainerType distribution_
protected

stores the isotope distribution

Size max_isotope_
protected

maximal isotopes which is used to calculate the distribution


OpenMS / TOPP release 2.0.0 Documentation generated on Tue Aug 25 2015 05:54:02 using doxygen 1.8.9.1