A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
placement/function/helper.hpp File Reference
#include "genesis/placement/sample.hpp"
#include "genesis/placement/sample_set.hpp"
#include "genesis/utils/math/matrix.hpp"
#include <unordered_map>
#include <vector>

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< double > placement_weight_per_edge (Sample const &sample)
 Return a vector that contains the sum of the weights of the PqueryPlacements per edge of the tree of the Sample. More...
 
utils::Matrix< double > placement_weight_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...