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

Fitter for RT profiles using a gaussian background model. More...

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

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

Public Member Functions

 GaussTraceFitter ()
 
 GaussTraceFitter (const GaussTraceFitter &other)
 
GaussTraceFitteroperator= (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. More...
 
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)
 
- Public Member Functions inherited from TraceFitter< PeakType >
 TraceFitter ()
 default constructor. More...
 
 TraceFitter (const TraceFitter &source)
 copy constructor More...
 
virtual TraceFitteroperator= (const TraceFitter &source)
 assignment operator More...
 
virtual ~TraceFitter ()
 destructor More...
 
- 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

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. More...
 
void printState_ (SignedSize iter, gsl_multifit_fdfsolver *s)
 
- Protected Member Functions inherited from TraceFitter< PeakType >
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...
 

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_
 
- Protected Attributes inherited from TraceFitter< PeakType >
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...
 

Static Protected Attributes

static const Size NUM_PARAMS_ = 3
 

Detailed Description

template<typename PeakType>
class OpenMS::GaussTraceFitter< PeakType >

Fitter for RT profiles using a gaussian background model.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
max_iteration int500  Maximum number of iterations using by Levenberg-Marquardt algorithm.
epsilon_abs float0.0001  Absolute error used by the Levenberg-Marquardt algorithm.
epsilon_rel float0.0001  Relative error used by the Levenberg-Marquardt algorithm.

Note:
Todo:
More docu

Constructor & Destructor Documentation

GaussTraceFitter ( )
inline
GaussTraceFitter ( const GaussTraceFitter< PeakType > &  other)
inline
virtual ~GaussTraceFitter ( )
inlinevirtual

Member Function Documentation

bool checkMaximalRTSpan ( const DoubleReal  max_rt_span)
inlinevirtual

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

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 
)
inlinevirtual

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

Implements TraceFitter< PeakType >.

References GaussTraceFitter< PeakType >::sigma_.

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

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

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 
)
inlinestaticprotected
void fit ( FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > &  traces)
inlinevirtual
DoubleReal getCenter ( ) const
inlinevirtual

Returns the center position of the fitted model

Implements TraceFitter< PeakType >.

References GaussTraceFitter< PeakType >::x0_.

DoubleReal getFeatureIntensityContribution ( )
inlinevirtual
DoubleReal getFWHM ( ) const
inlinevirtual

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 
)
inlinevirtual

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.

Implements TraceFitter< PeakType >.

References GaussTraceFitter< PeakType >::height_, GaussTraceFitter< PeakType >::sigma_, FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType >::theoretical_int, and GaussTraceFitter< PeakType >::x0_.

DoubleReal getHeight ( ) const
inlinevirtual

Returns the height of the fitted model

Implements TraceFitter< PeakType >.

References GaussTraceFitter< PeakType >::height_.

DoubleReal getLowerRTBound ( ) const
inlinevirtual

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)
inlineprotectedvirtual

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

Parameters
sThe 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
inlinevirtual

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 
)
inlinestaticprotected
GaussTraceFitter& operator= ( const GaussTraceFitter< PeakType > &  source)
inline
void printState_ ( SignedSize  iter,
gsl_multifit_fdfsolver *  s 
)
inlineprotectedvirtual

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.

Implements TraceFitter< PeakType >.

References LOG_DEBUG.

static Int residual_ ( const gsl_vector *  param,
void *  data,
gsl_vector *  f 
)
inlinestaticprotected
void setInitialParameters_ ( FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > &  traces)
inlineprotected
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 TraceFitter< PeakType >.

References TraceFitter< PeakType >::updateMembers_().

Referenced by GaussTraceFitter< PeakType >::GaussTraceFitter(), and GaussTraceFitter< PeakType >::operator=().

Member Data Documentation

DoubleReal height_
protected
const Size NUM_PARAMS_ = 3
staticprotected
DoubleReal region_rt_span_
protected
DoubleReal sigma_
protected
DoubleReal x0_
protected

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