[Biopython] some problem parsing swissprot format

Michael Thon mike.thon at gmail.com
Fri May 29 10:24:39 UTC 2015


I downloaded a set of proteins from uniprot in 'text' format. I am parsing the file with this:

in_file = SeqIO.parse(file_h, "swiss")

but I ran into this error:

Traceback (most recent call last):
  File "prep_blast_db.py", line 19, in <module>
    for item in in_file:
  File "/Library/Python/2.7/site-packages/Bio/SeqIO/__init__.py", line 586, in parse
    for r in i:
  File "/Library/Python/2.7/site-packages/Bio/SeqIO/SwissIO.py", line 81, in SwissIterator
    for swiss_record in swiss_records:
  File "/Library/Python/2.7/site-packages/Bio/SwissProt/__init__.py", line 117, in parse
    record = _read(handle)
  File "/Library/Python/2.7/site-packages/Bio/SwissProt/__init__.py", line 184, in _read
    _read_rn(reference, value)
  File "/Library/Python/2.7/site-packages/Bio/SwissProt/__init__.py", line 409, in _read_rn
    assert rn[0] == '[' and rn[-1] == ']', "Missing brackets %s" % rn
AssertionError: Missing brackets [1] {ECO:0000305, ECO:0000312|EMBL:BAC84995.1}

Maybe swissprot format has changed?




More information about the Biopython mailing list