[BioPython] Bio.Nexus and Clustal tree files

Frank Kauff fkauff at duke.edu
Wed Apr 26 15:17:31 UTC 2006


On Wed, 2006-04-26 at 15:16 +0100, Peter (BioPython List) wrote:
> Hello again,
> 
> I have installed Frank Kauff's recent changes to Bio.Nexus from CVS, and 
> have actually got a tree loaded now :)
> 
Excellent!

> Here is my example script, which tries to load two tree files created 
> using ClustalX 1.83 (files previously sent to Frank off list)
> 
> (b) demo.dnd - Clustal guide tree in Newick format, no bootstraps
> (b) demo.treb - Clustal NJ tree in Nexus format, with bootstraps
> 
> Example code starts here:

> This gives the following output:
> 
> -----------------
> Filename:C:\TEMP\nexus\demo.dnd
> Number of taxlabels = 0
> Number of trees = 0
> -----------------
> Filename:C:\TEMP\nexus\demo.treb
> Number of taxlabels = 0
> Number of trees = 1
> Tree name: PAUP_1
> Tree nodes: V_Harveyi_PATH, B_subtilis_YXEM, B_subtilis_GlnH_homo_YCKK, 
> YA80_HAEIN, FLIY_ECOLI, Deinococcus_radiodurans, HISJ_E_COLI, E_coli_GlnH
> -----------------
> 
> As you can see, loading the ClustalX NEXUS output (*.treb) seems to work 
> without trouble (although n.taxlabels is an empty list... is this to be 
> expected?).

yes, the taxlabels refers to the taxon labels of a nexus data matrix.
They are not necessarily identical with the taxa in the tree, but could
be a superset or a subset of those.

However, the way clustal indicates the no. of supported bootstrap
replicates (square brackets after the branchlengths) is unsupported, and
thus these values are ignored. 

> 
> On the other hand, I don't get the tree for the Clustal guide tree file 
> (*.dnd) which is a pain.  Do I need to load these files differently, as 
> they are Newick format, not NEXUS format?
> 
Yes, the nexus parser reads only nexus. But you can throw the newick
tree directly at the Tree class
>>> from Bio.Nexus import Trees
>>> t=Trees.Tree(open('demo.dnd').read())

Frank


> Thank you
> 
> Peter
> _______________________________________________
> BioPython mailing list  -  BioPython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython
-- 
Frank Kauff
Dept. of Biology
Duke University
Box 90338
Durham, NC 27708
USA

Phone 919-660-7382
Fax 919-660-7293
Web http://www.lutzonilab.net





More information about the Biopython mailing list