[Biopython] Bad Gateway IOerror when querying Entrez

Brett Bowman bnbowman at gmail.com
Sat Feb 5 19:10:37 UTC 2011


I'm running a script that takes a multi-fasta file and runs a local
PSI-Blast on each seq, then queries NCBI for the full record of each one of
those hits.  It works fine most of the time, but occasionally it throws an
IOError telling me that there is a "Bad Gateway".  Curiously, this causes
the script to crash sometimes but not others, and sometimes it gives me a
warning of a "J" in the sequence when there are no Js in any of my files,
except in the Fasta header.

Does anyone know what causes this or how to stop it?  Or do I just need to
trap IO exceptions from every web query that I run, with appropriate code to
retry failed queries?

Brett Bowman
Woelk Lab
UCSD Medical School

*** WARNING *** Assuming Amino (see -seqtype option), invalid letters found:
J
Traceback (most recent call last):
  File "AlignmentFromBlast.py", line 246, in <module>
    seq_data = fetch_seqs_from_entrez(len(gi_nums), webenv, query_key)
  File "AlignmentFromBlast.py", line 125, in fetch_seqs_from_entrez
    webenv=webenv, query_key=query_key)
  File "/usr/lib/pymodules/python2.6/Bio/Entrez/__init__.py", line 109, in
efetch
    return _open(cgi, variables)
  File "/usr/lib/pymodules/python2.6/Bio/Entrez/__init__.py", line 353, in
_open
    raise IOError("Bad Gateway!")
IOError: Bad Gateway!



More information about the Biopython mailing list