MDA
|
This class provides several methods to read, compute and manipulate trees. More...
#include <Tree.hpp>
Public Member Functions | |
Tree & | operator= (const Tree &)=delete |
Tree & | operator= (Tree &&other) |
void | clear () |
Deletes all nodes from the tree. | |
size_t | n_species () const |
Returns the number of species in this tree. More... | |
const TreeNode * | root () const |
Returns pointer to the root of the tree. More... | |
TreeNode * | root () |
bool | empty () const |
Returns true if no species are in the node. More... | |
Constructors & Destructors | |
Tree () | |
Tree (const MDAT::Tree &)=delete | |
virtual | ~Tree () |
Tree computation methods | |
void | nj (const Matrix< float > &dist_mat, const std::vector< std::string > &names) |
Tree construction using the neighbour joining method. More... | |
void | upgma (const Matrix< float > &dist_mat, const std::vector< std::string > &names, std::vector< int > &n_members) |
Tree construction using the UPGMA method. More... | |
This class provides several methods to read, compute and manipulate trees.
MDAT::Tree::Tree | ( | ) |
Simple Constructor for a tree.
|
inline |
Returns true if no species are in the node.
|
inline |
Returns the number of species in this tree.
void MDAT::Tree::nj | ( | const Matrix< float > & | dist_mat, |
const std::vector< std::string > & | names | ||
) |
Tree construction using the neighbour joining method.
This method returns a rooted binary tree. As the method usually returns a unrooted tree one of the edge lengths of the tree has been set to 0. This method has been first described in: Saitou N, Nei M. "The neighbor-joining method: a new method for reconstructing phylogenetic trees." Molecular Biology and Evolution, volume 4, issue 4, pp. 406-425, July 1987.
dist_mat | A matrix giving the distances between the species. |
names | The names of the species. |
|
inline |
Returns pointer to the root of the tree.
void MDAT::Tree::upgma | ( | const Matrix< float > & | dist_mat, |
const std::vector< std::string > & | names, | ||
std::vector< int > & | n_members | ||
) |
Tree construction using the UPGMA method.
The UPGMA (Unweighted Pair Group Method with Arithmetic Mean) method has been first described in: Sokal R and Michener C (1958). "A statistical method for evaluating systematic relationships". University of Kansas Science Bulletin 38: 1409–1438.
dist_mat | A matrix giving the distances between the species. |
names | The names of the species. |