tasccoda.tree_utils.get_A

tasccoda.tree_utils.get_A(tree)

Calculate ancestor matrix from a toytree tree

Parameters
tree : ToyTreeToyTree

A toytree tree object

Return type

Tuple[ndarray, int]Tuple[ndarray, int]

Returns

  • Ancestor matrix and number of nodes without root node

  • A – Ancestor matrix (numpy array)

  • T – number of nodes in the tree, excluding the root node