User:Carl Boettiger/Notebook/Comparative Phylogenetics/2010/03/22
|Comparative Phylogenetics||Main project page|
Previous entry Next entry
Phylogenetic Tree formats
ape Format: class "phylo"
The order of the rows in the matrix doesn't matter.
These are the essential components of a phylo object. Optional parameter includes a list of names for internal nodes:
Ape format is very picky. Any tree topology is completely specified by listing the ancestor for each node. If the nodes are identified as 1:n, then the topology is an ordered vector of length n. This is the representation used by ouch. The node numbers can be arbitrary identifiers. Ape chooses a more restrictive representation. Nodes are assigned numbers such that the numbers 1 to (n+1)/2 are assigned exclusively to tips, and those after are assigned exclusively to internal nodes. Topology is specified by listing the ancestor of each node. The identity is stored in edge[,2] and the ancestor in edge[,1]. However, it appears that the root node cannot be assigned as n. Whichever is the ancestor will be missing from the node list on the right (edge[,2]), as it has no corresponding ancestor on the left. It seems the (n+1)/2 + 1 does best assigned to the root. Ouch2ape conversion could easily preserve the node-numbering used in the ape representation, but for some reason the function chooses to renumber them anyway. Reversing is harder, as not all applicable codings of a tree in the ouch representation meet the additional constraints of the ape tree.
ouch Format: class "ouchtree"