#include <OpenMS/CHEMISTRY/IsotopeDistribution.h>
Holds an isotope distribution with the weight value and according probability. Distribution can be add using the '+' or '+=' operators.
Public Types | |
typedefs | |
typedef std::vector< std::pair < UInt, 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 (UInt max_isotope) | |
Detailed constructor which sets the max_isotope . | |
IsotopeDistribution (const IsotopeDistribution &isotope_distribution) | |
Copy constructor. | |
virtual | ~IsotopeDistribution () |
Destructor. | |
Accessors | |
void | setMaxIsotope (UInt max_isotope) |
sets the maximal isotope with max_isotope | |
UInt | getMaxIsotope () const |
returns the currently set maximum isotope | |
void | set (const ContainerType &distribution) |
overwrites the container which holds the distribution using distribution | |
const ContainerType & | getContainer () const |
returns the container which holds the distribtion | |
UInt | getMax () const |
returns the maximal weight isotope which is stored in the distribution | |
UInt | getMin () const |
returns the minimal weight isotope which is stored in the distribution | |
UInt | 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 | |
IsotopeDistribution & | operator= (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) | |
IsotopeDistribution & | operator+= (const IsotopeDistribution &isotope_distribution) |
operator which adds isotope_distribution to this (similar to convolve distributions) | |
IsotopeDistribution | operator * (UInt factor) const |
operator which multiplies this distribution by factor (similar to factor times applying operator '+') | |
IsotopeDistribution & | operator *= (UInt 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, UInt 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 | |
UInt | max_isotope_ |
maximal isotopes which is used to calculate the distribution | |
ContainerType | distribution_ |
stores the isotope distribution |
typedef std::vector<std::pair<UInt, 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 |
Default constructor, note max_isotope must be set later
IsotopeDistribution | ( | UInt | max_isotope | ) |
Detailed constructor which sets the max_isotope
.
IsotopeDistribution | ( | const IsotopeDistribution & | isotope_distribution | ) |
Copy constructor.
virtual ~IsotopeDistribution | ( | ) | [virtual] |
Destructor.
void setMaxIsotope | ( | UInt | 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
UInt getMaxIsotope | ( | ) | const |
returns the currently set maximum isotope
void set | ( | const ContainerType & | distribution | ) |
overwrites the container which holds the distribution using distribution
const ContainerType& getContainer | ( | ) | const |
returns the container which holds the distribtion
UInt getMax | ( | ) | const |
returns the maximal weight isotope which is stored in the distribution
UInt getMin | ( | ) | const |
returns the minimal weight isotope which is stored in the distribution
UInt 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.
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"
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 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.
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.
IsotopeDistribution& operator= | ( | 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)
IsotopeDistribution& operator+= | ( | const IsotopeDistribution & | isotope_distribution | ) |
operator which adds isotope_distribution
to this (similar to convolve distributions)
IsotopeDistribution operator * | ( | UInt | factor | ) | const |
operator which multiplies this distribution by factor
(similar to factor
times applying operator '+')
IsotopeDistribution& operator *= | ( | UInt | 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
Iterator begin | ( | ) | [inline] |
Iterator end | ( | ) | [inline] |
ConstIterator begin | ( | ) | const [inline] |
ConstIterator end | ( | ) | const [inline] |
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, | |||
UInt | 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
UInt max_isotope_ [protected] |
maximal isotopes which is used to calculate the distribution
ContainerType distribution_ [protected] |
stores the isotope distribution
Generated Tue Apr 1 15:36:43 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |