cassiopeia.data.to_newick

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

Converts a networkx graph to a newick string.

Parameters
tree : DiGraphDiGraph

A networkx tree

record_branch_lengths : boolbool (default: False)

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

Return type

strstr

Returns

A newick string representing the topology of the tree