barry: Your go-to motif accountant  0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
Flock Class Reference

A Flock is a group of Geese. More...

#include <flock-bones.hpp>

Public Member Functions

 Flock ()
 
 ~Flock ()
 
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. More...
 
void set_seed (const size_t &s)
 Set the seed of the model. More...
 
void init (size_t bar_width=BARRY_PROGRESS_BAR_WIDTH)
 
PhyloCountersget_counters ()
 
PhyloSupportget_support_fun ()
 
std::vector< double > * get_stats_support ()
 
std::vector< std::vector< double > > * get_stats_target ()
 
PhyloModelget_model ()
 
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. More...
 
Geeseoperator() (size_t i, bool check_bounds=true)
 Access the i-th geese element. More...
 
Information about the model
size_t nfuns () const noexcept
 
size_t ntrees () const noexcept
 
std::vector< size_t > nnodes () const noexcept
 
std::vector< size_t > nleafs () const noexcept
 
size_t nterms () const
 
size_t support_size () const noexcept
 
std::vector< std::string > colnames () const
 
size_t parse_polytomies (bool verb=true, std::vector< size_t > *dist=nullptr) const noexcept
 Check polytomies and return the largest. More...
 
void print () const
 

Public Attributes

std::vector< Geesedat
 
size_t nfunctions = 0u
 
bool initialized = false
 
std::mt19937 rengine
 
PhyloModel model = PhyloModel()
 

Detailed Description

A Flock is a group of Geese.

This object buils a model with multiple trees (Geese objects), with all of these using the same PhyloModel object. Available counters (terms) can be found in counter-phylo.

Definition at line 14 of file flock-bones.hpp.

Constructor & Destructor Documentation

◆ Flock()

Flock::Flock ( )
inline

Definition at line 25 of file flock-bones.hpp.

◆ ~Flock()

Flock::~Flock ( )
inline

Definition at line 26 of file flock-bones.hpp.

Member Function Documentation

◆ add_data()

size_t Flock::add_data ( std::vector< std::vector< size_t > > &  annotations,
std::vector< size_t > &  geneid,
std::vector< int > &  parent,
std::vector< bool > &  duplication 
)
inline

Add a tree to the flock.

Parameters
annotationssee Geese::Geese.
geneidsee Geese.
parentsee Geese.
duplicationsee Geese.
Returns
size_t The number of tree in the model (starting from zero).

Definition at line 6 of file flock-meat.hpp.

◆ colnames()

std::vector< std::string > Flock::colnames ( ) const
inline

Definition at line 246 of file flock-meat.hpp.

◆ get_counters()

PhyloCounters * Flock::get_counters ( )
inline

Definition at line 100 of file flock-meat.hpp.

◆ get_model()

PhyloModel * Flock::get_model ( )
inline

Definition at line 131 of file flock-meat.hpp.

◆ get_stats_support()

std::vector< double > * Flock::get_stats_support ( )
inline

Definition at line 117 of file flock-meat.hpp.

◆ get_stats_target()

std::vector< std::vector< double > > * Flock::get_stats_target ( )
inline

Definition at line 124 of file flock-meat.hpp.

◆ get_support_fun()

PhyloSupport * Flock::get_support_fun ( )
inline

Definition at line 110 of file flock-meat.hpp.

◆ init()

void Flock::init ( size_t  bar_width = BARRY_PROGRESS_BAR_WIDTH)
inline

Definition at line 49 of file flock-meat.hpp.

◆ likelihood_joint()

double Flock::likelihood_joint ( const std::vector< double > &  par,
bool  as_log = false,
bool  use_reduced_sequence = true,
size_t  ncores = 1u 
)
inline

Returns the joint likelihood of the model.

Parameters
parVector of model parameters.
as_logWhen true it will return the value as log.
use_reduced_sequenceWhen true (default) will compute the likelihood using the reduced sequence, which is faster.
Returns
double

Definition at line 138 of file flock-meat.hpp.

◆ nfuns()

size_t Flock::nfuns ( ) const
inlinenoexcept

Definition at line 189 of file flock-meat.hpp.

◆ nleafs()

std::vector< size_t > Flock::nleafs ( ) const
inlinenoexcept

Definition at line 217 of file flock-meat.hpp.

◆ nnodes()

std::vector< size_t > Flock::nnodes ( ) const
inlinenoexcept

Definition at line 203 of file flock-meat.hpp.

◆ nterms()

size_t Flock::nterms ( ) const
inline

Definition at line 231 of file flock-meat.hpp.

◆ ntrees()

size_t Flock::ntrees ( ) const
inlinenoexcept

Definition at line 196 of file flock-meat.hpp.

◆ operator()()

Geese * Flock::operator() ( size_t  i,
bool  check_bounds = true 
)
inline

Access the i-th geese element.

Parameters
iElement to access
check_boundsWhen true, it will check bounds.
Returns
Geese*

Definition at line 324 of file flock-meat.hpp.

◆ parse_polytomies()

size_t Flock::parse_polytomies ( bool  verb = true,
std::vector< size_t > *  dist = nullptr 
) const
inlinenoexcept

Check polytomies and return the largest.

Definition at line 253 of file flock-meat.hpp.

◆ print()

void Flock::print ( ) const
inline

Definition at line 280 of file flock-meat.hpp.

◆ set_seed()

void Flock::set_seed ( const size_t &  s)
inline

Set the seed of the model.

Parameters
sPassed to the rengine.seed() member object.

Definition at line 42 of file flock-meat.hpp.

◆ support_size()

size_t Flock::support_size ( ) const
inlinenoexcept

Definition at line 239 of file flock-meat.hpp.

Member Data Documentation

◆ dat

std::vector< Geese > Flock::dat

Definition at line 17 of file flock-bones.hpp.

◆ initialized

bool Flock::initialized = false

Definition at line 19 of file flock-bones.hpp.

◆ model

PhyloModel Flock::model = PhyloModel()

Definition at line 23 of file flock-bones.hpp.

◆ nfunctions

size_t Flock::nfunctions = 0u

Definition at line 18 of file flock-bones.hpp.

◆ rengine

std::mt19937 Flock::rengine

Definition at line 22 of file flock-bones.hpp.


The documentation for this class was generated from the following files: