[Biopython] problem blasting on line

Jessica Grant jgrant at smith.edu
Wed Nov 17 16:22:08 EST 2010


Hello,

I am trying to use blast to extract contaminating sequences from a 
set of 454 sequence data.  My script uses NCBIWWW.qblast as follows:

result_handle = NCBIWWW.qblast("blastx", "nr", 
record.format("fasta"), ncbi_gi=False, descriptions= "1", 
alignments="1", format_type="XML", hitlist_size="1", 
entrez_query='(Bacteria[ORGN])')


It works...for a while but it stops, eventually, with the following error:



raceback (most recent call last):
   File "compBACTEUK.py", line 81, in <module>
     main()
   File "compBACTEUK.py", line 70, in main
     blastBACTEUK(arg)
   File "compBACTEUK.py", line 19, in blastBACTEUK
     result_handleE = NCBIWWW.qblast("blastx", "nr", 
record.format("fasta"), ncbi_gi=False, descriptions= "1", 
alignments="1", format_type="XML", hitlist_size="1", 
entrez_query='(Eukaryota[ORGN])')
   File 
"/Users/katzlab/Downloads/biopython-biopython-74d3c2a/build/lib.macosx-10.5-i386-2.5/Bio/Blast/NCBIWWW.py", 
line 114, in qblast
     handle = urllib2.urlopen(request)
   File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", 
line 121, in urlopen
     return _opener.open(url, data)
   File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", 
line 380, in open
     response = meth(req, response)
   File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", 
line 491, in http_response
     'http', request, response, code, msg, hdrs)
   File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", 
line 418, in error
     return self._call_chain(*args)
   File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", 
line 353, in _call_chain
     result = func(*args)
   File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", 
line 499, in http_error_default
     raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found



I suppose that the problem is a communication problem with ncbi.  I 
have written a try except statement into my script, but I seem to be 
losing quite a few records as they get skipped over if the error 
occurs.

I thought about downloading nr and using the standalone blast, but it 
seems the downloadable nr database comes in several parts, already 
formatted for blast.  Can I concatenate these?

Any thoughts on the problem with the qblast or other ways to 
circumvent this problem would be greatly appreciated!

Jessica





More information about the Biopython mailing list