[BioPython] qblast fails on parsing XML results

Ilya Soifer ilya.soifer at gmail.com
Mon Feb 27 10:38:39 EST 2006


Hi,
I hope that I send it to the correct list.
When I run qblast I get

>>> res1 = NCBIWWW.qblast("blastn", "nr", seq1)

Traceback (most recent call last):
 File "<pyshell#24>", line 1, in -toplevel-
   res1 = NCBIWWW.qblast("blastn", "nr", seq1)
 File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line
1130, in qblast
   i = results.index("Connection: close")
ValueError: substring not found

This happens since the results that Blast return no longer have this header

   # HTTP/1.1 200 OK
   # Date: Wed, 05 Oct 2005 02:13:33 GMT
   # Server: Nde
   # Content-Type: text/plain
   # Connection: close
   #


but this one

HTTP/1.0 200 OK
Date: Mon, 27 Feb 2006 11:54:40 GMT
Content-Type: application/xml
Server: Nde
Via: 1.1 proxy7 (NetCache NetApp/6.0.2)

I guess it might be better to look for something like "<?xml" etc. in
order to remove the annoying header.

Ilya



More information about the BioPython mailing list