[Biopython] Planning Biopython 1.72

Martin Mokrejs mmokrejs at fold.natur.cuni.cz
Tue Jun 12 17:04:41 UTC 2018


Hi,
  I just realized that SearchIO does not automatically detect compressed files on its input using file extension. Could .gz, .bz2 be supported?

>>> for record in SearchIO.parse('blah.xml.gz', 'blast-xml'):
...     print record.id
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/Bio/SearchIO/__init__.py", line 312, in parse
    generator = iterator(source_file, **kwargs)
  File "/usr/lib64/python2.7/site-packages/Bio/SearchIO/BlastIO/blast_xml.py", line 211, in __init__
    self._meta, self._fallback = self._parse_preamble()
  File "/usr/lib64/python2.7/site-packages/Bio/SearchIO/BlastIO/blast_xml.py", line 225, in _parse_preamble
    for event, elem in self.xml_iter:
  File "<string>", line 91, in next
cElementTree.ParseError: not well-formed (invalid token): line 1, column 0
>>> 

Martin


More information about the Biopython mailing list