We have some trees from BEAST in extended newick format, and each of their nodes has an annotation containing a nested list. Here's a minimal example of a tree containing a single node, with the sort of annotations I'm talking about:
As you can see, only the first sublist is parsed (up until the first closing }), and the first item contains the opening bracket of the first sublist.
I know I can pass the Tree.get method the keyword argument extract_comment_metadata=False, and parse the resulting node.comments string myself. That's a nice workaround, but I'm wondering if there's a way I'm not seeing to provide a custom annotation string parser, or if there would be some other easy fix for this behavior?
Thanks for the great tool!
We have some trees from BEAST in extended newick format, and each of their nodes has an annotation containing a nested list. Here's a minimal example of a tree containing a single node, with the sort of annotations I'm talking about:
Dendropy loads this tree without errors, but parses the value of the
history_all
field incorrectly:As you can see, only the first sublist is parsed (up until the first closing
}
), and the first item contains the opening bracket of the first sublist.I know I can pass the
Tree.get
method the keyword argumentextract_comment_metadata=False
, and parse the resultingnode.comments
string myself. That's a nice workaround, but I'm wondering if there's a way I'm not seeing to provide a custom annotation string parser, or if there would be some other easy fix for this behavior?cc @matsen