OpenMS
2.4.0
|
#include <OpenMS/CHEMISTRY/ISOTOPEDISTRIBUTION/IsotopeDistribution.h>
Public Types | |
enum | Sorted { INTENSITY, MASS, UNDEFINED } |
typedefs | |
typedef Peak1D | MassAbundance |
container type, first holds the weight of the isotope, second the probability More... | |
typedef std::vector< MassAbundance > | ContainerType |
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 (const IsotopeDistribution &isotope_distribution) | |
Copy constructor. More... | |
virtual | ~IsotopeDistribution () |
Destructor. More... | |
Accessors | |
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... | |
Peak1D::CoordinateType | getMax () const |
returns the maximal weight isotope which is stored in the distribution More... | |
Peak1D::CoordinateType | getMin () const |
returns the minimal weight isotope which is stored in the distribution More... | |
Peak1D | getMostAbundant () const |
returns the most abundant 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 | resize (UInt size) |
void | trimIntensities (double cutoff) |
remove intensities below the cutoff More... | |
void | sortByIntensity () |
sort isotope distribution by intensity More... | |
void | sortByMass () |
sort isotope distribution by mass More... | |
void | renormalize () |
re-normalizes the sum of the probabilities of the isotopes to 1 More... | |
void | merge (double resolution, double min_prob) |
Merges distributions arbitrary data points with constant defined resolution. 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... | |
bool | isNormalized () const |
double | averageMass () const |
bool | isConvolutionUnit () const |
Operators | |
IsotopeDistribution & | operator= (const IsotopeDistribution &isotope_distribution) |
Assignment 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... | |
bool | operator< (const IsotopeDistribution &isotope_distribution) const |
less operator More... | |
Iterators | |
Iterator | begin () |
Iterator | end () |
ConstIterator | begin () const |
ConstIterator | end () const |
ReverseIterator | rbegin () |
ReverseIterator | rend () |
ConstReverseIterator | rbegin () const |
ConstReverseIterator | rend () const |
void | insert (const Peak1D::CoordinateType &mass, const Peak1D::IntensityType &intensity) |
Data Access Operators | |
Peak1D & | operator[] (const Size &index) |
operator which access a cell of the distribution and wraps it in SpectrumFragment struct More... | |
Protected Member Functions | |
void | sort_ (std::function< bool(const MassAbundance &p1, const MassAbundance &p2)> sorter) |
sort wrapper of the distribution More... | |
void | transform_ (std::function< void(MassAbundance &)> lambda) |
takes a function as a parameter to transform the distribution More... | |
Protected Attributes | |
ContainerType | distribution_ |
stores the isotope distribution More... | |
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<MassAbundance> ContainerType |
typedef ContainerType::iterator iterator |
typedef ContainerType::iterator Iterator |
typedef Peak1D MassAbundance |
container type, first holds the weight of the isotope, second the probability
typedef ContainerType::reverse_iterator reverse_iterator |
typedef ContainerType::reverse_iterator ReverseIterator |
enum Sorted |
Default constructor, note max_isotope must be set later
IsotopeDistribution | ( | const IsotopeDistribution & | isotope_distribution | ) |
Copy constructor.
|
virtual |
Destructor.
double averageMass | ( | ) | const |
|
inline |
|
inline |
void clear | ( | ) |
clears the distribution and resets max isotope to 0
Referenced by MetaProSIPDecomposition::calculateIsotopePatternsFor13CRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor13CRangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORange(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor2HRange(), and MetaProSIPDecomposition::calculateIsotopePatternsFor2HRangeOfAveraginePeptide().
|
inline |
|
inline |
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().
Peak1D::CoordinateType getMax | ( | ) | const |
returns the maximal weight isotope which is stored in the distribution
Peak1D::CoordinateType getMin | ( | ) | const |
returns the minimal weight isotope which is stored in the distribution
Peak1D getMostAbundant | ( | ) | const |
returns the most abundant isotope which is stored in the distribution
|
inline |
Referenced by MetaProSIPDecomposition::calculateIsotopePatternsFor13CRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor13CRangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORange(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORangeOfAveraginePeptide(), MetaProSIPDecomposition::calculateIsotopePatternsFor2HRange(), and MetaProSIPDecomposition::calculateIsotopePatternsFor2HRangeOfAveraginePeptide().
bool isConvolutionUnit | ( | ) | const |
bool isNormalized | ( | ) | const |
Merges distributions arbitrary data points with constant defined resolution.
It creates a new IsotopeDistribution Container and assigns each isotope to the nearest bin. This function should be used to downsample the existing distribution. If the size of the new Container is larger this function throws an IllegalArgument Exception.
bool operator!= | ( | const IsotopeDistribution & | isotope_distribution | ) | const |
inequality operator, returns true if the isotope_distribution
differs from this, false else
bool operator< | ( | const IsotopeDistribution & | isotope_distribution | ) | const |
less operator
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
operator which access a cell of the distribution and wraps it in SpectrumFragment struct
|
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 resize | ( | UInt | size | ) |
void set | ( | const ContainerType & | distribution | ) |
overwrites the container which holds the distribution using distribution
Referenced by MetaProSIPDecomposition::calculateIsotopePatternsFor13CRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor15NRange(), MetaProSIPDecomposition::calculateIsotopePatternsFor18ORange(), and MetaProSIPDecomposition::calculateIsotopePatternsFor2HRange().
Size size | ( | ) | const |
returns the size of the distribution which is the number of isotopes in the distribution
|
protected |
sort wrapper of the distribution
void sortByIntensity | ( | ) |
sort isotope distribution by intensity
void sortByMass | ( | ) |
sort isotope distribution by mass
|
protected |
takes a function as a parameter to transform the distribution
void trimIntensities | ( | double | cutoff | ) |
remove intensities below the cutoff
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