A library for working with phylogenetic and population genetic data.
v0.32.0
placement/function/helper.cpp File Reference

Detailed Description

Implementation of the Placement Functions.

Definition in file placement/function/helper.cpp.

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::placement
 

Functions

std::unordered_map< int, PlacementTreeEdge * > edge_num_to_edge_map (PlacementTree const &tree)
 Return a mapping of edge_num integers to the corresponding PlacementTreeEdge object. More...
 
std::unordered_map< int, PlacementTreeEdge * > edge_num_to_edge_map (Sample const &smp)
 Return a mapping of edge_num integers to the corresponding PlacementTreeEdge object. More...
 
bool has_consecutive_edge_nums (PlacementTree const &tree)
 Verify that the PlacementTree has no duplicate edge_nums and that they form consecutive numbers starting from 0. More...
 
bool has_correct_edge_nums (PlacementTree const &tree)
 Verify that the tree has correctly set edge nums. More...
 
std::vector< size_t > placement_count_per_edge (Sample const &sample)
 Return a vector that contains the number of PqueryPlacements per edge of the tree of the Sample. More...
 
utils::Matrix< size_t > placement_count_per_edge (SampleSet const &sample_set)
 
std::vector< std::vector< PqueryPlacement const * > > placements_per_edge (Sample const &smp, bool only_max_lwr_placements=false)
 Return a mapping from each PlacementTreeEdges to the PqueryPlacements that are placed on that edge. More...
 
std::vector< PqueryPlacement const * > placements_per_edge (Sample const &smp, PlacementTreeEdge const &edge)
 Return a vector of all PqueryPlacements that are placed on the given PlacementTreeEdge. More...
 
std::vector< PqueryPlain > plain_queries (Sample const &smp)
 Return a plain representation of all pqueries of this map. More...
 
std::vector< std::vector< Pquery const * > > pqueries_per_edge (Sample const &sample, bool only_max_lwr_placements=false)
 Return a mapping from each edge to the Pqueries on that edge. More...
 
void rectify_values (Sample &sample)
 Correct invalid values of the PqueryPlacements and PqueryNames as good as possible. More...
 
void rectify_values (SampleSet &sset)
 Correct invalid values of the PqueryPlacements and PqueryNames as good as possible. More...
 
void reset_edge_nums (PlacementTree &tree)
 Reset all edge nums of a PlacementTree. More...
 
bool validate (Sample const &smp, bool check_values=false, bool break_on_values=false)
 Validate the integrity of the pointers, references and data in a Sample object. More...