from application graph
Contains a rooted phylogenetic tree (see Definition 2.2.1 from [C. Semple, M. Steel: Phylogenetics]) with edge lengths. Every edge must have a positive length. They can be defined in terms of the distance matrix and the taxa only if the distance is ultrametric; see Section 7.2 from [C. Semple, M. Steel: Phylogenetics]. The root has always index 0.
Scalar
: edge length type
COPHENETIC_MATRIX
The corresponding tree distance matrix.
Matrix<Scalar,NonSymmetric>
The following prints the cophenetic matrix. The entries correspond to alphabetically ordered taxa.
> $T = new PhylogeneticTree(NEWICK => "(Rabbit:5,(Rat:2,Mouse:2):3):5,Wolf:10;"); > print $T -> TAXA; Mouse Rabbit Rat Wolf
> print $T -> COPHENETIC_MATRIX; 0 10 4 20 10 0 10 20 4 10 0 20 20 20 20 0
EDGE_LENGTHS
The edge lengths.
EdgeMap<Undirected,Scalar>
EQUIDISTANT
Checks if the input tree is equidistant.
LABELS
The labels associated to the nodes.
The following prints the labels of the nodes. The root is unlabeled, so an empty string is printed.
> $T = new PhylogeneticTree(NEWICK => "(Rabbit:5,(Rat:2,Mouse:2)Muroidea:3)Glires:5,Wolf:10;"); > print $T -> LABELS; Glires Rabbit Muroidea Rat Mouse Wolf
LEAVES
The indices of the taxa.
NEWICK
A valid representation in the Newick format (see: https://evolution.genetics.washington.edu/phylip/newicktree.html).
Prints a Newick representation of a tree given by the cophenetic matrix and its list of taxa.
> $T0 = new PhylogeneticTree(COPHENETIC_MATRIX=>[[0,10,4,20],[10,0,10,20],[4,10,0,20],[20,20,20,0]], TAXA => ["Mouse","Rabbit","Rat","Wolf"]); > print $T0 -> NEWICK; Wolf:10,(Rabbit:5,(Mouse:2,Rat:2):3):5;
NODE_HEIGHTS
The distances from nodes to any of its descendant leaves.
NodeMap<Undirected,Scalar>
> $T = new PhylogeneticTree(NEWICK => "(Rabbit:5,(Rat:2,Mouse:2):3):5,Wolf:10;"); > print rows_labeled($T -> ADJACENCY); 0:1 6 1:0 2 3 2:1 3:1 4 5 4:3 5:3 6:0
> print $T -> EDGE_LENGTHS; 5 5 3 2 2 10
> print $T -> NODE_HEIGHTS; 10 5 0 2 0 0 0
N_TAXA
The number of taxa.
The following prints the number of taxa. Note that two internal nodes are labeled; they do not count as taxa.
> $T = new PhylogeneticTree(NEWICK => "(Rabbit:5,(Rat:2,Mouse:2)Muroidea:3)Glires:5,Wolf:10;"); > print $T -> N_TAXA; 4
TAXA
The names of the taxa, i.e. the labels of the leaves.
The following prints the taxa. Note that two internal nodes are labeled; they do not count as taxa.
> $T = new PhylogeneticTree(NEWICK => "(Rabbit:5,(Rat:2,Mouse:2)Muroidea:3)Glires:5,Wolf:10;"); > print $T -> TAXA; Mouse Rabbit Rat Wolf