treeflow.tree.topology.base_tree_topology module
- class treeflow.tree.topology.base_tree_topology.BaseTreeTopology(parent_indices: TDataType)
Bases:
Generic[TDataType]- parent_indices: TDataType
- class treeflow.tree.topology.base_tree_topology.AbstractTreeTopology(parent_indices: TDataType)
Bases:
BaseTreeTopology[TDataType],Generic[TDataType,TShapeType]Class representing a bifurcating tree topology as a composition of integer arrays.
For a phylogenetic tree with
ntaxa at the leaves, the representation maintains a labelling of the1n-1nodes with integer indices. The labelling convention is that the leaves are the firstnindices and the root is at the last index (2n-2).- abstract property child_indices: TDataType
Array of length
2n-2representing the parent-child structure of a tree topology onntaxa.The
ith element of this array is the index of the parent of theith indexed node in the tree, for every node except the root.
- abstract property preorder_indices: TDataType
Array of indices of length
2n-1that form a pre-order traversal of the tree.A pre-order traversal is an ordering of the nodes where every node is visited before its children, starting at the root.
- abstract property taxon_count: TShapeType
Number of leaf taxa the tree is based on (
n)
- property postorder_node_indices: TDataType
- parent_indices: TDataType