historydag.from_newick
- historydag.from_newick(tree, label_features, label_functions={}, newick_format=8, attr_func=lambda n: ...)[source]
Make a history DAG using a newick string. Internally, utilizes newick parsing features provided by ete3, then calls
from_tree()
on the resulting ete3.Tree object.- Parameters:
tree (
str
) – newick string representation of a tree. May contain extended node data in ‘extended newick format’ used by ete3.label_features (
List
[str
]) – (passed tofrom_tree()
) list of features to be used as label fields in resulting history DAG. ‘name’ refers to the node name string in the standard newick format. See ete3 docs for more details.newick_format – ete3 format number of passed newick string. See ete3 docs for details.
label_functions (
Mapping
[str
,Callable
[[TreeNode
],Any
]]) – (passed tofrom_tree()
)attr_func (
Callable
[[TreeNode
],Any
]) – (passed tofrom_tree()
)
- Return type:
- Returns:
HistoryDag object, which has the same topology as the input newick tree, with the required UA node added as a new root.