[Biopython] SeqIO.parse exception on Google App Engine

Reece Hart reece at berkeley.edu
Thu Apr 8 23:38:10 UTC 2010


Hi-

I'm trying to fetch a Genbank record and parse it in the Google App Engine
environment. A command line version works fine, but when using exactly the
same code under Google App Engine, SeqIO throws throws the following
exception:
   ...
   File "/local/home/reece/tmp/demo1/Bio/GenBank/Scanner.py", line 746, 
in parse_footer
     self.line = self.line.rstrip(os.linesep)
AttributeError: 'module' object has no attribute 'linesep'

The environment:
- Ubuntu Lucid beta1
- Python 2.6.5
- Biopython 1.53
- GAE 1.3.2

Test case:
I put together a simple test case that retrieves a raw (text) Genbank
record using Bio.Entrez (efetch); this works in both environments.
Parsing that record works on the command line, but not under GAE.

- curl http://harts.net/reece/tmp/demo1.tgz | tar -xvzf-
- cd demo1
- update symlink ./Bio to a Biopython tree
eg$ ln -s /usr/share/pyshared/Bio Bio
My intent is to prepend Bio to sys.paths much the way I would expect this
to be deployed (i.e., without updating sys.path).


Command line test:
$ ./lookup
fetch_text:LOCUS       NM_004006              13993 bp    mRNA    
linear   PRI 25-MAR-2010
fetch_parse:NM_004006.2 / NM_004006 / Homo sapiens dystrophin (DMD), 
transcript variant Dp427m,

GAE test:
In the demo1 directory:
$ dev_appserver.py .
and, in another terminal:
$ curl http://localhost:8080/
You'll see the exception in the http reply and in the appserver log


Thanks for any help/advice/pointers,
Reece

P.S. I'm learning Python and GAE at the same time, so silly errors are
possible (nay, likely).




More information about the Biopython mailing list