Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TraceFitter< PeakType > Class Template Referenceabstract

Abstract fitter for RT profile fitting. More...

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

Inheritance diagram for TraceFitter< PeakType >:
DefaultParamHandler EGHTraceFitter< PeakType > GaussTraceFitter< PeakType >

Public Member Functions

 TraceFitter ()
 default constructor. More...
 
 TraceFitter (const TraceFitter &source)
 copy constructor More...
 
virtual TraceFitteroperator= (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
 
- 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 DefaultParamHandleroperator= (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 ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () 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))
 
- Protected Member Functions inherited from DefaultParamHandler
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...
 
- 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< Stringsubsections_
 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

template<class PeakType>
class OpenMS::TraceFitter< PeakType >

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

Constructor & Destructor Documentation

TraceFitter ( )
inline
TraceFitter ( const TraceFitter< PeakType > &  source)
inline

copy constructor

virtual ~TraceFitter ( )
inlinevirtual

destructor

Member Function Documentation

virtual bool checkMaximalRTSpan ( const DoubleReal  max_rt_span)
pure virtual

Checks if the fitted model is not to big

Parameters
max_rt_spanMaximum 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_().

virtual bool checkMinimalRTSpan ( const std::pair< DoubleReal, DoubleReal > &  rt_bounds,
const DoubleReal  min_rt_span 
)
pure virtual

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

Parameters
rt_boundsRT boundaries of the fitted model
min_rt_spanMinimum 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_().

virtual DoubleReal computeTheoretical ( const FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > &  trace,
Size  k 
)
pure virtual

Returns the theoretical value of the fitted model at position k in the passed Mass Trace

Parameters
tracethe mass trace for which the value should be computed
kuse 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_().

virtual void fit ( FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > &  traces)
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().

virtual DoubleReal getCenter ( ) const
pure virtual
virtual DoubleReal getFeatureIntensityContribution ( )
pure virtual
virtual DoubleReal getFWHM ( ) const
pure virtual

Returns the mass trace width at half max (FWHM)

Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

virtual String getGnuplotFormula ( FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > const &  trace,
const char  function_name,
const DoubleReal  baseline,
const DoubleReal  rt_shift 
)
pure virtual

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

Parameters
traceThe MassTrace that should be plotted
function_nameThe name of the function (e.g. f(x) -> function_name = f)
baselineThe intensity of the baseline
rt_shiftA 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_().

virtual DoubleReal getHeight ( ) const
pure virtual

Returns the height of the fitted model

Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

virtual DoubleReal getLowerRTBound ( ) const
pure virtual

Returns the lower bound of the fitted RT model

Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::cropFeature_().

virtual void getOptimizedParameters_ ( gsl_multifit_fdfsolver *  s)
protectedpure virtual

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

Parameters
sThe solver containing the fitted parameter values.

Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.

Referenced by TraceFitter< PeakType >::optimize_().

virtual DoubleReal getUpperRTBound ( ) const
pure virtual

Returns the upper bound of the fitted RT model

Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::cropFeature_().

virtual TraceFitter& operator= ( const TraceFitter< PeakType > &  source)
inlinevirtual
void optimize_ ( FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > &  traces,
const Size  num_params,
double  x_init[],
Int(*)(const gsl_vector *x, void *params, gsl_vector *f)  residual,
Int(*)(const gsl_vector *x, void *params, gsl_matrix *J)  jacobian,
Int(*)(const gsl_vector *x, void *params, gsl_vector *f, gsl_matrix *J)  evaluate 
)
inlineprotected
virtual void printState_ ( SignedSize  iter,
gsl_multifit_fdfsolver *  s 
)
protectedpure virtual

Prints the state of the current iteration (e.g., values of the parameters)

Parameters
iterNumber of current iteration.
sThe solver that also contains all the parameters.

Implemented in EGHTraceFitter< PeakType >, and GaussTraceFitter< PeakType >.

Referenced by TraceFitter< PeakType >::optimize_().

virtual void updateMembers_ ( )
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_().

Member Data Documentation

DoubleReal epsilon_abs_
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_().

DoubleReal epsilon_rel_
protected
SignedSize max_iterations_
protected

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:35 using doxygen 1.8.5