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

IsotopeDistribution Class Reference
[Chemistry]

Isotope distribution class. More...

#include <OpenMS/CHEMISTRY/IsotopeDistribution.h>

List of all members.

Public Types

typedefs

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
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.
 IsotopeDistribution (const IsotopeDistribution &isotope_distribution)
 Copy constructor.
virtual ~IsotopeDistribution ()
 Destructor.
Accessors

void setMaxIsotope (Size max_isotope)
 sets the maximal isotope with max_isotope
Size getMaxIsotope () const
 returns the currently set maximum isotope
void set (const ContainerType &distribution)
 overwrites the container which holds the distribution using distribution
const ContainerTypegetContainer () const
 returns the container which holds the distribution
Size getMax () const
 returns the maximal weight isotope which is stored in the distribution
Size getMin () const
 returns the minimal weight isotope which is stored in the distribution
Size size () const
 returns the size of the distribtion which is the number of isotopes in the distribution
void clear ()
 clears the distribution and resets max isotope to 0
void estimateFromPeptideWeight (double average_weight)
 Estimate Peptide Isotopedistribution from weight and number of isotopes that should be reported.
void renormalize ()
 renormalizes the sum of the probabilities of the isotopes to 1
void trimRight (DoubleReal cutoff)
 Trims the right side of the isotope distribution to isotopes with a significant contribution.
void trimLeft (DoubleReal cutoff)
 Trims the left side of the isotope distribution to isotopes with a significant contribution.
Operators

IsotopeDistributionoperator= (const IsotopeDistribution &isotope_distribution)
 Assignment operator.
IsotopeDistribution operator+ (const IsotopeDistribution &isotope_distribution) const
 operator which adds this distribution and the isotope_distribution to return IsotopeDisribution (similiar to convolve distributions)
IsotopeDistributionoperator+= (const IsotopeDistribution &isotope_distribution)
 operator which adds isotope_distribution to this (similar to convolve distributions)
IsotopeDistribution operator* (Size factor) const
 operator which multiplies this distribution by factor (similar to factor times applying operator '+')
IsotopeDistributionoperator*= (Size factor)
 operator which multiplies this distribution by factor (similar to factor times applying operator '+=')
bool operator== (const IsotopeDistribution &isotope_distribution) const
 equality operator, returns true if the isotope_distribution is identical to this, false else
bool operator!= (const IsotopeDistribution &isotope_distribution) const
 inequality operator, returns true if the isotope_distribution differs from this, false else
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
void convolvePow_ (ContainerType &result, const ContainerType &input, Size factor) const
 convolves the distribution input factor times and stores the result in result
void convolveSquare_ (ContainerType &result, const ContainerType &input) const
 convolves the distribution input with itself and stores the result in result

Protected Attributes

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

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  ) 

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 FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

const ContainerType& getContainer (  )  const

returns the container which holds the distribution

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 (similiar 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 (  ) 

renormalizes the sum of the probabilities of the isotopes to 1

The renormalisation 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  ) 

overwrites the container which holds the distribution using distribution

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

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

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

Size size (  )  const

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

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

void trimLeft ( DoubleReal  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.

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

void trimRight ( DoubleReal  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.

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().


Member Data Documentation

stores the isotope distribution

Size max_isotope_ [protected]

maximal isotopes which is used to calculate the distribution


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