[BioPython] swissprot parser problem

Asa Ben-Hur abenhur at stanford.edu
Mon Jun 16 12:20:04 EDT 2003


While iterating over the newest (40.44) swissprot flat file
using a swissprot parser
    sprotFile = open(sprotFileName)
    s_parser = SProt.RecordParser()
    s_iterator = SProt.Iterator(sprotFile, s_parser)
I get the following error:

  File "extract.py", line 20, in ecExtract
    s_record = s_iterator.next()
  File "/usr/local/lib/python2.2/site-packages/Bio/SwissProt/SProt.py",
line 168, in next
    return self._parser.parse(File.StringHandle(data))
  File "/usr/local/lib/python2.2/site-packages/Bio/SwissProt/SProt.py",
line 289, in parse
    self._scanner.feed(handle, self._consumer)
  File "/usr/local/lib/python2.2/site-packages/Bio/SwissProt/SProt.py",
line 332, in feed
    self._scan_record(uhandle, consumer)
  File "/usr/local/lib/python2.2/site-packages/Bio/SwissProt/SProt.py",
line 337, in _scan_record
    fn(self, uhandle, consumer)
  File "/usr/local/lib/python2.2/site-packages/Bio/SwissProt/SProt.py",
line 411, in _scan_reference
    self._scan_ra(uhandle, consumer)
  File "/usr/local/lib/python2.2/site-packages/Bio/SwissProt/SProt.py",
line 433, in _scan_ra
    one_or_more=1)
  File "/usr/local/lib/python2.2/site-packages/Bio/SwissProt/SProt.py",
line 359, in _scan_line
    read_and_call(uhandle, event_fn, start=line_type)
  File "/usr/local/lib/python2.2/site-packages/Bio/ParserSupport.py", line
331, in read_and_call
    raise SyntaxError, errmsg
SyntaxError: Line does not start with 'RA':
RP   550-559; 573-580 AND 584-601 (DELTA-1).

No error occurs on an earlier release 40 file.
This could be related to the fact that swissprot now has
multiple RP lines (was not the case in earlier versions)
Indeed, the entry that caused the error has multiple RP lines.
Its accession no. is Q14738.

-Asa


^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^!^
Asa Ben-Hur
Postdoc, Brutlag Bioinformatics Group
Stanford







More information about the BioPython mailing list