[Biopython-dev] [Bug 2558] Bio.Nexus chokes on TRANSLATE block with superfluous comma

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Jul 30 09:23:59 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2558


biopython-bugzilla at maubp.freeserve.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|AlignIO nexus parsing chokes|Bio.Nexus chokes on
                   |on superfluous comma        |TRANSLATE block with
                   |                            |superfluous comma




------- Comment #1 from biopython-bugzilla at maubp.freeserve.co.uk  2008-07-30 05:23 EST -------
This is an issue in the Bio.Nexus module, so its a job for Frank.  

Do you know if this affects all the NEXUS files from www.treebase.org? I've
tried downloading several trees, but their FTP site is just timing out for me. 
According to http://www.treebase.org/treebase/submit.html the request trees be
uploaded in the NEXUS file format so its possible that just a minority of their
trees have this trailing comma.

Note that this may be an invalid file (a TRANSLATE block with trailing comma),
but as you say it looks relatively straight forward to cope with.  However, I
have had a quick look at the Bio.Nexus code, and I don't entirely understand
what Frank's parser is doing here - so its not going to be a quick fix from me.


Quick bit of python to show the stack trace:

>>> from Bio.Nexus import Nexus
>>> n = Nexus(open("M3579.NX"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>> n = Nexus.Nexus(open("M3579.NX"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/Users/XXX/repositories/biopython/build/lib.macosx-10.3-i386-2.5/Bio/Nexus/Nexus.py",
line 552, in __init__
    self.read(input)
  File
"/Users/XXX/repositories/biopython/build/lib.macosx-10.3-i386-2.5/Bio/Nexus/Nexus.py",
line 614, in read
    self._parse_nexus_block(title, contents)
  File
"/Users/XXX/repositories/biopython/build/lib.macosx-10.3-i386-2.5/Bio/Nexus/Nexus.py",
line 655, in _parse_nexus_block
    getattr(self,'_'+line.command)(line.options)
  File
"/Users/XXX/repositories/biopython/build/lib.macosx-10.3-i386-2.5/Bio/Nexus/Nexus.py",
line 922, in _translate
    raise NexusError,'Format error in line %s.' % options
Bio.Nexus.Nexus.NexusError: Format error in line 1 'Rolfidium_coccocarpioides',
2 'Mycoblastus_sanguinarius', 3 'Protoblastenia_rupestris', 4
'Myxobilimbia_sabuletorum', 5 'Byssoloma_leucoblepharum', 6
'Stereocaulon_tomentosum', 7 'Scoliciosporum_umbrinum', 8
'Haematomma_ochroleucum', 9 'Glyphopeltis_ligustica', 10
'Catinaria_atropurpurea', 11 'Miriquidica_garovaglii', 12
'Sphaerophorus_globosus', 13 'Lecidea_atrosanguinea', 14
'Cladonia_peziziformis', 15 'Stereocaulon_pileatum', 16
'Frutidella_caesioatra', 17 'Fellhanera_bouteillei', 18 'Tonina_cinereovirens',
19 'Helocarpon_crassipes', 20 'Micarea_alabastrites', 21
'Squamarina_lentigera', 22 'Lecanora_intumescens', 23 'Bellemerea_diamarta', 24
'Lopadium_disciforme', 25 'Herteliana_taylorii', 26 'Lepraria_lobificans', 27
'Psilolechia_leprosa', 28 'Protomicarea_limosa', 29 'Calopadia_foliicola', 30
'Fellhanera_subtilis', 31 'Pyrrhospora_quernea', 32 'Lecidella_meiococca', 33
'Hypogymnia_physodes', 34 'Ramalina_fastigiata', 35 'Halecania_alpivaga', 36
'Platismatia_glauca', 37 'Lepraria_bergensis', 38 'Micarea_micrococca', 39
'Lecania_atrynoides', 40 'Crocynia_gossypina', 41 'Psilolechia_lucida', 42
'Lecanora_allophana', 43 'Cladonia_digitata', 44 'Schadonia_fecunda', 45
'Psorula_rufonigra', 46 'Adelolecia_pilati', 47 'Lecidea_turgidula', 48
'Micarea_sylvicola', 49 'Lecidea_fuscoatra', 50 'Psora_rubiformis', 51
'Micarea_erratica', 52 'Megalaria_grossa', 53 'Lecidea_silacea', 54
'Micarea_intrusa', 55 'Psora_decipiens', 56 'Tephromela_atra', 57
'Bacidia_rosella', 58 'Micarea_adnata', 59 'Lecanorales',.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list