
The newick code for the above graph.
(A:1,D:6,(((E:1,F:1):1,B:2):1,(C:4,G:2):2):1);
This representation is using the internal node where A and D meet as the root node. Which internal node you choose is arbitrary. Each set of ( ) represents a internal node and the elements within the parentheses are all the children of the node and are separated by commas. A:1 is a leaf node connected to the root node with a weight of 1. The weights are optional.
Hence,
( A , B , ( C , D )) Would look like:
A D \__/ / \ B C
What I need to be able to do is find the inner most set or sets of parentheses. Is there any way to do this using regular expressions. In the above example I would ultimately want to find the indexes into the string where the ( ) are containing C and D. Some times I would need to find two sets as the example below illustrates. If there are any Regex pros around I would appreciate the help.


Sign In
Create Account

Back to top









