[BioPython] Bio.Nexus documentation

Frank fkauff at duke.edu
Tue Apr 25 12:03:16 UTC 2006


Hi Peter,

yes, utree is in deed a nexus command I never heard of... The thing is
that nexus is extendible, so programs can in theory define new commands.
So, what is utree? Maybe an unrooted tree?
And, many programs don't care much about the nexus specifications, which
are, in turn, not always too precise. 
If you send the files along, I'd be happy to have a look.

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
> 
> 




More information about the Biopython mailing list