bpp-core3  3.0.0
StatTools.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_NUMERIC_STAT_STATTOOLS_H
6 #define BPP_NUMERIC_STAT_STATTOOLS_H
7 
8 
9 // From the STL:
10 #include <vector>
11 #include <cstddef>
12 
13 namespace bpp
14 {
18 class StatTools
19 {
20 private:
21  struct PValue_
22  {
23  double pvalue_;
24  size_t index_;
25  PValue_(double pvalue, size_t index) :
26  pvalue_(pvalue),
27  index_(index) {}
28 
29  bool operator<(const PValue_& pvalue) const
30  {
31  return pvalue.pvalue_ < pvalue_;
32  }
33  };
34 
35 public:
52  static std::vector<double> computeFdr(const std::vector<double>& pvalues);
53 };
54 } // end of namespace bpp.
55 #endif // BPP_NUMERIC_STAT_STATTOOLS_H
Statistics tools and utilitary functions.
Definition: StatTools.h:18
PValue_(double pvalue, size_t index)
Definition: StatTools.h:25
bool operator<(const PValue_ &pvalue) const
Definition: StatTools.h:29
static std::vector< double > computeFdr(const std::vector< double > &pvalues)
Compute the false discovery rate for a set of input p-values, using Benjamini and Hochberg&#39;s &#39;FDR&#39; me...
Definition: StatTools.cpp:13