|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file.
50 edge_distribution_.
prepare( sample );
51 extra_placement_distribution_.
prepare( sample );
52 like_weight_ratio_distribution_.
prepare( sample );
53 proximal_length_distribution_.
prepare( sample );
54 pendant_length_distribution_.
prepare( sample );
64 for (
size_t i = 0; i < n; ++i) {
70 size_t edge_idx = edge_distribution_.
generate();
75 add_random_placement( pqry, edge );
78 auto extra_edge_idcs = extra_placement_distribution_.
generate( edge );
79 for(
auto extra_edge_idx : extra_edge_idcs ) {
83 assert( extra_edge_idx != edge_idx );
87 auto& extra_edge = sample.
tree().
edge_at( extra_edge_idx );
88 add_random_placement( pqry, extra_edge );
PlacementTree & tree()
Get the PlacementTree of this Sample.
double generate()
Return a randomly chosen like weight ratio.
void generate(Sample &sample, size_t n)
Generate n many Pqueries and place them in the Sample.
size_t size() const
Return the number of Pqueries that are stored in this Sample.
size_t generate()
Return a randomly chosen edge index, according to the distribution.
Manage a set of Pqueries along with the PlacementTree where the PqueryPlacements are placed on.
void prepare(Sample const &sample)
Prepare the distribution for usage. Needs to be called before generate().
TreeEdge & edge_at(size_t index)
Return the TreeEdge at a certain index.
Pquery & add()
Create an empty Pquery, add it to the Sample and return it.
void prepare(Sample const &sample)
Prepare the distribution for usage. Needs to be called before generate().
Provides functions for working with Placements and Pqueries.
std::string to_string(GenomeLocus const &locus)
void prepare(Sample const &sample)
Prepare the distribution for usage. Needs to be called before generate().
double like_weight_ratio
Likelihood weight ratio of this placement.
A pquery holds a set of PqueryPlacements and a set of PqueryNames.
PqueryName & add_name(std::string name="", double multiplicity=1.0)
Create a new PqueryName using the provided parameters, add it to the Pquery and return it.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
void prepare(Sample const &sample)
Prepare the distribution for usage. Needs to be called before generate().
void normalize_weight_ratios(Pquery &pquery)
Recalculate the like_weight_ratio of the PqueryPlacement&s of a Pquery, so that their sum is 1....
One placement position of a Pquery on a Tree.
PqueryPlacement & add_placement(PlacementTreeEdge &edge)
Create a new PqueryPlacement at a given PlacementTreeEdge, add it to the Pquery and return it.
double generate(PlacementTreeEdge const &edge)
Return a randomly chosen position on an edge.
double proximal_length
Distance of this placement to the next node towards the root.
double generate(PlacementTreeEdge const &edge)
Return a randomly chosen position on an edge.
size_t edge_count() const
Return the number of TreeEdges of the Tree.
double pendant_length
Length of the attached branch of this placement.