biomcmc-lib  0.1
low level library for phylogenetic analysis
Functions
topology_randomise.h File Reference

Creation of random topologies and modification of existing ones through branch swapping. More...

#include "topology_distance.h"
#include "prob_distribution.h"
Include dependency graph for topology_randomise.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void randomise_topology (topology tree)
 low level function that generates a random tree (equiv. to random refinement of a star topology)
 
void quasi_randomise_topology (topology tree, int sample_type)
 generates a random topology if sample_type==0, but can reuse some info later to create a "correlated" tree
 
void create_parent_node_from_children (topology tree, int parent, int lchild, int rchild)
 create internal node with given children (children coalesce into parent node)
 
void topology_apply_rerooting (topology tree, bool update_done)
 random rerooting
 
void topology_apply_shortspr (topology tree, bool update_done)
 recursive SPR over all internal nodes, assuming common prob of swap per node
 
void topology_apply_shortspr_weighted (topology tree, double *prob, bool update_done)
 recursive SPR over all internal nodes, using prob[] vector as rough guide of error rate for node
 
void topology_apply_spr_on_subtree (topology tree, topol_node lca, bool update_done)
 random Subtree Prune-and-Regraft branch swapping for subtree below lca node
 
void topology_apply_spr (topology tree, bool update_done)
 random Subtree Prune-and-Regraft branch swapping
 
void topology_apply_spr_unrooted (topology tree, bool update_done)
 random Subtree Prune-and-Regraft branch swapping generalized (neglecting root)
 
void topology_apply_nni (topology tree, bool update_done)
 random Nearest Neighbor Interchange branch swapping (SPR where regraft node is close to prune node)
 
bool cant_apply_swap (topology tree)
 check if it is possible to apply SPR/NNI without rerooting (used by topology_apply_spr() and MCMC functions)
 

Detailed Description

Creation of random topologies and modification of existing ones through branch swapping.