|
| PeakIntegrator () |
| Constructor. More...
|
|
virtual | ~PeakIntegrator () |
| Destructor. More...
|
|
PeakArea | integratePeak (const MSChromatogram &chromatogram, const double left, const double right) const |
| Compute the area of a peak contained in a MSChromatogram. More...
|
|
PeakArea | integratePeak (const MSChromatogram &chromatogram, MSChromatogram::ConstIterator &left, MSChromatogram::ConstIterator &right) const |
| Compute the area of a peak contained in a MSChromatogram. More...
|
|
PeakArea | integratePeak (const MSSpectrum &spectrum, const double left, const double right) const |
| Compute the area of a peak contained in a MSSpectrum. More...
|
|
PeakArea | integratePeak (const MSSpectrum &spectrum, MSSpectrum::ConstIterator &left, MSSpectrum::ConstIterator &right) const |
| Compute the area of a peak contained in a MSSpectrum. More...
|
|
PeakBackground | estimateBackground (const MSChromatogram &chromatogram, const double left, const double right, const double peak_apex_pos) const |
| Estimate the background of a peak contained in a MSChromatogram. More...
|
|
PeakBackground | estimateBackground (const MSChromatogram &chromatogram, MSChromatogram::ConstIterator &left, MSChromatogram::ConstIterator &right, const double peak_apex_pos) const |
| Estimate the background of a peak contained in a MSChromatogram. More...
|
|
PeakBackground | estimateBackground (const MSSpectrum &spectrum, const double left, const double right, const double peak_apex_pos) const |
| Estimate the background of a peak contained in a MSSpectrum. More...
|
|
PeakBackground | estimateBackground (const MSSpectrum &spectrum, MSSpectrum::ConstIterator &left, MSSpectrum::ConstIterator &right, const double peak_apex_pos) const |
| Estimate the background of a peak contained in a MSSpectrum. More...
|
|
PeakShapeMetrics | calculatePeakShapeMetrics (const MSChromatogram &chromatogram, const double left, const double right, const double peak_height, const double peak_apex_pos) const |
| Calculate peak's shape metrics. More...
|
|
PeakShapeMetrics | calculatePeakShapeMetrics (const MSChromatogram &chromatogram, MSChromatogram::ConstIterator &left, MSChromatogram::ConstIterator &right, const double peak_height, const double peak_apex_pos) const |
| Calculate peak's shape metrics. More...
|
|
PeakShapeMetrics | calculatePeakShapeMetrics (const MSSpectrum &spectrum, const double left, const double right, const double peak_height, const double peak_apex_pos) const |
| Calculate peak's shape metrics. More...
|
|
PeakShapeMetrics | calculatePeakShapeMetrics (const MSSpectrum &spectrum, MSSpectrum::ConstIterator &left, MSSpectrum::ConstIterator &right, const double peak_height, const double peak_apex_pos) const |
| Calculate peak's shape metrics. More...
|
|
void | getDefaultParameters (Param ¶ms) |
|
Public Member Functions inherited from DefaultParamHandler |
| DefaultParamHandler (const String &name) |
| Constructor with name that is displayed in error messages. More...
|
|
| DefaultParamHandler (const DefaultParamHandler &rhs) |
| Copy constructor. More...
|
|
virtual | ~DefaultParamHandler () |
| Destructor. More...
|
|
virtual DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. More...
|
|
virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. More...
|
|
void | setParameters (const Param ¶m) |
| Sets the parameters. More...
|
|
const Param & | getParameters () const |
| Non-mutable access to the parameters. More...
|
|
const Param & | getDefaults () const |
| Non-mutable access to the default parameters. More...
|
|
const String & | getName () const |
| Non-mutable access to the name. More...
|
|
void | setName (const String &name) |
| Mutable access to the name. More...
|
|
const std::vector< String > & | getSubsections () const |
| Non-mutable access to the registered subsections. More...
|
|
|
void | updateMembers_ () |
| This method is used to update extra member variables at the end of the setParameters() method. More...
|
|
template<typename PeakContainerT > |
PeakArea | integratePeak_ (const PeakContainerT &pc, double left, double right) const |
|
template<typename PeakContainerT > |
PeakBackground | estimateBackground_ (const PeakContainerT &pc, double left, double right, const double peak_apex_pos) const |
|
template<typename PeakContainerConstIteratorT > |
double | simpson_ (PeakContainerConstIteratorT it_begin, PeakContainerConstIteratorT it_end) const |
| Simpson's rule algorithm. More...
|
|
template<typename PeakContainerT > |
PeakShapeMetrics | calculatePeakShapeMetrics_ (const PeakContainerT &pc, double left, double right, const double peak_height, const double peak_apex_pos) const |
|
template<typename PeakContainerConstIteratorT > |
double | findPosAtPeakHeightPercent_ (PeakContainerConstIteratorT it_left, PeakContainerConstIteratorT it_right, PeakContainerConstIteratorT it_end, const double peak_height, const double percent, const bool is_left_half) const |
| Find the position (RT/MZ) at a given percentage of peak's height. More...
|
|
Protected Member Functions inherited from DefaultParamHandler |
void | defaultsToParam_ () |
| Updates the parameters after the defaults have been set in the constructor. More...
|
|
Compute the area, background and shape metrics of a peak.
The area computation is performed in integratePeak() and it supports integration by simple sum of the intensity, integration by Simpson's rule implementations for an odd number of unequally spaced points or integration by the trapezoid rule.
The background computation is performed in estimateBackground() and it supports three different approaches to baseline correction, namely computing a rectangular shape under the peak based on the minimum value of the peak borders (vertical_division_min), a rectangular shape based on the maximum value of the beak borders (vertical_division_max) or a trapezoidal shape based on a straight line between the peak borders (base_to_base).
Peak shape metrics are computed in calculatePeakShapeMetrics() and multiple metrics are supported.
The containers supported by the methods are MSChromatogram and MSSpectrum.
- Warning
- integratePeak() using Simpson's rule can result in negative areas despite strictly positive intensities in the input dataset. An example is given in the class test (see area = -665788.77).
PeakShapeMetrics calculatePeakShapeMetrics |
( |
const MSChromatogram & |
chromatogram, |
|
|
const double |
left, |
|
|
const double |
right, |
|
|
const double |
peak_height, |
|
|
const double |
peak_apex_pos |
|
) |
| const |
Calculate peak's shape metrics.
The calculated characteristics are the start and end times at 0.05, 0.10 and 0.5 the peak's height. Also the widths at those positions are calculated. Other values: the peak's total width, its tailing factor, asymmetry factor, baseline delta to height and the slope of the baseline. The number of points across the baseline and also at half height are saved.
- Note
- Make sure the chromatogram is sorted with respect to retention time.
- Parameters
-
[in] | chromatogram | The chromatogram which contains the peak |
[in] | left | The left retention time boundary |
[in] | right | The right retention time boundary |
[in] | peak_height | The peak's highest intensity |
[in] | peak_apex_pos | The position of the point with highest intensity |
- Returns
- A struct containing the calculated peak shape metrics
PeakShapeMetrics calculatePeakShapeMetrics |
( |
const MSSpectrum & |
spectrum, |
|
|
const double |
left, |
|
|
const double |
right, |
|
|
const double |
peak_height, |
|
|
const double |
peak_apex_pos |
|
) |
| const |
Calculate peak's shape metrics.
The calculated characteristics are the start and end positions at 0.05, 0.10 and 0.5 the peak's height. Also the widths at those positions are calculated. Other values: the peak's total width, its tailing factor, asymmetry factor, baseline delta to height and the slope of the baseline. The number of points across the baseline and also at half height are saved.
- Note
- Make sure the spectrum is sorted with respect to mass-to-charge ratio.
- Parameters
-
[in] | spectrum | The spectrum which contains the peak |
[in] | left | The left mass-to-charge ratio boundary |
[in] | right | The right mass-to-charge ratio boundary |
[in] | peak_height | The peak's highest intensity |
[in] | peak_apex_pos | The position of the point with highest intensity |
- Returns
- A struct containing the calculated peak shape metrics
PeakBackground estimateBackground |
( |
const MSChromatogram & |
chromatogram, |
|
|
const double |
left, |
|
|
const double |
right, |
|
|
const double |
peak_apex_pos |
|
) |
| const |
Estimate the background of a peak contained in a MSChromatogram.
The user can choose to compute one of two background types: "vertical_sum" and "base_to_base". For the former case, the area is computed as a rectangle with delta RT being the base and the minimum intensity on boundaries as the height. For the latter case, the area is computed as a rectangle trapezoid. Similar to the "vertical_sum" solution, this technique also takes into account the area between the intensities on boundaries.
For both cases, the parameter integration_type_ decides which formula to use to compute the area. The user should make sure to use the same integration_type between calls of estimateBackground() and integratePeak().
- Note
- Make sure the chromatogram is sorted with respect to retention time.
- Exceptions
-
- Parameters
-
[in] | chromatogram | The chromatogram which contains the peak |
[in] | left | The left retention time boundary |
[in] | right | The right retention time boundary |
[in] | peak_apex_pos | The position of the point with highest intensity |
- Returns
- A struct containing the informations about the peak's background area and height
Estimate the background of a peak contained in a MSChromatogram.
The user can choose to compute one of two background types: "vertical_sum" and "base_to_base". For the former case, the area is computed as a rectangle with delta RT being the base and the minimum intensity on boundaries as the height. For the latter case, the area is computed as a rectangle trapezoid. Similar to the "vertical_sum" solution, this technique also takes into account the area between the intensities on boundaries.
For both cases, the parameter integration_type_ decides which formula to use to compute the area. The user should make sure to use the same integration_type between calls of estimateBackground() and integratePeak().
- Note
- Make sure the chromatogram is sorted with respect to retention time.
- Exceptions
-
- Parameters
-
[in] | chromatogram | The chromatogram which contains the peak |
[in] | left | The iterator to the first point |
[in] | right | The iterator to the last point |
[in] | peak_apex_pos | The position of the point with highest intensity |
- Returns
- A struct containing the informations about the peak's background area and height
PeakBackground estimateBackground |
( |
const MSSpectrum & |
spectrum, |
|
|
const double |
left, |
|
|
const double |
right, |
|
|
const double |
peak_apex_pos |
|
) |
| const |
Estimate the background of a peak contained in a MSSpectrum.
The user can choose to compute one of two background types: "vertical_sum" and "base_to_base". For the former case, the area is computed as a rectangle with delta MZ being the base and the minimum intensity on boundaries as the height. For the latter case, the area is computed as a rectangle trapezoid. Similar to the "vertical_sum" solution, this technique also takes into account the area between the intensities on boundaries.
For both cases, the parameter integration_type_ decides which formula to use to compute the area. The user should make sure to use the same integration_type between calls of estimateBackground() and integratePeak().
- Note
- Make sure the spectrum is sorted with respect to mass-to-charge ratio.
- Exceptions
-
- Parameters
-
[in] | spectrum | The spectrum which contains the peak |
[in] | left | The left mass-to-charge ratio boundary |
[in] | right | The right mass-to-charge ratio boundary |
[in] | peak_apex_pos | The position of the point with highest intensity |
- Returns
- A struct containing the informations about the peak's background area and height
Estimate the background of a peak contained in a MSSpectrum.
The user can choose to compute one of two background types: "vertical_sum" and "base_to_base". For the former case, the area is computed as a rectangle with delta MZ being the base and the minimum intensity on boundaries as the height. For the latter case, the area is computed as a rectangle trapezoid. Similar to the "vertical_sum" solution, this technique also takes into account the area between the intensities on boundaries.
For both cases, the parameter integration_type_ decides which formula to use to compute the area. The user should make sure to use the same integration_type between calls of estimateBackground() and integratePeak().
- Note
- Make sure the spectrum is sorted with respect to mass-to-charge ratio.
- Exceptions
-
- Parameters
-
[in] | spectrum | The spectrum which contains the peak |
[in] | left | The iterator to the first point |
[in] | right | The iterator to the last point |
[in] | peak_apex_pos | The position of the point with highest intensity |
- Returns
- A struct containing the informations about the peak's background area and height