OpenMS
LabeledPairFinder.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: Marc Sturm $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 
13 #include <cmath>
14 
15 namespace OpenMS
16 {
29  class OPENMS_DLLAPI LabeledPairFinder :
30  public BaseGroupFinder
31  {
32 
33 public:
34 
37 
39  inline ~LabeledPairFinder() override
40  {
41  }
42 
45  {
46  return new LabeledPairFinder();
47  }
48 
50  static const String getProductName()
51  {
52  return "labeled_pair_finder";
53  }
54 
65  void run(const std::vector<ConsensusMap> & input_maps, ConsensusMap & result_map) override;
66 
67 protected:
68 
70  inline double PValue_(double x, double m, double sig1, double sig2)
71  {
72  if (m < x)
73  {
74  return 1 - std::erf((x - m) / sig2 / 0.707106781);
75  }
76  else
77  {
78  return 1 - std::erf((m - x) / sig1 / 0.707106781);
79  }
80  }
81 
82 private:
83 
86 
89 
90  }; // end of class LabeledPairFinder
91 
92 } // end of namespace OpenMS
93 
The base class of all element group finding algorithms.
Definition: BaseGroupFinder.h:38
A container for consensus elements.
Definition: ConsensusMap.h:66
The LabeledPairFinder allows the matching of labeled features (features with a fixed distance).
Definition: LabeledPairFinder.h:31
LabeledPairFinder()
Default constructor.
~LabeledPairFinder() override
Destructor.
Definition: LabeledPairFinder.h:39
LabeledPairFinder & operator=(const LabeledPairFinder &source)
Assignment operator not implemented => private.
void run(const std::vector< ConsensusMap > &input_maps, ConsensusMap &result_map) override
Run the algorithm.
LabeledPairFinder(const LabeledPairFinder &source)
Copy constructor not implemented => private.
static BaseGroupFinder * create()
Returns an instance of this class.
Definition: LabeledPairFinder.h:44
static const String getProductName()
Returns the name of this module.
Definition: LabeledPairFinder.h:50
double PValue_(double x, double m, double sig1, double sig2)
return the p-value at position x for the bi-Gaussian distribution with mean m and standard deviation ...
Definition: LabeledPairFinder.h:70
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22