biomcmc-lib  0.1
low level library for phylogenetic analysis
topology_randomise.h
Go to the documentation of this file.
1 /*
2  * This file is part of biomcmc-lib, a low-level library for phylogenomic analysis.
3  * Copyright (C) 2019-today Leonardo de Oliveira Martins [ leomrtns at gmail.com; http://www.leomartins.org ]
4  *
5  * biomcmc is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6  * License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7  * version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
10  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
11  * details (file "COPYING" or http://www.gnu.org/copyleft/gpl.html).
12  */
13 
19 #ifndef _biomcmc_randomise_h_
20 #define _biomcmc_randomise_h_
21 
22 #include "topology_distance.h"
23 #include "prob_distribution.h"
24 
26 void randomise_topology (topology tree);
28 void quasi_randomise_topology (topology tree, int sample_type);
29 
30 void create_parent_node_from_children (topology tree, int parent, int lchild, int rchild);
32 void topology_apply_rerooting (topology tree, bool update_done);
34 void topology_apply_shortspr (topology tree, bool update_done);
36 void topology_apply_shortspr_weighted (topology tree, double *prob, bool update_done);
38 void topology_apply_spr_on_subtree (topology tree, topol_node lca, bool update_done);
40 void topology_apply_spr (topology tree, bool update_done);
42 void topology_apply_spr_unrooted (topology tree, bool update_done);
44 void topology_apply_nni (topology tree, bool update_done);
46 bool cant_apply_swap (topology tree);
47 
48 #endif
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)
Definition: topology_randomise.c:109
void topology_apply_shortspr(topology tree, bool update_done)
recursive SPR over all internal nodes, assuming common prob of swap per node
Definition: topology_randomise.c:145
Probability distribution functions and auxiliary mathematical functions from statistical package R...
branch length operations on topologies, including patristic distances
void topology_apply_spr_unrooted(topology tree, bool update_done)
random Subtree Prune-and-Regraft branch swapping generalized (neglecting root)
Definition: topology_randomise.c:341
void topology_apply_spr(topology tree, bool update_done)
random Subtree Prune-and-Regraft branch swapping
Definition: topology_randomise.c:326
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"...
Definition: topology_randomise.c:52
void randomise_topology(topology tree)
low level function that generates a random tree (equiv. to random refinement of a star topology) ...
Definition: topology_randomise.c:22
bool cant_apply_swap(topology tree)
check if it is possible to apply SPR/NNI without rerooting (used by topology_apply_spr() and MCMC fun...
Definition: topology_randomise.c:471
Information of a node (binary tree).
Definition: topology_common.h:35
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 ...
Definition: topology_randomise.c:163
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
Definition: topology_randomise.c:258
void topology_apply_nni(topology tree, bool update_done)
random Nearest Neighbor Interchange branch swapping (SPR where regraft node is close to prune node) ...
Definition: topology_randomise.c:409
Binary unrooted topology (rooted at leaf with ID zero)
Definition: topology_common.h:47
void topology_apply_rerooting(topology tree, bool update_done)
random rerooting
Definition: topology_randomise.c:120