OpenMS
FeatureFinderAlgorithm.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: Timo Sachsenberg $
6 // $Authors: $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
16 
17 namespace OpenMS
18 {
19 
20  // forward declaration
21  class FeatureFinder;
22  class FeatureMap;
23 
25  struct OPENMS_DLLAPI Summary
26  {
27  std::map<String, UInt> exception;
29  std::map<String, UInt> mz_model;
30  std::map<float, UInt> mz_stdev;
31  std::vector<UInt> charge;
32  double corr_mean, corr_max, corr_min; //boxplot for correlation
33 
35  Summary() :
36  no_exceptions(0),
37  corr_mean(0),
38  corr_max(0),
39  corr_min(1)
40  {}
41 
42  };
43 
49  public DefaultParamHandler
50  {
51 public:
53  typedef PeakMap MapType;
58 
61  DefaultParamHandler("FeatureFinderAlgorithm"),
62  map_(nullptr),
63  features_(nullptr),
64  ff_(nullptr)
65  {
66  }
67 
70  {
71  }
72 
74  static void registerChildren();
75 
77  virtual void run() = 0;
78 
84  virtual Param getDefaultParameters() const
85  {
86  return this->defaults_;
87  }
88 
90  void setData(const MapType& map, FeatureMap& features, FeatureFinder& ff)
91  {
92  map_ = &map;
93  features_ = &features;
94  ff_ = &ff;
95  }
96 
102  virtual void setSeeds(const FeatureMap& seeds)
103  {
104  if (!seeds.empty())
105  {
106  throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "The used feature detection algorithm does not support user-specified seed lists!");
107  }
108  }
109 
110 protected:
111 
113  const MapType* map_;
114 
117 
120 
121 private:
122 
125 
128 
129  };
130 }
131 
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
Param defaults_
Container for default parameters. This member should be filled in the constructor of derived classes!
Definition: DefaultParamHandler.h:146
A method or algorithm argument contains illegal values.
Definition: Exception.h:624
bool empty() const noexcept
Definition: ExposedVector.h:133
Abstract base class for FeatureFinder algorithms.
Definition: FeatureFinderAlgorithm.h:50
virtual void run()=0
Main method that implements the actual algorithm.
virtual void setSeeds(const FeatureMap &seeds)
Sets a reference to the calling FeatureFinder.
Definition: FeatureFinderAlgorithm.h:102
const MapType * map_
Input data pointer.
Definition: FeatureFinderAlgorithm.h:113
void setData(const MapType &map, FeatureMap &features, FeatureFinder &ff)
Sets a reference to the calling FeatureFinder.
Definition: FeatureFinderAlgorithm.h:90
~FeatureFinderAlgorithm() override
destructor
Definition: FeatureFinderAlgorithm.h:69
static void registerChildren()
register all derived classes here (see FeatureFinderAlgorithm_impl.h)
FeatureFinderAlgorithm(const FeatureFinderAlgorithm &)
Not implemented.
PeakMap MapType
Input map type.
Definition: FeatureFinderAlgorithm.h:53
FeatureFinderAlgorithm()
default constructor
Definition: FeatureFinderAlgorithm.h:60
FeatureFinderAlgorithm & operator=(const FeatureFinderAlgorithm &)
Not implemented.
virtual Param getDefaultParameters() const
Returns the default parameters. Reimplement.
Definition: FeatureFinderAlgorithm.h:84
FeatureMap * features_
Output data pointer.
Definition: FeatureFinderAlgorithm.h:116
MapType::IntensityType IntensityType
Intensity type of peaks.
Definition: FeatureFinderAlgorithm.h:57
FeatureFinder * ff_
Pointer to the calling FeatureFinder that is used to access the feature flags.
Definition: FeatureFinderAlgorithm.h:119
MapType::CoordinateType CoordinateType
Coordinate/Position type of peaks.
Definition: FeatureFinderAlgorithm.h:55
The main feature finder class.
Definition: FeatureFinder.h:33
A container for features.
Definition: FeatureMap.h:80
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
PeakType::CoordinateType CoordinateType
Coordinate type of peak positions.
Definition: MSExperiment.h:59
PeakType::IntensityType IntensityType
Intensity type of peaks.
Definition: MSExperiment.h:61
Management and storage of parameters / INI files.
Definition: Param.h:44
unsigned int UInt
Unsigned integer type.
Definition: Types.h:68
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Summary of fitting results.
Definition: FeatureFinderAlgorithm.h:26
std::map< String, UInt > exception
count exceptions
Definition: FeatureFinderAlgorithm.h:27
std::map< float, UInt > mz_stdev
count used mz standard deviations
Definition: FeatureFinderAlgorithm.h:30
double corr_max
Definition: FeatureFinderAlgorithm.h:32
std::vector< UInt > charge
count used charges
Definition: FeatureFinderAlgorithm.h:31
std::map< String, UInt > mz_model
count used mz models
Definition: FeatureFinderAlgorithm.h:29
UInt no_exceptions
Definition: FeatureFinderAlgorithm.h:28
Summary()
Initial values.
Definition: FeatureFinderAlgorithm.h:35