[Biopython-dev] Cookbook entry, concatenating nexus files

Cymon Cox cy at cymon.org
Thu May 14 11:30:20 UTC 2009

2009/5/14 Cymon Cox <cy at cymon.org>

> 2009/5/14 Peter <biopython at maubp.freeserve.co.uk>
>> When I talked to Frank about Nexus files, he said they should only
>> ever hold one alignment matrix,
> Well, that was my understanding as well. But, it may be wrong. I just tried
> it - p4 will read both matrices no problem, PAUP* (the de facto standard
> here) will execute both matrices ok presumably leaving just the last as the
> data in memory.
> I'll look into this further...

After a quick scan of the spec, there appears to be only one oblique
reference to this issue:

"Although the NEXUS standard does not impose constraints on the number of
blocks, particular programs will. For example, MacClade 3.07 does not allow
more than one TAXA block in a file."

So I read that to mean, you can have any number of similarly named blocks in
a NEXUS file, ie multiple DATA, TAXA, CHARACTERS, TREES etc, and its up to
an individual application to decide how to deal with them.

This seems to be in practice what happens: PAUP* will read multiple blocks
of the same name but only the last block of a particular name will remain in
memory after the file has been parsed. On the other hand, P4 will read
multiple DATA blocks and store the different alignments as separate objects,
and read multiple TREES blocks and store all the trees.


More information about the Biopython-dev mailing list