Description

This page documents the API for the historydag package. The fundamental data structure implemented here is the HistoryDag. This data structure provides efficient storage for collections of trees with internal node labels. In this package, we refer to such a tree as a history. A history can be represented as a tree-shaped HistoryDag object.

This package provides functions for:

  • creating histories from tree data,

  • merging histories together to create history DAGs,

  • doing efficient computation on collections of histories stored in history DAGs, and

  • accessing histories contained in a history DAG, and exporting them to other tree formats.

Classes

Top level classes, promoted from the dag module.

HistoryDag(dagroot[, attr])

An object to represent a collection of internally labeled trees.

HistoryDagNode(label, clades, attr)

A recursive representation of a history DAG object.

Functions

Top level functions, promoted from the dag module.

from_tree(treeroot, label_features[, ...])

Build a tree-shaped historydag.HistoryDag() (a 'history') object from the provided tree data.

empty_node(label, clades[, attr])

Return a HistoryDagNode with the given label and clades, with no children.

from_newick(tree, label_features[, ...])

Make a history DAG using a newick string.

history_dag_from_newicks(newicklist, ...[, ...])

Build a history DAG from a list of newick strings.

history_dag_from_etes(*args, **kwargs)

Deprecated name for historydag.history_dag_from_trees()

history_dag_from_histories(treelist)

Build a history DAG from a list of history DAGs which are histories.

Modules

dag

A module providing the class HistoryDag, and supporting functions.

sequence_dag

mutation_annotated_dag

This module allows the loading and manipulation of Larch mutation annotated DAG protobuf files.

utils

Utility functions and classes for working with HistoryDag objects.

parsimony

A module implementing Sankoff Algorithm.

parsimony_utils

This module provides tools for describing and computing parsimony and weighted parsimony, and for describing allowed characters and ambiguity codes.

compact_genome

This module provides a CompactGenome class, intended as a convenient and compact representation of a nucleotide sequence as a collection of mutations relative to a reference sequence.

dag_node

counterops

Functions for manipulating collections.Counter objects.