[BioPython] swissprot parser problem

Jeffrey Chang jchang at jeffchang.com
Mon Jun 16 13:44:24 EDT 2003


Hey Asa,

This should have been fixed in Biopython version 1.10.  If you're using 
an older version of Biopython, please upgrade to this one.  There are 
other fixes and format updates that are quite helpful to have as well.

Jeff



On Monday, June 16, 2003, at 11:20  AM, Asa Ben-Hur wrote:

>
> 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
>
>
>
>
>
> _______________________________________________
> BioPython mailing list  -  BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython



More information about the BioPython mailing list