core.tree.load_tree
core.tree.load_tree(filename, format_name=None, underscore_unmunge=False)Constructor for tree.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| filename | str | pathlib.Path | a file path containing a newick or xml formatted tree. | required |
| format_name | str | None | either xml or json, all other values default to newick. Overrides file name suffix. | None |
| underscore_unmunge | bool | replace underscores with spaces in all names read, i.e. “sp_name” becomes “sp name”. | False |
Notes
Underscore unmunging is turned off by default, although it is part of the Newick format. Only the cogent3 json and xml tree formats are supported.
filename is assigned to root node tree.source attribute.
Returns
| Name | Type | Description |
|---|---|---|
| PhyloNode |