[Biopython] An error with Concatenate nexus

Esa Aalto esa.aalto at oulu.fi
Thu May 19 13:02:17 UTC 2011


Dear group,

I'm trying to concatenate 20 nexus files with the instructions given
here:

http://www.biopython.org/wiki/Concatenate_nexus

but it doesn't work:

Traceback (most recent call last):
  File "C:\Python27\concate_nexus.py", line 36, in <module>
    nexi =  [(handle.name, Nexus.Nexus(handle)) for handle in handles]
  File "C:\Python27\lib\site-packages\Bio\Nexus\Nexus.py", line 555, in
__init__
    self.read(input)
  File "C:\Python27\lib\site-packages\Bio\Nexus\Nexus.py", line 618, in
read
    self._parse_nexus_block(title, contents)
  File "C:\Python27\lib\site-packages\Bio\Nexus\Nexus.py", line 659, in
_parse_nexus_block
    getattr(self,'_'+line.command)(line.options)
  File "C:\Python27\lib\site-packages\Bio\Nexus\Nexus.py", line 1021, in
_codonposset
    raise NexusError('Formatting Error in codonposset: %s ' % options)
NexusError: Formatting Error in codonposset: * UNTITLED = 1: 1-577\3, 2:
2-578\3, 3: 3-579\3

The end of the first of my nex files looks like this:

BEGIN SETS;
   TaxSet A_thaliana = 1;
   TaxSet A_lyrata = 2;
   TaxSet Boh = 3-32;
   TaxSet Ice = 33-60;
   TaxSet Ith = 61-92;
   TaxSet Kar = 93-124;
   TaxSet Lom = 125-156;
   TaxSet NC = 157-196;
   TaxSet Pl = 197-236;
   TaxSet Sp = 237-274;
   TaxSet Stu = 275-294;
   TaxSet South = 3-32 197-236;
   TaxSet North = 125-156 237-274;
   TaxSet lyrata = 2-294;
END;

BEGIN CODONS; 
   CODONPOSSET * UNTITLED = 
      1: 1-577\3,
      2: 2-578\3,
      3: 3-579\3;
   CODESET * UNTITLED = Universal: all;
END;

BEGIN CODONUSAGE;
END;

BEGIN DnaSP;
   Genome= Diploid;
   ChromosomalLocation= Autosome;
   VariationType= DNA_Seq_Pol;
   Species= ---;
   ChromosomeName= ---;
   GenomicPosition= 1;
   GenomicAssembly= ---;
   DnaSPversion= Ver. 5.10.00;
END;

Could someone tell what's wrong here? Is it my nexus files or something
in the code?

Thanks for your help!

Esa Aalto




More information about the Biopython mailing list