[BioPython] Prosite / Prorule

holger.dinkel at gmail.com holger.dinkel at gmail.com
Fri Nov 16 10:38:56 UTC 2007


Hello List,

I just stumbled upon an error with the parsing of a 'newer' (>20) version of
Prosite:  Prosite introduced a new field called ProRules which cause errors
in parsing with Bio/Prosite/__init__.py / Bio/ParserSupport.py.  
I updated biopython to 1.44, but the error persists.

Here is the Traceback:
----------------------------------------------------------------------------------------------------
  File "/usr/lib/python2.4/site-packages/Bio/Prosite/__init__.py", line 227, in next
    return self._parser.parse(File.StringHandle(data))
  File "/usr/lib/python2.4/site-packages/Bio/Prosite/__init__.py", line 349, in parse
    self._scanner.feed(handle, self._consumer)
  File "/usr/lib/python2.4/site-packages/Bio/Prosite/__init__.py", line 381, in feed
    self._scan_record(uhandle, consumer)
  File "/usr/lib/python2.4/site-packages/Bio/Prosite/__init__.py", line 396, in _scan_record
    fn(self, uhandle, consumer)
  File "/usr/lib/python2.4/site-packages/Bio/Prosite/__init__.py", line 477, in _scan_do
    self._scan_line('DO', uhandle, consumer.documentation, exactly_one=1)
  File "/usr/lib/python2.4/site-packages/Bio/Prosite/__init__.py", line 418, in _scan_line
    read_and_call(uhandle, event_fn, start=line_type)
  File "/usr/lib/python2.4/site-packages/Bio/ParserSupport.py", line 300, in read_and_call
    raise SyntaxError, errmsg
SyntaxError: Line does not start with 'DO':
PR   PRU00498;
----------------------------------------------------------------------------------------------------


I tried to figure out, where the problem lies, but I do not really understand
the structure of the parsing modules in 'Bio/Prosite/__init__.py'
I tried to create a new entry for the prorule:
define a 

    def _scan_pr(self, uhandle, consumer):
        self._scan_line('PR', uhandle, consumer.identification, up_to_one=1)

add that to the '_scan_fns' and so on, but then the scanning order seems to get
out of order, and i get a different "SyntaxError: Line does not start with ..." 
error...

Is the parsing mechanism described anywhere, so I can look it up and fix the error?


Regards,

Holger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/biopython/attachments/20071116/94d590fd/attachment.sig>


More information about the Biopython mailing list