biotaphy.common.annotators

Module containing tools for annotating trees with ancestral trait data.

Module Contents

Functions

add_all_annotations(lm_tree, node_matrix, update=False)

Adds all annotations from the node matrix to the tree.

annotate_tree_with_label(lm_tree, node_matrix, label_column=0)

Annotates the tree by changing the label of each node.

biotaphy.common.annotators.add_all_annotations(lm_tree, node_matrix, update=False)[source]

Adds all annotations from the node matrix to the tree.

Parameters
  • lm_tree (TreeWrapper) – A Lifemapper tree object.

  • node_matrix (Matrix) – A Lifemapper Matrix object with rows matching the nodes in the provided tree.

  • update (bool, optional) – Should any existing annotations be updated. Defaults to False.

biotaphy.common.annotators.annotate_tree_with_label(lm_tree, node_matrix, label_column=0)[source]

Annotates the tree by changing the label of each node.

Parameters
  • lm_tree (TreeWrapper) – A Lifemapper tree object.

  • node_matrix (Matrix) – A Lifemapper Matrix object with rows matching the nodes in the provided tree.

  • label_column (int, optional) – The column in the matrix to use for node labels. Defaults to 0.