Abstract fitter for RT profile fitting. More...
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/TraceFitter.h>
Public Member Functions | |
TraceFitter () | |
default constructor. More... | |
TraceFitter (const TraceFitter &source) | |
copy constructor More... | |
virtual TraceFitter & | operator= (const TraceFitter &source) |
assignment operator More... | |
virtual | ~TraceFitter () |
destructor More... | |
virtual void | fit (FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > &traces)=0 |
virtual DoubleReal | getLowerRTBound () const =0 |
virtual DoubleReal | getUpperRTBound () const =0 |
virtual DoubleReal | getHeight () const =0 |
virtual DoubleReal | getCenter () const =0 |
virtual DoubleReal | getFWHM () const =0 |
virtual DoubleReal | computeTheoretical (const FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > &trace, Size k)=0 |
virtual bool | checkMinimalRTSpan (const std::pair< DoubleReal, DoubleReal > &rt_bounds, const DoubleReal min_rt_span)=0 |
virtual bool | checkMaximalRTSpan (const DoubleReal max_rt_span)=0 |
virtual DoubleReal | getFeatureIntensityContribution ()=0 |
virtual String | getGnuplotFormula (FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > const &trace, const char function_name, const DoubleReal baseline, const DoubleReal rt_shift)=0 |
![]() | |
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... | |
Protected Member Functions | |
virtual void | printState_ (SignedSize iter, gsl_multifit_fdfsolver *s)=0 |
virtual void | updateMembers_ () |
This method is used to update extra member variables at the end of the setParameters() method. More... | |
virtual void | getOptimizedParameters_ (gsl_multifit_fdfsolver *s)=0 |
void | optimize_ (FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > &traces, const Size num_params, double x_init[], Int(*residual)(const gsl_vector *x, void *params, gsl_vector *f), Int(*jacobian)(const gsl_vector *x, void *params, gsl_matrix *J), Int(*evaluate)(const gsl_vector *x, void *params, gsl_vector *f, gsl_matrix *J)) |
![]() | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Protected Attributes | |
DoubleReal | epsilon_abs_ |
Absolute error. More... | |
DoubleReal | epsilon_rel_ |
Relative error. More... | |
SignedSize | max_iterations_ |
Maximum number of iterations. More... | |
![]() | |
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... | |
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.
|
inline |
default constructor.
References StringList::create(), DefaultParamHandler::defaults_, and Param::setValue().
|
inline |
copy constructor
|
inlinevirtual |
destructor
|
pure 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 |
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::checkFeatureQuality_().
|
pure 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 |
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::checkFeatureQuality_().
|
pure 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 |
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::checkFeatureQuality_(), and FeatureFinderAlgorithmPicked< PeakType, FeatureType >::cropFeature_().
|
pure virtual |
Main method of the TraceFitter which triggers the actual fitting.
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().
|
pure virtual |
Returns the center position of the fitted model
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::checkFeatureQuality_(), FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run(), and FeatureFinderAlgorithmPicked< PeakType, FeatureType >::writeFeatureDebugInfo_().
|
pure virtual |
???
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().
|
pure virtual |
Returns the mass trace width at half max (FWHM)
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().
|
pure 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. |
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::writeFeatureDebugInfo_().
|
pure virtual |
Returns the height of the fitted model
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().
|
pure virtual |
Returns the lower bound of the fitted RT model
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::cropFeature_().
|
protectedpure virtual |
Updates all member variables to the fitted values stored in the solver.
s | The solver containing the fitted parameter values. |
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by TraceFitter< PeakType >::optimize_().
|
pure virtual |
Returns the upper bound of the fitted RT model
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::cropFeature_().
|
inlinevirtual |
assignment operator
References TraceFitter< PeakType >::epsilon_abs_, TraceFitter< PeakType >::epsilon_rel_, TraceFitter< PeakType >::max_iterations_, DefaultParamHandler::operator=(), and TraceFitter< PeakType >::updateMembers_().
Referenced by GaussTraceFitter< PeakType >::operator=(), and EGHTraceFitter< PeakType >::operator=().
|
inlineprotected |
Optimize the given parameters using the Levenberg-Marquardt algorithm.
References TraceFitter< PeakType >::epsilon_abs_, TraceFitter< PeakType >::epsilon_rel_, OpenMS::OptimizationFunctions::evaluate(), TraceFitter< PeakType >::getOptimizedParameters_(), FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType >::getPeakCount(), OpenMS::OptimizationFunctions::jacobian(), TraceFitter< PeakType >::max_iterations_, TraceFitter< PeakType >::printState_(), and OpenMS::OptimizationFunctions::residual().
Referenced by GaussTraceFitter< PeakType >::fit(), and EGHTraceFitter< PeakType >::fit().
|
protectedpure 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. |
Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
Referenced by TraceFitter< PeakType >::optimize_().
|
inlineprotectedvirtual |
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.
Reimplemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.
References TraceFitter< PeakType >::epsilon_abs_, TraceFitter< PeakType >::epsilon_rel_, Param::getValue(), TraceFitter< PeakType >::max_iterations_, and DefaultParamHandler::param_.
Referenced by TraceFitter< PeakType >::operator=(), GaussTraceFitter< PeakType >::updateMembers_(), and EGHTraceFitter< PeakType >::updateMembers_().
|
protected |
Absolute error.
Test for the convergence of the sequence by comparing the last iteration step dx with the absolute error epsabs and relative error epsrel to the current position x
Referenced by TraceFitter< PeakType >::operator=(), TraceFitter< PeakType >::optimize_(), and TraceFitter< PeakType >::updateMembers_().
|
protected |
Relative error.
Referenced by TraceFitter< PeakType >::operator=(), TraceFitter< PeakType >::optimize_(), and TraceFitter< PeakType >::updateMembers_().
|
protected |
Maximum number of iterations.
Referenced by TraceFitter< PeakType >::operator=(), TraceFitter< PeakType >::optimize_(), and TraceFitter< PeakType >::updateMembers_().
OpenMS / TOPP release 1.11.1 | Documentation generated on Thu Nov 14 2013 11:19:35 using doxygen 1.8.5 |