| OpenMS 2.5.0

Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TraceFitter Class Referenceabstract

Abstract fitter for RT profile fitting. More...

`#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/TraceFitter.h>`

Inheritance diagram for TraceFitter:

## Classes

class | GenericFunctor
struct | ModelData

## Public Member Functions

| TraceFitter ()
| default constructor More...
| TraceFitter (const TraceFitter &source)
| copy constructor More...
virtual TraceFitter & | operator= (const TraceFitter &source)
| assignment operator More...
| ~TraceFitter () override
| destructor More...
virtual void | fit (FeatureFinderAlgorithmPickedHelperStructs::MassTraces &traces)=0
virtual double | getLowerRTBound () const =0
virtual double | getUpperRTBound () const =0
virtual double | getHeight () const =0
virtual double | getCenter () const =0
virtual double | getFWHM () const =0
virtual double | getValue (double rt) const =0
double | computeTheoretical (const FeatureFinderAlgorithmPickedHelperStructs::MassTrace &trace, Size k)
virtual bool | checkMinimalRTSpan (const std::pair< double, double > &rt_bounds, const double min_rt_span)=0
virtual bool | checkMaximalRTSpan (const double max_rt_span)=0
virtual double | getArea ()=0
virtual String | getGnuplotFormula (const FeatureFinderAlgorithmPickedHelperStructs::MassTrace &trace, const char function_name, const double baseline, const double rt_shift)=0
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 &param)
| 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...

## Protected Member Functions

void | updateMembers_ () override
| This method is used to update extra member variables at the end of the setParameters() method. More...
virtual void | getOptimizedParameters_ (const Eigen::VectorXd &)=0
void | optimize_ (Eigen::VectorXd &x_init, GenericFunctor &functor)
Protected Member Functions inherited from DefaultParamHandler
void | defaultsToParam_ ()
| Updates the parameters after the defaults have been set in the constructor. More...

## Protected Attributes

SignedSize | max_iterations_
| Maximum number of iterations. More...
bool | weighted_
| Whether to weight mass traces by theoretical intensity during the optimization. More...
Protected Attributes inherited from DefaultParamHandler
Param | param_
| Container for current parameters. More...
Param | defaults_
| Container for default parameters. This member should be filled in the constructor of derived classes! More...
std::vector< String > | subsections_
| Container for registered subsections. This member should be filled in the constructor of derived classes! More...
String | error_name_
| Name that is displayed in error messages during the parameter checking. More...
bool | check_defaults_
| If this member is set to false no checking if parameters in done;. More...
bool | warn_empty_defaults_
| If this member is set to false no warning is emitted when defaults are empty;. More...

## Detailed Description

Abstract fitter for RT profile fitting.

This class provides the basic interface and some functionality to fit multiple mass traces to a given RT shape model using the Levenberg-Marquardt algorithm.

Todo:
  docu needs update

## Class Documentation

## ◆ OpenMS::TraceFitter::ModelData

struct OpenMS::TraceFitter::ModelData

Class Members
MassTraces * | traces_ptr |
bool | weighted |

## Constructor & Destructor Documentation

## ◆ TraceFitter() [1/2]

TraceFitter | ( |  | ) |

default constructor

## ◆ TraceFitter() [2/2]

TraceFitter | ( | const TraceFitter & | source | ) |

copy constructor

## ◆ ~TraceFitter()

~TraceFitter | ( |  | ) |

override

destructor

## Member Function Documentation

## ◆ checkMaximalRTSpan()

virtual bool checkMaximalRTSpan | ( | const double | max_rt_span | ) |

pure virtual

Checks if the fitted model is not to big

Parameters

  max_rt_span | Maximum RT span in relation to extended area that the model is allowed to have

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ checkMinimalRTSpan()

virtual bool checkMinimalRTSpan | ( | const std::pair< double, double > & | rt_bounds,
|  | const double | min_rt_span
| ) |  |

pure virtual

Checks if the fitted model fills out at least 'min_rt_span' of the RT span

Parameters

  rt_bounds | RT boundaries of the fitted model
  min_rt_span | Minimum RT span in relation to extended area that has to remain after model fitting

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ computeTheoretical()

double computeTheoretical | ( | const FeatureFinderAlgorithmPickedHelperStructs::MassTrace & | trace,
|  | Size | k
| ) |  |

Returns the theoretical value of the fitted model at position k in the passed mass trace

Parameters

  trace | the mass trace for which the value should be computed
  k | use the position of the k-th peak to compute the value

## ◆ fit()

virtual void fit | ( | FeatureFinderAlgorithmPickedHelperStructs::MassTraces & | traces | ) |

pure virtual

Main method of the TraceFitter which triggers the actual fitting.

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ getArea()

virtual double getArea | ( |  | ) |

pure virtual

Returns the peak area of the fitted model

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ getCenter()

virtual double getCenter | ( |  | ) | const

pure virtual

Returns the center position of the fitted model

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ getFWHM()

virtual double getFWHM | ( |  | ) | const

pure virtual

Returns the mass trace width at half max (FWHM)

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ getGnuplotFormula()

virtual String getGnuplotFormula | ( | const FeatureFinderAlgorithmPickedHelperStructs::MassTrace & | trace,
|  | const char | function_name,
|  | const double | baseline,
|  | const double | rt_shift
| ) |  |

pure virtual

Returns a textual representation of the fitted model function, that can be plotted using Gnuplot

Parameters

  trace | The mass trace that should be plotted
  function_name | The name of the function (e.g. f(x) -> function_name = f)
  baseline | The intensity of the baseline
  rt_shift | A shift value, that allows to plot all RT profiles side by side, even if they would overlap in reality. This should be 0 for the first mass trace and increase by a fixed value for each mass trace.

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ getHeight()

virtual double getHeight | ( |  | ) | const

pure virtual

Returns the height of the fitted model

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ getLowerRTBound()

virtual double getLowerRTBound | ( |  | ) | const

pure virtual

Returns the lower bound of the fitted RT model

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ getOptimizedParameters_()

virtual void getOptimizedParameters_ | ( | const Eigen::VectorXd & |  | ) |

protected pure virtual

Updates all member variables to the fitted values stored in the solver.

Parameters

  s | The solver containing the fitted parameter values.

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ getUpperRTBound()

virtual double getUpperRTBound | ( |  | ) | const

pure virtual

Returns the upper bound of the fitted RT model

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ getValue()

virtual double getValue | ( | double | rt | ) | const

pure virtual

Evaluate the fitted model at a time point

Implemented in EGHTraceFitter, and GaussTraceFitter.

## ◆ operator=()

virtual TraceFitter& operator= | ( | const TraceFitter & | source | ) |

virtual

assignment operator

## ◆ optimize_()

void optimize_ | ( | Eigen::VectorXd & | x_init,
|  | GenericFunctor & | functor
| ) |  |

protected

Optimize the given parameters using the Levenberg-Marquardt algorithm.

## ◆ updateMembers_()

void updateMembers_ | ( |  | ) |

override protected virtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

## Member Data Documentation

## ◆ max_iterations_

SignedSize max_iterations_

protected

Maximum number of iterations.

## ◆ weighted_

bool weighted_

protected

Whether to weight mass traces by theoretical intensity during the optimization.