Library for the Development and Use of Phylogenetic Network Methods
Newick format label extraction and Nexus file generation utilities.
Error class for any exceptions relating to failing to parse a newick string into a Network/Graph object
Class that generates a nexus file given tree and biological data.
Initialize a blank nexus template
Create a new line in the "TREES" block.
| Parameter | Type | Description |
|---|---|---|
| newick_str | str | The next network to be added, in newick format. |
Add a phylonet command to the nexus file.
| Parameter | Type | Description |
|---|---|---|
| cmd | str | A phylonet command. |
Load a set of gene trees from a file into the nexus template.
| Parameter | Type | Description |
|---|---|---|
| filename | str | The path to the file containing the gene trees. |
Create a nexus file at "<loc>/<end_name>", end_name should include .nex extension.
| Parameter | Type | Description |
|---|---|---|
| loc | Union[Path, str] | Directory location to save the file to. Can either be a python Path obj or simply a string. |
| end_name | str | The new file name. Must include .nex extension. |
NewickParserError: If the file location already exists or cannot be found.Given a newick string, gather a set of all unique taxa labels present in the string. Strips branch lengths (after ``:``) and NHX comments (after ``[``) so that only bare taxon names are returned.
| Parameter | Type | Description |
|---|---|---|
| newick_str | str | A newick format string (may include a trailing semicolon). |