====== BigObject PhylogeneticTree ====== //from application [[..:graph|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. ? Type Parameters: :: ''Scalar'': edge length type ? derived from: : ''[[..:graph:Graph |Graph]]'' ===== Properties ===== ==== no category ==== {{anchor:cophenetic_matrix:}} ? **''COPHENETIC_MATRIX''** :: The corresponding tree distance matrix. ? Type: :''[[..:common#Matrix |Matrix]]'' ? Example: :: 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 ---- {{anchor:edge_lengths:}} ? **''EDGE_LENGTHS''** :: The edge lengths. ? Type: :''[[..:common#EdgeMap |EdgeMap]]<[[..:common#Undirected |Undirected]],Scalar>'' ---- {{anchor:equidistant:}} ? **''EQUIDISTANT''** :: Checks if the input tree is equidistant. ? Type: :''[[..:common#Bool |Bool]]'' ---- {{anchor:labels:}} ? **''LABELS''** :: The labels associated to the nodes. ? Type: :''[[..:common#NodeMap |NodeMap]]<[[..:common#Undirected |Undirected]],[[..:common#String |String]]>'' ? Example: :: 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 ---- {{anchor:leaves:}} ? **''LEAVES''** :: The indices of the taxa. ? Type: :''[[..:common#Map |Map]]<[[..:common#String |String]],[[..:common#Int |Int]]>'' ---- {{anchor:newick:}} ? **''NEWICK''** :: A valid representation in the Newick format (see: https://evolution.genetics.washington.edu/phylip/newicktree.html). ? Type: :''[[..:common#String |String]]'' ? Example: :: 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; ---- {{anchor:node_heights:}} ? **''NODE_HEIGHTS''** :: The distances from nodes to any of its descendant leaves. ? Type: :''[[..:common#NodeMap |NodeMap]]<[[..:common#Undirected |Undirected]],Scalar>'' ? Example: :: > $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 ---- {{anchor:n_taxa:}} ? **''N_TAXA''** :: The number of taxa. ? Type: :''[[..:common#Int |Int]]'' ? Example: :: 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 ---- {{anchor:taxa:}} ? **''TAXA''** :: The names of the taxa, i.e. the labels of the leaves. ? Type: :''[[..:common#Array |Array]]<[[..:common#String |String]]>'' ? Example: :: 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 ---- ===== Methods ===== ==== no category ==== {{anchor:visual:}} ? **''VISUAL''** ::UNDOCUMENTED ----