ivy.newick module¶
Parse newick strings.
The function of interest is parse, which returns the root node of the parsed tree.
-
class
ivy.newick.Tokenizer(infile)[source]¶ Bases:
shlex.shlexProvides tokens for parsing newick strings.
-
ivy.newick.parse(data, ttable=None, treename=None)[source]¶ Parse a newick string.
Parameters: - data – Any file-like object that can be coerced into shlex, or a string (converted to StringIO)
- ttable (dict) – Mapping of node labels in the newick string to other values.
Returns: The root node.
Return type: