Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Member Functions | Protected Attributes

TraceFitter< PeakType > Class Template Reference

Abstract fitter for RT profile fitting. More...

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

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

List of all members.

Public Member Functions

 TraceFitter ()
 default constructor.
 TraceFitter (const TraceFitter &source)
 copy constructor
virtual TraceFitteroperator= (const TraceFitter &source)
 assignment operator
virtual ~TraceFitter ()
 destructor
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

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.
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 Attributes

DoubleReal epsilon_abs_
 Absolute error.
DoubleReal epsilon_rel_
 Relative error.
SignedSize max_iterations_
 Maximum number of iterations.

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 (  )  [inline, virtual]

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

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

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

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

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

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 
) [inline, protected]
virtual void printState_ ( SignedSize  iter,
gsl_multifit_fdfsolver *  s 
) [protected, pure virtual]

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

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

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 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=().


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


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:57 using doxygen 1.7.1