[BioPython] Creating and traversing an ultrametric tree
Peter
biopython at maubp.freeserve.co.uk
Wed Sep 24 20:26:37 UTC 2008
On Wed, Sep 24, 2008 at 7:32 PM, aditya shukla
<adityashukla1983 at gmail.com> wrote:
> Hello Peter ,
>
> Thanks for the reply ,
> I have attached a file with of the kind of data that i wanna parse.
> I tried using Thomas Mailund's Newick tree parser but this dosen't
> seem to work , so is there any other module that can help?
Your file looks like this (in case anyone on the mailing list recognises it),
/T_0_size=105((-bin-ulockmgr_server:0.99[&&NHX:C=0.195.0],
(((-bin-hostname:0.00[&&NHX:C=200.0.0],
(-bin-dnsdomainname:0.00[&&NHX:C=200.0.0],
...):0.99):0.99):0.99):0.99);
[with a large chunk removed, and new lines inserted]
I'm guessing this is some kind of computer system profile - nothing to
do with bioinformatics.
I'm not 100% sure this is Newick format - it might be worth trying to
parse everything after the "/T_0_size=105" text which looks out of
place to me.
If it is a valid Newick format tree file, then it is using named
internal nodes which is something Biopython can't currently parse (see
Bug 2543, http://bugzilla.open-bio.org/show_bug.cgi?id=2543 ). So I
don't think you can use the Bio.Nexus module in Biopython to read this
tree.
The only other python package I can suggest you try is NetworkX,
https://networkx.lanl.gov/wiki
Good luck,
Peter
More information about the Biopython
mailing list