Fitter for RT profiles using a gaussian background model. More...
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/GaussTraceFitter.h>
Public Member Functions | |
| GaussTraceFitter () | |
| GaussTraceFitter (const GaussTraceFitter &other) | |
| GaussTraceFitter & | operator= (const GaussTraceFitter &source) |
| virtual | ~GaussTraceFitter () |
| void | fit (FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > &traces) |
| DoubleReal | getLowerRTBound () const |
| DoubleReal | getUpperRTBound () const |
| DoubleReal | getHeight () const |
| DoubleReal | getCenter () const |
| DoubleReal | getFWHM () const |
| DoubleReal | getSigma () const |
| Returns the sigma of the fitted gaussian model. | |
| bool | checkMaximalRTSpan (const DoubleReal max_rt_span) |
| bool | checkMinimalRTSpan (const std::pair< DoubleReal, DoubleReal > &rt_bounds, const DoubleReal min_rt_span) |
| DoubleReal | computeTheoretical (const FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > &trace, Size k) |
| DoubleReal | getFeatureIntensityContribution () |
| String | getGnuplotFormula (FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > const &trace, const char function_name, const DoubleReal baseline, const DoubleReal rt_shift) |
Protected Member Functions | |
| void | getOptimizedParameters_ (gsl_multifit_fdfsolver *s) |
| void | setInitialParameters_ (FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > &traces) |
| virtual void | updateMembers_ () |
| This method is used to update extra member variables at the end of the setParameters() method. | |
| void | printState_ (SignedSize iter, gsl_multifit_fdfsolver *s) |
Static Protected Member Functions | |
| static Int | residual_ (const gsl_vector *param, void *data, gsl_vector *f) |
| static Int | jacobian_ (const gsl_vector *param, void *data, gsl_matrix *J) |
| static Int | evaluate_ (const gsl_vector *param, void *data, gsl_vector *f, gsl_matrix *J) |
Protected Attributes | |
| DoubleReal | sigma_ |
| DoubleReal | x0_ |
| DoubleReal | height_ |
| DoubleReal | region_rt_span_ |
Static Protected Attributes | |
| static const Size | NUM_PARAMS_ = 3 |
Fitter for RT profiles using a gaussian background model.
Parameters of this class are:| Name | Type | Default | Restrictions | Description |
|---|---|---|---|---|
| max_iteration | int | 500 | Maximum number of iterations using by Levenberg-Marquardt algorithm. | |
| epsilon_abs | float | 0.0001 | Absolute error used by the Levenberg-Marquardt algorithm. | |
| epsilon_rel | float | 0.0001 | Relative error used by the Levenberg-Marquardt algorithm. |
| GaussTraceFitter | ( | ) | [inline] |
| GaussTraceFitter | ( | const GaussTraceFitter< PeakType > & | other | ) | [inline] |
| virtual ~GaussTraceFitter | ( | ) | [inline, virtual] |
| bool checkMaximalRTSpan | ( | const DoubleReal | max_rt_span | ) | [inline, virtual] |
Checks if the fitted model is not to big
| max_rt_span | Maximum RT span in relation to extended area that the model is allowed to have |
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::region_rt_span_, and GaussTraceFitter< PeakType >::sigma_.
| bool checkMinimalRTSpan | ( | const std::pair< DoubleReal, DoubleReal > & | rt_bounds, | |
| const DoubleReal | min_rt_span | |||
| ) | [inline, virtual] |
Checks if the fitted model fills out at least 'min_rt_span' of the RT span
| 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 |
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::sigma_.
| DoubleReal computeTheoretical | ( | const FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > & | trace, | |
| Size | k | |||
| ) | [inline, virtual] |
Returns the theoretical value of the fitted model at position k in the passed Mass Trace
| trace | the mass trace for which the value should be computed | |
| k | use the position of the k-th peak to compute the value |
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::height_, FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType >::peaks, GaussTraceFitter< PeakType >::sigma_, FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType >::theoretical_int, and GaussTraceFitter< PeakType >::x0_.
| static Int evaluate_ | ( | const gsl_vector * | param, | |
| void * | data, | |||
| gsl_vector * | f, | |||
| gsl_matrix * | J | |||
| ) | [inline, static, protected] |
| void fit | ( | FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > & | traces | ) | [inline, virtual] |
Main method of the TraceFitter which triggers the actual fitting.
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::height_, LOG_DEBUG, GaussTraceFitter< PeakType >::NUM_PARAMS_, TraceFitter< PeakType >::optimize_(), GaussTraceFitter< PeakType >::setInitialParameters_(), GaussTraceFitter< PeakType >::sigma_, and GaussTraceFitter< PeakType >::x0_.
| DoubleReal getCenter | ( | ) | const [inline, virtual] |
Returns the center position of the fitted model
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::x0_.
| DoubleReal getFeatureIntensityContribution | ( | ) | [inline, virtual] |
???
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::height_, and GaussTraceFitter< PeakType >::sigma_.
| DoubleReal getFWHM | ( | ) | const [inline, virtual] |
Returns the mass trace width at half max (FWHM)
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::sigma_.
| String getGnuplotFormula | ( | FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > const & | trace, | |
| const char | function_name, | |||
| const DoubleReal | baseline, | |||
| const DoubleReal | rt_shift | |||
| ) | [inline, virtual] |
Returns a textual representation of the fitted model function, that can be plotted using Gnuplot
| trace | The MassTrace 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. |
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::height_, GaussTraceFitter< PeakType >::sigma_, FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType >::theoretical_int, and GaussTraceFitter< PeakType >::x0_.
| DoubleReal getHeight | ( | ) | const [inline, virtual] |
Returns the height of the fitted model
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::height_.
| DoubleReal getLowerRTBound | ( | ) | const [inline, virtual] |
Returns the lower bound of the fitted RT model
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::sigma_, and GaussTraceFitter< PeakType >::x0_.
| void getOptimizedParameters_ | ( | gsl_multifit_fdfsolver * | s | ) | [inline, protected, virtual] |
Updates all member variables to the fitted values stored in the solver.
| s | The solver containing the fitted parameter values. |
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::height_, GaussTraceFitter< PeakType >::sigma_, and GaussTraceFitter< PeakType >::x0_.
| DoubleReal getSigma | ( | ) | const [inline] |
Returns the sigma of the fitted gaussian model.
References GaussTraceFitter< PeakType >::sigma_.
| DoubleReal getUpperRTBound | ( | ) | const [inline, virtual] |
Returns the upper bound of the fitted RT model
Implements TraceFitter< PeakType >.
References GaussTraceFitter< PeakType >::sigma_, and GaussTraceFitter< PeakType >::x0_.
| static Int jacobian_ | ( | const gsl_vector * | param, | |
| void * | data, | |||
| gsl_matrix * | J | |||
| ) | [inline, static, protected] |
| GaussTraceFitter& operator= | ( | const GaussTraceFitter< PeakType > & | source | ) | [inline] |
| void printState_ | ( | SignedSize | iter, | |
| gsl_multifit_fdfsolver * | s | |||
| ) | [inline, protected, virtual] |
Prints the state of the current iteration (e.g., values of the parameters)
| iter | Number of current iteration. | |
| s | The solver that also contains all the parameters. |
Implements TraceFitter< PeakType >.
References LOG_DEBUG.
| static Int residual_ | ( | const gsl_vector * | param, | |
| void * | data, | |||
| gsl_vector * | f | |||
| ) | [inline, static, protected] |
References FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType >::baseline, FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType >::peaks, and FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType >::theoretical_int.
Referenced by GaussTraceFitter< PeakType >::evaluate_().
| void setInitialParameters_ | ( | FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > & | traces | ) | [inline, protected] |
References FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType >::baseline, GaussTraceFitter< PeakType >::height_, LOG_DEBUG, FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType >::max_trace, GaussTraceFitter< PeakType >::region_rt_span_, GaussTraceFitter< PeakType >::sigma_, and GaussTraceFitter< PeakType >::x0_.
Referenced by GaussTraceFitter< PeakType >::fit().
| virtual void updateMembers_ | ( | ) | [inline, 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 TraceFitter< PeakType >.
Referenced by GaussTraceFitter< PeakType >::GaussTraceFitter(), and GaussTraceFitter< PeakType >::operator=().
DoubleReal height_ [protected] |
Referenced by GaussTraceFitter< PeakType >::computeTheoretical(), GaussTraceFitter< PeakType >::fit(), GaussTraceFitter< PeakType >::GaussTraceFitter(), GaussTraceFitter< PeakType >::getFeatureIntensityContribution(), GaussTraceFitter< PeakType >::getGnuplotFormula(), GaussTraceFitter< PeakType >::getHeight(), GaussTraceFitter< PeakType >::getOptimizedParameters_(), GaussTraceFitter< PeakType >::operator=(), and GaussTraceFitter< PeakType >::setInitialParameters_().
const Size NUM_PARAMS_ = 3 [static, protected] |
Referenced by GaussTraceFitter< PeakType >::fit().
DoubleReal region_rt_span_ [protected] |
DoubleReal sigma_ [protected] |
Referenced by GaussTraceFitter< PeakType >::checkMaximalRTSpan(), GaussTraceFitter< PeakType >::checkMinimalRTSpan(), GaussTraceFitter< PeakType >::computeTheoretical(), GaussTraceFitter< PeakType >::fit(), GaussTraceFitter< PeakType >::GaussTraceFitter(), GaussTraceFitter< PeakType >::getFeatureIntensityContribution(), GaussTraceFitter< PeakType >::getFWHM(), GaussTraceFitter< PeakType >::getGnuplotFormula(), GaussTraceFitter< PeakType >::getLowerRTBound(), GaussTraceFitter< PeakType >::getOptimizedParameters_(), GaussTraceFitter< PeakType >::getSigma(), GaussTraceFitter< PeakType >::getUpperRTBound(), GaussTraceFitter< PeakType >::operator=(), and GaussTraceFitter< PeakType >::setInitialParameters_().
DoubleReal x0_ [protected] |
Referenced by GaussTraceFitter< PeakType >::computeTheoretical(), GaussTraceFitter< PeakType >::fit(), GaussTraceFitter< PeakType >::GaussTraceFitter(), GaussTraceFitter< PeakType >::getCenter(), GaussTraceFitter< PeakType >::getGnuplotFormula(), GaussTraceFitter< PeakType >::getLowerRTBound(), GaussTraceFitter< PeakType >::getOptimizedParameters_(), GaussTraceFitter< PeakType >::getUpperRTBound(), GaussTraceFitter< PeakType >::operator=(), and GaussTraceFitter< PeakType >::setInitialParameters_().
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:57 using doxygen 1.7.1 |