cassiopeia.data.to_newick#

cassiopeia.data.to_newick(tree, record_branch_lengths=False)[source]#

Converts a networkx graph to a newick string.

Parameters:
tree DiGraph

A networkx tree

record_branch_lengths bool (default: False)

Whether to record branch lengths on the tree in the newick string

Return type:

str

Returns:

A newick string representing the topology of the tree