[BiO BB] Re: paup output parsing

Dave Richardson dave at unheardof.clara.co.uk
Tue Apr 13 17:21:47 EDT 2004

Ognen wrote:

>I am trying to parse out paup output such as this one:
>tree PAUP_1 = [&U] (1:4,2:20,((3:14,5:200):17,4:13):24);
>What I want is to extract the length for each one. The number after : is
>the length
>For this case:
>Length of 1 will be 4
>Length of 2 will be 20
>Length of 3 will be 14+17+24=55
>Length of 5 will be 200+17+24=241
>Length of 4 will be 13+24=3
>Naturally, the output gets pretty large and complicated and before I fire
>up my editor and start coding: are there any tools/scripts outhere that
>extract this information already and are available for download?


BioPerl has methods for dealing with trees, including getting the length 
between two nodes.
You probably want to have a look at the Bio::TreeIO and 
Bio::Tree::TreeFunctionsI. TreeIO doesn't deal with paup/nexus format, 
but  paup will use newick format if you ask nicely.

Hope this helps,

Dave Richardson

More information about the BBB mailing list