documentation:release:4.12:graph:phylogenetictree

Available versions of this document: latest release, release 4.13, release 4.12, release 4.11, release 4.10, release 4.9, release 4.8, release 4.7, release 4.6, release 4.5, release 4.4, release 4.3, release 4.2, release 4.1, release 4.0, release 3.6, release 3.5, nightly master

Reference documentation for older polymake versions: release 3.4, release 3.3, release 3.2

BigObject PhylogeneticTree<Scalar>

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.

Type Parameters:

Scalar: edge length type

derived from:

COPHENETIC_MATRIX

The corresponding tree distance matrix.

Type:
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


EDGE_LENGTHS

The edge lengths.

Type:

EQUIDISTANT

Checks if the input tree is equidistant.

Type:

LABELS

The labels associated to the nodes.

Type:
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


LEAVES

The indices of the taxa.

Type:

NEWICK

A valid representation in the Newick format (see: https://evolution.genetics.washington.edu/phylip/newicktree.html).

Type:
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;


NODE_HEIGHTS

The distances from nodes to any of its descendant leaves.

Type:
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


N_TAXA

The number of taxa.

Type:
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


TAXA

The names of the taxa, i.e. the labels of the leaves.

Type:
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


VISUAL

UNDOCUMENTED


  • documentation/release/4.12/graph/phylogenetictree.txt
  • Last modified: 2024/05/13 09:14
  • by 127.0.0.1