[BioPython] Bio.Nexus documentation

Frank Kauff fkauff at duke.edu
Tue Apr 25 21:17:23 UTC 2006


Ok, I added support for the utree command used in clustal to denote an
unrooted tree (in the nexus parser, it is synonym to 'tree', as trees
are unrooted by default anyway), and fixed some issues with linebreaks
in tree descriptions. Nexus files from Clustal should now be read
without problems (famous last words).

Cheers,
Frank


On Tue, 2006-04-25 at 10:08 +0100, Peter (BioPython List) wrote:
> > Anyway, I'll get some examples together, and I still want to do some
> > documentation for the cookbook. It won't be before this weekend, though.
> > For a quick and dirty anchor point, there's the test module that comes
> > with the distribution, it naturally has some code that does interesting
> > things with trees and data.
> 
> Its certainly shown me that the Nexus file format is a lot more 
> complicated than just holding simple trees.
> 
> What I actually wanted to do was load a Newick format tree (extension 
> *.dnd files from Clustalw/ClustalX in particular) into BioPython.  This 
> doesn't look like is possible.
> 
> However, I can get Clustalx to save the corresponding alignment in Nexus 
> format, but the parser doesn't seem to like it...
> 
> Traceback (most recent call last):
>    File "C:\temp\hack_trees_000.py", line 7, in ?
>      n=Nexus.Nexus(input_file)
>    File "C:\Python23\lib\site-packages\Bio\Nexus\Nexus.py", line 525, in 
> __init__
>      self.read(input)
>    File "C:\Python23\lib\site-packages\Bio\Nexus\Nexus.py", line 582, in 
> read
>      self._parse_nexus_block(title, contents)
>    File "C:\Python23\lib\site-packages\Bio\Nexus\Nexus.py", line 623, in 
> _parse_nexus_block
>      getattr(self,'_'+line.command)(line.options)
> AttributeError: 'Nexus' object has no attribute '_utree'
> 
> This looks like its cause by the penultimate line of the "Nexus Tree 
> file" produced by ClustalX:
> 
> ..
> 	UTREE PAUP_1= (...);
> ENDBLOCK;
> 
> Any ideas?  I'll happily send you some example tree files off the list 
> if you want.
> 
> Peter
> 
> 
-- 
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