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

#include <quetzal/coalescence/policies/distance_to_parent.hpp>

Detailed Description

template<typename Space, typename Time>
class quetzal::coalescence::newick_with_distance_to_parent< Space, Time >

Policy class for coalescing gene copies into a Newick formula.

Policy class for coalescing gene copies into a Newick formula, computing distances (in generations) to parent nodes.

Template Parameters
Spacecoordinate type
Timetime type

Classes

class  cell_type
 
struct  treatment
 Treatment to operate on a DFS on the tree to compute branches length. More...
 

Public Types

using coord_type = Space
 
using time_type = Time
 
using tree_type = quetzal::coalescence::container::Tree< cell_type >
 
using forest_type = quetzal::coalescence::container::Forest< coord_type, tree_type >
 

Public Member Functions

void ancestral_Wright_Fisher_N (unsigned int value)
 Set the size of the putative ancestral Wright-Fisher population preceding the spatial history.
 
unsigned int ancestral_Wright_Fisher_N () const
 Get the size of the putative ancestral Wright-Fisher population preceding the spatial history.
 
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.
 

Static Public Member Functions

static auto make_forest (std::map< coord_type, unsigned int > const &sample_counts, time_type const &sampling_time)
 Make a forest respecting the policy from a geographic sample.
 
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.
 
static std::string treat (tree_type &tree)
 Visit the whole tree and builds its Newick formula.
 

Member Typedef Documentation

◆ coord_type

template<typename Space , typename Time >
using quetzal::coalescence::newick_with_distance_to_parent< Space, Time >::coord_type = Space

Geographic coordinate type

◆ forest_type

template<typename Space , typename Time >
using quetzal::coalescence::newick_with_distance_to_parent< Space, Time >::forest_type = quetzal::coalescence::container::Forest<coord_type, tree_type>

The type used to represent a spatial forest of genealogies

◆ time_type

template<typename Space , typename Time >
using quetzal::coalescence::newick_with_distance_to_parent< Space, Time >::time_type = Time

Time type

◆ tree_type

template<typename Space , typename Time >
using quetzal::coalescence::newick_with_distance_to_parent< Space, Time >::tree_type = quetzal::coalescence::container::Tree<cell_type>

The type used to represent a genealogy

Member Function Documentation

◆ ancestral_Wright_Fisher_N() [1/2]

template<typename Space , typename Time >
unsigned int quetzal::coalescence::newick_with_distance_to_parent< Space, Time >::ancestral_Wright_Fisher_N ( ) const
inline

Get the size of the putative ancestral Wright-Fisher population preceding the spatial history.

Returns
The Wright-Fisher population size

◆ ancestral_Wright_Fisher_N() [2/2]

template<typename Space , typename Time >
void quetzal::coalescence::newick_with_distance_to_parent< Space, Time >::ancestral_Wright_Fisher_N ( unsigned int  value)
inline

Set the size of the putative ancestral Wright-Fisher population preceding the spatial history.

Parameters
valueThe Wright-Fisher population size

◆ branch()

template<typename Space , typename Time >
static auto quetzal::coalescence::newick_with_distance_to_parent< 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< 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< 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 >
static auto quetzal::coalescence::newick_with_distance_to_parent< Space, Time >::make_forest ( std::map< coord_type, unsigned int > const &  sample_counts,
time_type const &  sampling_time 
)
inlinestatic

Make a forest respecting the policy from a geographic sample.

Parameters
sample_countsA map giving for each deme the number of sampled gene copies
sampling_timeAt what time the gene copies are sampled.
Returns
A forest compliant with the policy chosen.

◆ treat()

template<typename Space , typename Time >
static std::string quetzal::coalescence::newick_with_distance_to_parent< Space, Time >::treat ( tree_type tree)
inlinestatic

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: