Closed niemasd closed 6 years ago
I wrote a fairly simple Newick parser in my own package, TreeSwift, that handles trees like this. Feel free to reuse the logic if you wish to implement this ability:
Hi @niemasd,
pyvolve will read in this tree fine if it has parentheses, which is a required component of newick format:
>>> from pyvolve import *
>>> t = "(N13|4|3.0:3);"
>>> tree = read_tree(tree = t)
>>> tree
<pyvolve.newick.Node instance at 0x10e250368>
>>> print_tree(tree)
root None None
N13|4|3.0 3.0 None
This will set up a simulation for a single root sequence along a branch with length of 3.0
Best, Stephanie
Ah, excellent, thank you for the help!
Currently, it seems as though the Newick parser in Pyvolve does not allow single-node trees, e.g.
N13|4|3.0:3;
. For example, the following chunk of code:results in the following error: