OpenMS
Loading...
Searching...
No Matches
GaussTraceFitter.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg$
6// $Authors: Stephan Aiche, Marc Sturm$
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
13namespace OpenMS
14{
15
23 class OPENMS_DLLAPI GaussTraceFitter :
24 public TraceFitter
25 {
26public:
28
30
32
34
35 // override important methods
37
38 double getLowerRTBound() const override;
39
40 double getUpperRTBound() const override;
41
42 double getHeight() const override;
43
44 double getCenter() const override;
45
46 double getFWHM() const override;
47
51 double getSigma() const;
52
53 bool checkMaximalRTSpan(const double max_rt_span) override;
54
55 bool checkMinimalRTSpan(const std::pair<double, double>& rt_bounds, const double min_rt_span) override;
56
57 double getValue(double rt) const override;
58
59 double getArea() override;
60
61 std::string getGnuplotFormula(const FeatureFinderAlgorithmPickedHelperStructs::MassTrace& trace, const char function_name, const double baseline, const double rt_shift) override;
62
63protected:
64 double sigma_;
65 double x0_;
66 double height_;
68
69 static const Size NUM_PARAMS_;
70
71 void getOptimizedParameters_(const std::vector<double>& s) override;
72
75 {
76public:
77 GaussTraceFunctor(int dimensions,
78 const TraceFitter::ModelData* data);
79
80 int operator()(const double* x, double* fvec) override;
81
82 // compute Jacobian matrix for the different parameters
83 int df(const double* x, double* J) override;
84protected:
86 };
87
89
90 void updateMembers_() override;
91
92 };
93
94} // namespace OpenMS
95
Definition GaussTraceFitter.h:75
int operator()(const double *x, double *fvec) override
Compute residuals at the current parameter vector.
GaussTraceFunctor(int dimensions, const TraceFitter::ModelData *data)
int df(const double *x, double *J) override
Compute the Jacobian at the current parameter vector.
const TraceFitter::ModelData * m_data
Definition GaussTraceFitter.h:85
Fitter for RT profiles using a Gaussian background model.
Definition GaussTraceFitter.h:25
std::string getGnuplotFormula(const FeatureFinderAlgorithmPickedHelperStructs::MassTrace &trace, const char function_name, const double baseline, const double rt_shift) override
Gnuplot expression of the fitted model for trace.
double getLowerRTBound() const override
Lower RT bound of the fitted RT model.
double getHeight() const override
Height of the fitted RT model at its centre.
double x0_
Definition GaussTraceFitter.h:65
bool checkMaximalRTSpan(const double max_rt_span) override
Whether the fitted RT model stays within max_rt_span of the extended search area.
double getFWHM() const override
Full width at half maximum of the fitted RT model.
double getArea() override
Area under the fitted RT model.
double sigma_
Definition GaussTraceFitter.h:64
void fit(FeatureFinderAlgorithmPickedHelperStructs::MassTraces &traces) override
Run the LM fit on traces.
double getUpperRTBound() const override
Upper RT bound of the fitted RT model.
double getValue(double rt) const override
Evaluate the fitted model at retention time rt.
GaussTraceFitter(const GaussTraceFitter &other)
double getCenter() const override
Centre of the fitted RT model.
GaussTraceFitter & operator=(const GaussTraceFitter &source)
double height_
Definition GaussTraceFitter.h:66
double getSigma() const
Returns the sigma of the fitted gaussian model.
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
static const Size NUM_PARAMS_
Definition GaussTraceFitter.h:69
double region_rt_span_
Definition GaussTraceFitter.h:67
void setInitialParameters_(FeatureFinderAlgorithmPickedHelperStructs::MassTraces &traces)
bool checkMinimalRTSpan(const std::pair< double, double > &rt_bounds, const double min_rt_span) override
Whether the fitted RT model covers at least min_rt_span of the extended search area.
void getOptimizedParameters_(const std::vector< double > &s) override
Subclass hook: copy the optimised parameter vector back into the subclass's model fields.
Generic LM functor with a raw-pointer interface, used to keep Eigen out of the public API.
Definition TraceFitter.h:55
Abstract base class for fitting an RT-shape model to one or more mass traces.
Definition TraceFitter.h:43
Helper bundle passed to functors so they can read both the traces and the weighting flag.
Definition TraceFitter.h:215
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Helper struct for mass traces used in FeatureFinderAlgorithmPicked.
Definition FeatureFinderAlgorithmPickedHelperStructs.h:54
Helper struct for a collection of mass traces used in FeatureFinderAlgorithmPicked.
Definition FeatureFinderAlgorithmPickedHelperStructs.h:85