torchtree.evolution.io#
Classes#
Functions#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Split tree in newick format around (),; |
|
Extract taxon list from a nexus file. |
Module Contents#
- torchtree.evolution.io.read_tree_and_alignment(tree, alignment, dated=True, heterochornous=True)[source]#
- class torchtree.evolution.io.Node(name, height=0.0)[source]#
- name#
- height#
- parent = None#
- children = []#
- torchtree.evolution.io.random_tree_from_heights(sampling: torch.Tensor, heights: torch.Tensor) Node [source]#
- torchtree.evolution.io.split_newick(newick: str) list[str] [source]#
Split tree in newick format around (),;
Example
>>> newick = '((a:1[&a={1,2}],b:1):1,c:1);' >>> split_newick('((a:1,b:1):1,c:1);') ['(', '(', 'a:1', ',', 'b:1', ')', ':1', ',', 'c:1', ')', ';']
- Parameters:
newick (str) – newick tree
- Return List[str]:
list of strings