barry: Your go-to motif accountant  0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
flock-bones.hpp
Go to the documentation of this file.
1 #ifndef GEESE_FLOCK_BONES_HPP
2 #define GEESE_FLOCK_BONES_HPP 1
3 
4 class Geese;
5 
14 class Flock {
15 public:
16 
17  std::vector< Geese > dat;
18  size_t nfunctions = 0u;
19  bool initialized = false;
20 
21  // Common components
22  std::mt19937 rengine;
24 
25  Flock() {};
26  ~Flock() {};
27 
37  size_t add_data(
38  std::vector< std::vector<size_t> > & annotations,
39  std::vector< size_t > & geneid,
40  std::vector< int > & parent,
41  std::vector< bool > & duplication
42  );
43 
49  void set_seed(const size_t & s);
50 
51  void init(size_t bar_width = BARRY_PROGRESS_BAR_WIDTH);
52 
53  // void add_geese(Geese x);
56  std::vector< double > * get_stats_support();
57  std::vector< std::vector< double > > * get_stats_target();
59 
69  double likelihood_joint(
70  const std::vector< double > & par,
71  bool as_log = false,
72  bool use_reduced_sequence = true,
73  size_t ncores = 1u
74  );
75 
80  size_t nfuns() const noexcept;
81  size_t ntrees() const noexcept;
82  std::vector< size_t > nnodes() const noexcept;
83  std::vector< size_t > nleafs() const noexcept;
84  size_t nterms() const;
85  size_t support_size() const noexcept;
86  std::vector< std::string > colnames() const;
87  size_t parse_polytomies(
88  bool verb = true,
89  std::vector< size_t > * dist = nullptr
90  ) const noexcept;
91  void print() const;
93 
101  Geese * operator()(size_t i, bool check_bounds = true);
102 
103 };
104 
105 #endif
A Flock is a group of Geese.
Definition: flock-bones.hpp:14
PhyloModel model
Definition: flock-bones.hpp:23
std::mt19937 rengine
Definition: flock-bones.hpp:22
std::vector< std::string > colnames() const
Definition: flock-meat.hpp:246
PhyloCounters * get_counters()
Definition: flock-meat.hpp:100
std::vector< double > * get_stats_support()
Definition: flock-meat.hpp:117
void set_seed(const size_t &s)
Set the seed of the model.
Definition: flock-meat.hpp:42
std::vector< std::vector< double > > * get_stats_target()
Definition: flock-meat.hpp:124
size_t nfuns() const noexcept
Definition: flock-meat.hpp:189
size_t parse_polytomies(bool verb=true, std::vector< size_t > *dist=nullptr) const noexcept
Check polytomies and return the largest.
Definition: flock-meat.hpp:253
void print() const
Definition: flock-meat.hpp:280
void init(size_t bar_width=BARRY_PROGRESS_BAR_WIDTH)
Definition: flock-meat.hpp:49
size_t add_data(std::vector< std::vector< size_t > > &annotations, std::vector< size_t > &geneid, std::vector< int > &parent, std::vector< bool > &duplication)
Add a tree to the flock.
Definition: flock-meat.hpp:6
std::vector< size_t > nleafs() const noexcept
Definition: flock-meat.hpp:217
size_t nterms() const
Definition: flock-meat.hpp:231
PhyloModel * get_model()
Definition: flock-meat.hpp:131
bool initialized
Definition: flock-bones.hpp:19
size_t support_size() const noexcept
Definition: flock-meat.hpp:239
double likelihood_joint(const std::vector< double > &par, bool as_log=false, bool use_reduced_sequence=true, size_t ncores=1u)
Returns the joint likelihood of the model.
Definition: flock-meat.hpp:138
PhyloSupport * get_support_fun()
Definition: flock-meat.hpp:110
std::vector< size_t > nnodes() const noexcept
Definition: flock-meat.hpp:203
size_t ntrees() const noexcept
Definition: flock-meat.hpp:196
std::vector< Geese > dat
Definition: flock-bones.hpp:17
size_t nfunctions
Definition: flock-bones.hpp:18
Annotated Phylo Model.
size_t i
Data_Type &&counter_ noexcept
barry::Counters< PhyloArray, PhyloCounterData > PhyloCounters
barry::Model< PhyloArray, PhyloCounterData, PhyloRuleData, PhyloRuleDynData > PhyloModel
barry::Support< PhyloArray, PhyloCounterData, PhyloRuleData, PhyloRuleDynData > PhyloSupport
#define BARRY_PROGRESS_BAR_WIDTH
Definition: progress.hpp:5