Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::coalescence::newick_with_distance_to_parent_and_leaf_name< Space, Time > Class Template Reference

Classes

class  cell_type
 Inner class defining what data type the tree stores. More...
 
struct  treatment
 

Public Types

using coord_type = Space
 Geographic coordinate type.
 
using time_type = Time
 Time type.
 
using tree_type = quetzal::coalescence::container::Tree< cell_type >
 The type used to represent a genealogy.
 
using forest_type = quetzal::coalescence::container::Forest< coord_type, tree_type >
 The type used to represent a spatial forest of genealogies.
 

Public Member Functions

void ancestral_Wright_Fisher_N (unsigned int value)
 
template<typename Generator >
tree_type find_mrca (forest_type const &forest, time_type const &first_time, Generator &gen) const
 Coalesce the given forest into a discrete time Wright-Fisher model.
 
std::string treat (tree_type &tree) const
 Visit the whole tree and builds its Newick formula.
 

Static Public Member Functions

template<typename F >
static auto make_forest (std::map< coord_type, unsigned int > const &sample_counts, time_type const &sampling_time, F get_name)
 Make a forest respecting the policy from a geographic sample.
 
template<typename T , typename F1 , typename F2 >
static auto make_forest (std::vector< T > sample, time_type const &sampling_time, F1 get_location, F2 get_name)
 
static auto branch ()
 Get the functor interface required to branch a parent node to a child node.
 
static auto init ()
 Get the functor interface required to initialize a node.
 

Member Function Documentation

◆ branch()

template<typename Space , typename Time >
static auto quetzal::coalescence::newick_with_distance_to_parent_and_leaf_name< Space, Time >::branch ( )
inlinestatic

Get the functor interface required to branch a parent node to a child node.

Returns
A functor to forward to quetzal coalescence algorithms.

◆ find_mrca()

template<typename Space , typename Time >
template<typename Generator >
tree_type quetzal::coalescence::newick_with_distance_to_parent_and_leaf_name< Space, Time >::find_mrca ( forest_type const &  forest,
time_type const &  first_time,
Generator &  gen 
) const
inline

Coalesce the given forest into a discrete time Wright-Fisher model.

Template Parameters
GeneratorThe type of random generator.
Parameters
forestThe forest to coalesce.
first_timeThe time at which coalescence begins
genThe random generator
Returns
A single tree with root being the MRCA.

◆ init()

template<typename Space , typename Time >
static auto quetzal::coalescence::newick_with_distance_to_parent_and_leaf_name< Space, Time >::init ( )
inlinestatic

Get the functor interface required to initialize a node.

Returns
A functor to forward to quetzal coalescence algorithms.

◆ make_forest()

template<typename Space , typename Time >
template<typename F >
static auto quetzal::coalescence::newick_with_distance_to_parent_and_leaf_name< Space, Time >::make_forest ( std::map< coord_type, unsigned int > const &  sample_counts,
time_type const &  sampling_time,
get_name 
)
inlinestatic

Make a forest respecting the policy from a geographic sample.

Template Parameters
Fthe type of functor used to get the name of a tip.
Parameters
sample_countsA map giving for each deme the number of sampled gene copies
sampling_timeAt what time the gene copies are sampled.
get_namefunctor fabricating a name for each tip node and according to two parameters: its deme location and the time of sampling. Signature should be equivalent to std::string f(coord_type const& x, time_type t)
Returns
A forest compliant with the policy chosen.

◆ treat()

template<typename Space , typename Time >
std::string quetzal::coalescence::newick_with_distance_to_parent_and_leaf_name< Space, Time >::treat ( tree_type tree) const
inline

Visit the whole tree and builds its Newick formula.

Parameters
treeThe tree to visit.
Returns
The newick formula of the tree.

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