OpenMS
FineIsotopePatternGenerator.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Rost $
6 // $Authors: Hannes Rost $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 
13 namespace OpenMS
14 {
15 
96  class OPENMS_DLLAPI FineIsotopePatternGenerator
98  {
99 
100  public:
101 
107 
122  FineIsotopePatternGenerator(double stop_condition, bool use_total_prob = true, bool absolute = false) :
123  stop_condition_(stop_condition),
124  absolute_(absolute),
125  use_total_prob_(use_total_prob)
126  {}
127 
139  IsotopeDistribution run(const EmpiricalFormula&) const override;
140 
142  void setThreshold(double stop_condition)
143  {
144  stop_condition_ = stop_condition;
145  }
146 
148  double getThreshold() const
149  {
150  return stop_condition_;
151  }
152 
154  void setAbsolute(bool absolute)
155  {
156  absolute_ = absolute;
157  }
158 
160  bool getAbsolute() const
161  {
162  return absolute_;
163  }
164 
166  void setTotalProbability(bool total)
167  {
168  use_total_prob_ = total;
169  }
170 
172  bool getTotalProbability() const
173  {
174  return use_total_prob_;
175  }
176 
177  protected:
178  double stop_condition_ = 0.01;
179  bool absolute_ = false;
180  bool use_total_prob_ = true;
181 
182  };
183 
184 } // namespace OpenMS
185 
Representation of an empirical formula.
Definition: EmpiricalFormula.h:59
Isotope pattern generator for fine isotope distributions.
Definition: FineIsotopePatternGenerator.h:98
void setAbsolute(bool absolute)
Set whether threshold is absolute or relative probability (ignored if use_total_prob is true,...
Definition: FineIsotopePatternGenerator.h:154
bool getTotalProbability() const
Returns whether total probability should be computed (see FineIsotopePatternGenerator() )
Definition: FineIsotopePatternGenerator.h:172
bool getAbsolute() const
Returns whether threshold is absolute or relative probability (ignored if use_total_prob is true,...
Definition: FineIsotopePatternGenerator.h:160
FineIsotopePatternGenerator()=default
Default Constructor.
IsotopeDistribution run(const EmpiricalFormula &) const override
Creates an isotope distribution from an empirical sum formula.
double getThreshold() const
Get probability stop condition (lower values generate fewer results)
Definition: FineIsotopePatternGenerator.h:148
void setThreshold(double stop_condition)
Set probability stop condition (lower values generate fewer results)
Definition: FineIsotopePatternGenerator.h:142
FineIsotopePatternGenerator(double stop_condition, bool use_total_prob=true, bool absolute=false)
Constructor.
Definition: FineIsotopePatternGenerator.h:122
void setTotalProbability(bool total)
Set whether total probability should be computed (see FineIsotopePatternGenerator() )
Definition: FineIsotopePatternGenerator.h:166
Definition: IsotopeDistribution.h:39
Provides an interface for different isotope pattern generator methods.
Definition: IsotopePatternGenerator.h:42
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22