For example if I had the Newick String
(A:5, B:5, (C:6, D:5)E:2);
It would have an unnamed root node with three children A, B and E with their given edge lengths. A and B would have an empty set of children and E would have two childen C and D, both of which have no children.
What I am looking for is a way to parse this recursively.
What I was thinking is that if you strip off the outer parenthatheis you are left with a list of tree separated by commas. Each of these needs to be a tree object and then the objects need to be hooked together in the list of children. What I dont know is how to make this happen.
Any help would be appreciated.
This post has been edited by bern1812: 28 February 2011 - 01:01 PM

New Topic/Question
Reply



MultiQuote




|