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 |
typedef ContainerType::reverse_iterator | reverse_iterator |
typedef ContainerType::reverse_iterator | ReverseIterator |
typedef ContainerType::const_reverse_iterator | const_reverse_iterator |
typedef ContainerType::const_reverse_iterator | ConstReverseIterator |
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 ContainerType & | getContainer () 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 | estimateFromPeptideWeightAndS (double average_weight, UInt S) |
Estimate peptide IsotopeDistribution from average weight and exact number of sulfurs. More... | |
void | estimateFromRNAWeight (double average_weight) |
Estimate Nucleotide Isotopedistribution from weight and number of isotopes that should be reported. More... | |
void | estimateFromDNAWeight (double average_weight) |
Estimate Nucleotide Isotopedistribution from weight and number of isotopes that should be reported averagine model from Zubarev, R. A.; Demirev, P. A. in "Isotope depletion of large biomolecules: Implications for molecular mass measurements.". More... | |
void | estimateFromWeightAndComp (double average_weight, double C, double H, double N, double O, double S, double P) |
Estimate Isotopedistribution from weight, average composition, and number of isotopes that should be reported. More... | |
void | estimateFromWeightAndCompAndS (double average_weight, UInt S, double C, double H, double N, double O, double P) |
Estimate IsotopeDistribution from weight, exact number of sulfurs, and average remaining composition. More... | |
void | estimateForFragmentFromPeptideWeight (double average_weight_precursor, double average_weight_fragment, const std::set< UInt > &precursor_isotopes) |
Estimate peptide fragment IsotopeDistribution from the precursor's average weight, fragment's average weight, and a list of isolated precursor isotopes. More... | |
void | estimateForFragmentFromPeptideWeightAndS (double average_weight_precursor, UInt S_precursor, double average_weight_fragment, UInt S_fragment, const std::set< UInt > &precursor_isotopes) |
Estimate peptide fragment IsotopeDistribution from the precursor's average weight, number of sulfurs in the precursor, fragment's average weight, number of sulfurs in the fragment, and a list of isolated precursor isotopes. More... | |
void | estimateForFragmentFromRNAWeight (double average_weight_precursor, double average_weight_fragment, const std::set< UInt > &precursor_isotopes) |
Estimate RNA fragment IsotopeDistribution from the precursor's average weight, fragment's average weight, and a list of isolated precursor isotopes. More... | |
void | estimateForFragmentFromDNAWeight (double average_weight_precursor, double average_weight_fragment, const std::set< UInt > &precursor_isotopes) |
Estimate DNA fragment IsotopeDistribution from the precursor's average weight, fragment's average weight, and a list of isolated precursor isotopes. More... | |
void | estimateForFragmentFromWeightAndComp (double average_weight_precursor, double average_weight_fragment, const std::set< UInt > &precursor_isotopes, double C, double H, double N, double O, double S, double P) |
Estimate fragment IsotopeDistribution from the precursor's average weight, fragment's average weight, a list of isolated precursor isotopes, and average composition. More... | |
void | calcFragmentIsotopeDist (const IsotopeDistribution &fragment_isotope_dist, const IsotopeDistribution &comp_fragment_isotope_dist, const std::set< UInt > &precursor_isotopes) |
Calculate isotopic distribution for a fragment molecule. 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 | |
IsotopeDistribution & | operator= (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... | |
IsotopeDistribution & | operator+= (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... | |
IsotopeDistribution & | operator*= (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 |
ReverseIterator | rbegin () |
ReverseIterator | rend () |
ConstReverseIterator | rbegin () const |
ConstReverseIterator | rend () 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... | |
void | calcFragmentIsotopeDist_ (ContainerType &result, const ContainerType &fragment_isotope_dist, const ContainerType &comp_fragment_isotope_dist, const std::set< UInt > &precursor_isotopes) |
calculates the fragment distribution for a fragment molecule and stores it in result . More... | |
ContainerType | fillGaps_ (const ContainerType &id) const |
fill a gapped isotope pattern (i.e. certain masses are missing), with zero probability masses More... | |
Protected Attributes | |
Size | max_isotope_ |
maximal isotopes which is used to calculate the distribution More... | |
ContainerType | distribution_ |
stores the isotope distribution More... | |
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!
typedef ContainerType::const_iterator const_iterator |
typedef ContainerType::const_reverse_iterator const_reverse_iterator |
typedef ContainerType::const_iterator ConstIterator |
typedef ContainerType::const_reverse_iterator ConstReverseIterator |
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::reverse_iterator reverse_iterator |
typedef ContainerType::reverse_iterator ReverseIterator |
Default constructor, note max_isotope must be set later
|
explicit |
Detailed constructor which sets the max_isotope
.
IsotopeDistribution | ( | const IsotopeDistribution & | isotope_distribution | ) |
Copy constructor.
|
virtual |
Destructor.
|
inline |
|
inline |
void calcFragmentIsotopeDist | ( | const IsotopeDistribution & | fragment_isotope_dist, |
const IsotopeDistribution & | comp_fragment_isotope_dist, | ||
const std::set< UInt > & | precursor_isotopes | ||
) |
Calculate isotopic distribution for a fragment molecule.
This calculates the isotopic distribution for a fragment molecule given the isotopic distribution of the fragment and complementary fragment (as if they were precursors), and which precursor isotopes were isolated. Do consider normalising the distribution afterwards to get conditional probabilities. Equations come from Rockwood, AL; Kushnir, MA; Nelson, GJ. in "Dissociation of Individual Isotopic Peaks: Predicting Isotopic Distributions of Product Ions in MSn"
fragment_isotope_dist | the isotopic distribution of the fragment (as if it was a precursor). |
comp_fragment_isotope_dist | the isotopic distribution of the complementary fragment (as if it was a precursor). |
precursor_isotopes | a list of which precursor isotopes were isolated. 0 corresponds to the mono-isotopic molecule (M0), 1->M1, etc. |
|
protected |
calculates the fragment distribution for a fragment molecule and stores it in result
.
fragment_isotope_dist | the isotopic distribution of the fragment (as if it was a precursor). |
comp_fragment_isotope_dist | the isotopic distribution of the complementary fragment (as if it was a precursor). |
precursor_isotopes | which precursor isotopes were isolated. 0 corresponds to the mono-isotopic molecule (M0), 1->M1, etc. |
void clear | ( | ) |
clears the distribution and resets max isotope to 0
|
protected |
convolves the distributions left
and right
and stores the result in result
|
protected |
convolves the distribution input
factor
times and stores the result in result
|
protected |
convolves the distribution input
with itself and stores the result in result
|
inline |
|
inline |
void estimateForFragmentFromDNAWeight | ( | double | average_weight_precursor, |
double | average_weight_fragment, | ||
const std::set< UInt > & | precursor_isotopes | ||
) |
Estimate DNA fragment IsotopeDistribution from the precursor's average weight, fragment's average weight, and a list of isolated precursor isotopes.
The max_depth of the isotopic distribution is set to max(precursor_isotopes)+1.
average_weight_precursor | average weight of the precursor nucleotide |
average_weight_fragment | average weight of the fragment |
precursor_isotopes | the precursor isotopes that were isolated. 0 corresponds to the mono-isotopic molecule (M0), 1->M1, etc. |
void estimateForFragmentFromPeptideWeight | ( | double | average_weight_precursor, |
double | average_weight_fragment, | ||
const std::set< UInt > & | precursor_isotopes | ||
) |
Estimate peptide fragment IsotopeDistribution from the precursor's average weight, fragment's average weight, and a list of isolated precursor isotopes.
The max_depth of the isotopic distribution is set to max(precursor_isotopes)+1.
average_weight_precursor | average weight of the precursor peptide |
average_weight_fragment | average weight of the fragment |
precursor_isotopes | the precursor isotopes that were isolated. 0 corresponds to the mono-isotopic molecule (M0), 1->M1, etc. |
void estimateForFragmentFromPeptideWeightAndS | ( | double | average_weight_precursor, |
UInt | S_precursor, | ||
double | average_weight_fragment, | ||
UInt | S_fragment, | ||
const std::set< UInt > & | precursor_isotopes | ||
) |
Estimate peptide fragment IsotopeDistribution from the precursor's average weight, number of sulfurs in the precursor, fragment's average weight, number of sulfurs in the fragment, and a list of isolated precursor isotopes.
The max_depth of the isotopic distribution is set to max(precursor_isotopes)+1.
average_weight_precursor | average weight of the precursor peptide |
S_precursor | The exact number of Sulfurs in the precursor peptide |
average_weight_fragment | average weight of the fragment |
S_fragment | The exact number of Sulfurs in the fragment |
precursor_isotopes | the precursor isotopes that were isolated |
void estimateForFragmentFromRNAWeight | ( | double | average_weight_precursor, |
double | average_weight_fragment, | ||
const std::set< UInt > & | precursor_isotopes | ||
) |
Estimate RNA fragment IsotopeDistribution from the precursor's average weight, fragment's average weight, and a list of isolated precursor isotopes.
The max_depth of the isotopic distribution is set to max(precursor_isotopes)+1.
average_weight_precursor | average weight of the precursor nucleotide |
average_weight_fragment | average weight of the fragment |
precursor_isotopes | the precursor isotopes that were isolated. 0 corresponds to the mono-isotopic molecule (M0), 1->M1, etc. |
void estimateForFragmentFromWeightAndComp | ( | double | average_weight_precursor, |
double | average_weight_fragment, | ||
const std::set< UInt > & | precursor_isotopes, | ||
double | C, | ||
double | H, | ||
double | N, | ||
double | O, | ||
double | S, | ||
double | P | ||
) |
Estimate fragment IsotopeDistribution from the precursor's average weight, fragment's average weight, a list of isolated precursor isotopes, and average composition.
The max_depth of the isotopic distribution is set to max(precursor_isotopes)+1.
average_weight_precursor | average weight of the precursor molecule |
average_weight_fragment | average weight of the fragment molecule |
precursor_isotopes | the precursor isotopes that were isolated. 0 corresponds to the mono-isotopic molecule (M0), 1->M1, etc. |
C | The approximate relative stoichiometry of Carbons to other elements in this molecule |
H | The approximate relative stoichiometry of Hydrogens to other elements in this molecule |
N | The approximate relative stoichiometry of Nitrogens to other elements in this molecule |
O | The approximate relative stoichiometry of Oxygens to other elements in this molecule |
S | The approximate relative stoichiometry of Sulfurs to other elements in this molecule |
P | The approximate relative stoichiometry of Phosphoruses to other elements in this molecule |
void estimateFromDNAWeight | ( | double | average_weight | ) |
Estimate Nucleotide Isotopedistribution from weight and number of isotopes that should be reported averagine model from Zubarev, R. A.; Demirev, P. A. in "Isotope depletion of large biomolecules: Implications for molecular mass measurements.".
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(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORangeOfAveraginePeptide(), and MetaProSIPDecomposition::calculateIsotopePatternsFor2HRangeOfAveraginePeptide().
Estimate peptide IsotopeDistribution from average weight and exact number of sulfurs.
average_weight | Average weight to estimate an EmpiricalFormula for |
S | The exact number of Sulfurs in this molecule |
void estimateFromRNAWeight | ( | double | average_weight | ) |
Estimate Nucleotide Isotopedistribution from weight and number of isotopes that should be reported.
averagine model from Zubarev, R. A.; Demirev, P. A. in "Isotope depletion of large biomolecules: Implications for molecular mass measurements."
void estimateFromWeightAndComp | ( | double | average_weight, |
double | C, | ||
double | H, | ||
double | N, | ||
double | O, | ||
double | S, | ||
double | P | ||
) |
Estimate Isotopedistribution from weight, average composition, and number of isotopes that should be reported.
void estimateFromWeightAndCompAndS | ( | double | average_weight, |
UInt | S, | ||
double | C, | ||
double | H, | ||
double | N, | ||
double | O, | ||
double | P | ||
) |
Estimate IsotopeDistribution from weight, exact number of sulfurs, and average remaining composition.
average_weight | Average weight to estimate an IsotopeDistribution for |
S | The exact numbers of Sulfurs in this molecule |
C | The approximate relative stoichiometry of Carbons to other elements (excluding Sulfur) in this molecule |
H | The approximate relative stoichiometry of Hydrogens to other elements (excluding Sulfur) in this molecule |
N | The approximate relative stoichiometry of Nitrogens to other elements (excluding Sulfur) in this molecule |
O | The approximate relative stoichiometry of Oxygens to other elements (excluding Sulfur) in this molecule |
P | The approximate relative stoichiometry of Phosphoruses to other elements (excluding Sulfur) in this molecule |
|
protected |
fill a gapped isotope pattern (i.e. certain masses are missing), with zero probability masses
const ContainerType& getContainer | ( | ) | const |
returns the container which holds the distribution
Referenced by TOPPMetaProSIP::calculateCorrelation(), MetaProSIPDecomposition::calculateIsotopePatternsFor13CRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor13CRangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORange(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor2HRange(), and MetaProSIPDecomposition::calculateIsotopePatternsFor2HRangeOfAveraginePeptide().
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
|
inline |
|
inline |
|
inline |
|
inline |
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 | ) |
overwrites the container which holds the distribution using distribution
Referenced by MetaProSIPDecomposition::calculateIsotopePatternsFor13CRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor13CRangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORange(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor2HRange(), and MetaProSIPDecomposition::calculateIsotopePatternsFor2HRangeOfAveraginePeptide().
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.
|
protected |
stores the isotope distribution
|
protected |
maximal isotopes which is used to calculate the distribution
OpenMS / TOPP release 2.3.0 | Documentation generated on Tue Jan 9 2018 18:22:09 using doxygen 1.8.13 |