OpenMS
GaussTraceFitter Class Reference

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

#include <OpenMS/FEATUREFINDER/GaussTraceFitter.h>

Inheritance diagram for GaussTraceFitter:
[legend]
Collaboration diagram for GaussTraceFitter:
[legend]

Classes

class  GaussTraceFunctor
 

Public Member Functions

 GaussTraceFitter ()
 
 GaussTraceFitter (const GaussTraceFitter &other)
 
GaussTraceFitteroperator= (const GaussTraceFitter &source)
 
 ~GaussTraceFitter () override
 
void fit (FeatureFinderAlgorithmPickedHelperStructs::MassTraces &traces) override
 
double getLowerRTBound () const override
 
double getUpperRTBound () const override
 
double getHeight () const override
 
double getCenter () const override
 
double getFWHM () const override
 
double getSigma () const
 Returns the sigma of the fitted gaussian model. More...
 
bool checkMaximalRTSpan (const double max_rt_span) override
 
bool checkMinimalRTSpan (const std::pair< double, double > &rt_bounds, const double min_rt_span) override
 
double getValue (double rt) const override
 
double getArea () override
 
String getGnuplotFormula (const FeatureFinderAlgorithmPickedHelperStructs::MassTrace &trace, const char function_name, const double baseline, const double rt_shift) override
 
- Public Member Functions inherited from TraceFitter
 TraceFitter ()
 default constructor More...
 
 TraceFitter (const TraceFitter &source)
 copy constructor More...
 
TraceFitteroperator= (const TraceFitter &source)
 assignment operator More...
 
 ~TraceFitter () override
 destructor More...
 
double computeTheoretical (const FeatureFinderAlgorithmPickedHelperStructs::MassTrace &trace, Size k) const
 
- 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...
 
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_ (const Eigen::VectorXd &s) override
 
void setInitialParameters_ (FeatureFinderAlgorithmPickedHelperStructs::MassTraces &traces)
 
void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
- Protected Member Functions inherited from TraceFitter
void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void optimize_ (Eigen::VectorXd &x_init, GenericFunctor &functor)
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

double sigma_
 
double x0_
 
double height_
 
double region_rt_span_
 
- Protected Attributes inherited from TraceFitter
SignedSize max_iterations_
 Maximum number of iterations. More...
 
bool weighted_
 Whether to weight mass traces by theoretical intensity during the optimization. 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_
 

Additional Inherited Members

- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 

Detailed Description

Fitter for RT profiles using a Gaussian background model.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
max_iteration int500  Maximum number of iterations used by the Levenberg-Marquardt algorithm.
weighted stringfalse true, falseWeight mass traces according to their theoretical intensities.

Note:
  • If a section name is documented, the documentation is displayed as tooltip.
  • Advanced parameter names are italic.
Todo:
More docu

Constructor & Destructor Documentation

◆ GaussTraceFitter() [1/2]

◆ GaussTraceFitter() [2/2]

GaussTraceFitter ( const GaussTraceFitter other)

◆ ~GaussTraceFitter()

~GaussTraceFitter ( )
override

Member Function Documentation

◆ checkMaximalRTSpan()

bool checkMaximalRTSpan ( const double  max_rt_span)
overridevirtual

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.

◆ checkMinimalRTSpan()

bool checkMinimalRTSpan ( const std::pair< double, double > &  rt_bounds,
const double  min_rt_span 
)
overridevirtual

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.

◆ fit()

void fit ( FeatureFinderAlgorithmPickedHelperStructs::MassTraces traces)
overridevirtual

Main method of the TraceFitter which triggers the actual fitting.

Implements TraceFitter.

◆ getArea()

double getArea ( )
overridevirtual

Returns the peak area of the fitted model

Implements TraceFitter.

◆ getCenter()

double getCenter ( ) const
overridevirtual

Returns the center position of the fitted model

Implements TraceFitter.

◆ getFWHM()

double getFWHM ( ) const
overridevirtual

Returns the mass trace width at half max (FWHM)

Implements TraceFitter.

◆ getGnuplotFormula()

String getGnuplotFormula ( const FeatureFinderAlgorithmPickedHelperStructs::MassTrace trace,
const char  function_name,
const double  baseline,
const double  rt_shift 
)
overridevirtual

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

Parameters
traceThe mass trace 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.

◆ getHeight()

double getHeight ( ) const
overridevirtual

Returns the height of the fitted model

Implements TraceFitter.

◆ getLowerRTBound()

double getLowerRTBound ( ) const
overridevirtual

Returns the lower bound of the fitted RT model

Implements TraceFitter.

◆ getOptimizedParameters_()

void getOptimizedParameters_ ( const Eigen::VectorXd s)
overrideprotectedvirtual

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

Parameters
sThe solver containing the fitted parameter values.

Implements TraceFitter.

◆ getSigma()

double getSigma ( ) const

Returns the sigma of the fitted gaussian model.

◆ getUpperRTBound()

double getUpperRTBound ( ) const
overridevirtual

Returns the upper bound of the fitted RT model

Implements TraceFitter.

◆ getValue()

double getValue ( double  rt) const
overridevirtual

Evaluate the fitted model at a time point

Implements TraceFitter.

◆ operator=()

GaussTraceFitter& operator= ( const GaussTraceFitter source)

◆ setInitialParameters_()

void setInitialParameters_ ( FeatureFinderAlgorithmPickedHelperStructs::MassTraces traces)
protected

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

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.

Member Data Documentation

◆ height_

double height_
protected

◆ NUM_PARAMS_

const Size NUM_PARAMS_
staticprotected

◆ region_rt_span_

double region_rt_span_
protected

◆ sigma_

double sigma_
protected

◆ x0_

double x0_
protected