|
|
Re: RE : Problem with the Swiss Prot parser (BUG#1706): msg#00018
python.bio.devel
|
Subject: |
Re: RE : Problem with the Swiss Prot parser (BUG#1706) |
On Nov 2, 2004, at 10:18 AM, Jonathan Boulais wrote:
After installing the latest update of the Swiss Prot parser from cvs,
I'm
getting this error :
Traceback (most recent call last):
File "C:\Joe_script\Parser_Trembl.py", line 30, in ?
cur_record = s_iterator.next()
File "C:\Python23\Lib\site-packages\Bio\SwissProt\SProt.py", line
166, in
next return self._parser.parse(File.StringHandle(data))
File "C:\Python23\Lib\site-packages\Bio\SwissProt\SProt.py", line
290, in
parse self._scanner.feed(handle, self._consumer)
File "C:\Python23\Lib\site-packages\Bio\SwissProt\SProt.py", line
332, in
feed
self._scan_record(uhandle, consumer)
File "C:\Python23\Lib\site-packages\Bio\SwissProt\SProt.py", line
337, in
_scan_record
fn(self, uhandle, consumer)
File "C:\Python23\Lib\site-packages\Bio\SwissProt\SProt.py", line
468, in
_scan_sq
self._scan_line('SQ', uhandle, consumer.sequence_header,
exactly_one=1)
File "C:\Python23\Lib\site-packages\Bio\SwissProt\SProt.py", line
359, in
_scan_line
read_and_call(uhandle, event_fn, start=line_type)
File "C:\Python23\Lib\site-packages\Bio\ParserSupport.py", line 300,
in
read_and_call
raise SyntaxError, errmsg
SyntaxError: Line does not start with 'SQ':
RA Dujon B., Sherman D., Fischer G., Durrens P., Casaregola S.,
------- Additional Comment #1 From Jeffrey Chang 2004-10-25 14:47
-------
Try grabbing the latest Bio/SwissProt/SProt.py file from the CVS
(cvs.biopython.org). There's been
some fixes to the parser, which might fix your problem. If it does
not, then please send some sample
code and data file.
Jeff
---------------------------------------------------------------
Hi Jeff,
I've updated the whole Biopython package from the cvs on a Windows
machine and a Mac OS/X machine.
Both cpu gave me the same error (see above).
I'm sending you the script that I wrote. Before you check it out, I
have to say that I'm a biologist
who's handling a little bit of Python. So don't pull your hair off
when you'll have a peak on it !
I wrote this script to be able to parse the Uniprot flat file, which
has been established by the Swiss Prot group.
The structure of the file is the same as Swiss Prot and it's been
working well before the new adjustments that Uniprot/Swiss Prot made
on their flat files.
I won't send you the flat file, cuz you can download it from this link
:
ftp://ftp!
.uniprot.org/pub/databases/uniprot/knowledgebase/uniprot_sprot.dat.gz
Thank you very much for the help !
Jonathan Boulais
University of Montreal
Hi Jonathan,
I am able to parse the entire uniprot_sprot.dat.gz file successfully
with the current swiss-prot parser. I have attached the current
SProt.py file from the cvs. Please install this over the current one,
and check to make sure that this version is indeed the one accessed
from your script. For example, do:
>>> from Bio.SwissProt import SProt
>>> print SProt.__file__
/Users/jchang/lib/jchang/python/Bio/SwissProt/SProt.pyc
And make sure that you have copied this file in that location. Please
let me know if there are further problems.
Jeff
SProt.py
Description: Binary data
_______________________________________________
Biopython-dev mailing list
Biopython-dev@xxxxxxxxxxxxx
http://biopython.org/mailman/listinfo/biopython-dev
|
|