OpenMS
GaussTraceFitter.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2023.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg$
32 // $Authors: Stephan Aiche, Marc Sturm$
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
38 
39 namespace OpenMS
40 {
41 
49  class OPENMS_DLLAPI GaussTraceFitter :
50  public TraceFitter
51  {
52 public:
54 
56 
58 
59  ~GaussTraceFitter() override;
60 
61  // override important methods
63 
64  double getLowerRTBound() const override;
65 
66  double getUpperRTBound() const override;
67 
68  double getHeight() const override;
69 
70  double getCenter() const override;
71 
72  double getFWHM() const override;
73 
77  double getSigma() const;
78 
79  bool checkMaximalRTSpan(const double max_rt_span) override;
80 
81  bool checkMinimalRTSpan(const std::pair<double, double>& rt_bounds, const double min_rt_span) override;
82 
83  double getValue(double rt) const override;
84 
85  double getArea() override;
86 
87  String getGnuplotFormula(const FeatureFinderAlgorithmPickedHelperStructs::MassTrace& trace, const char function_name, const double baseline, const double rt_shift) override;
88 
89 protected:
90  double sigma_;
91  double x0_;
92  double height_;
94 
95  static const Size NUM_PARAMS_;
96 
97  void getOptimizedParameters_(const Eigen::VectorXd& s) override;
98 
101  {
102 public:
103  GaussTraceFunctor(int dimensions,
104  const TraceFitter::ModelData* data);
105 
106  int operator()(const Eigen::VectorXd& x, Eigen::VectorXd& fvec) override;
107 
108  // compute Jacobian matrix for the different parameters
109  int df(const Eigen::VectorXd& x, Eigen::MatrixXd& J) override;
110 protected:
112  };
113 
115 
116  void updateMembers_() override;
117 
118  };
119 
120 } // namespace OpenMS
121 
Definition: GaussTraceFitter.h:101
int operator()(const Eigen::VectorXd &x, Eigen::VectorXd &fvec) override
int df(const Eigen::VectorXd &x, Eigen::MatrixXd &J) override
GaussTraceFunctor(int dimensions, const TraceFitter::ModelData *data)
const TraceFitter::ModelData * m_data
Definition: GaussTraceFitter.h:111
Fitter for RT profiles using a Gaussian background model.
Definition: GaussTraceFitter.h:51
double getLowerRTBound() const override
double getHeight() const override
double x0_
Definition: GaussTraceFitter.h:91
bool checkMaximalRTSpan(const double max_rt_span) override
double getFWHM() const override
double getArea() override
double sigma_
Definition: GaussTraceFitter.h:90
void fit(FeatureFinderAlgorithmPickedHelperStructs::MassTraces &traces) override
double getUpperRTBound() const override
double getValue(double rt) const override
GaussTraceFitter(const GaussTraceFitter &other)
String getGnuplotFormula(const FeatureFinderAlgorithmPickedHelperStructs::MassTrace &trace, const char function_name, const double baseline, const double rt_shift) override
void getOptimizedParameters_(const Eigen::VectorXd &s) override
double getCenter() const override
GaussTraceFitter & operator=(const GaussTraceFitter &source)
double height_
Definition: GaussTraceFitter.h:92
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:95
double region_rt_span_
Definition: GaussTraceFitter.h:93
void setInitialParameters_(FeatureFinderAlgorithmPickedHelperStructs::MassTraces &traces)
bool checkMinimalRTSpan(const std::pair< double, double > &rt_bounds, const double min_rt_span) override
A more convenient string class.
Definition: String.h:60
Definition: TraceFitter.h:70
Abstract fitter for RT profile fitting.
Definition: TraceFitter.h:64
Definition: TraceFitter.h:175
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Definition: IsobaricIsotopeCorrector.h:43
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
Helper struct for mass traces used in FeatureFinderAlgorithmPicked.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:80
Helper struct for a collection of mass traces used in FeatureFinderAlgorithmPicked.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:111