[BioPython] Is the bug still there??

Eirik Sønneland eirik.sonneland at student.umb.no
Tue Feb 22 03:42:13 EST 2005


Hi!

Thanks for new release of biopython. Still trying to do a "simpel" Blast 
search using qblast and the exampel code given in documentation at 
biopython.org:
*******************
import sys
from Bio.Blast import NCBIWWW
from Bio import Fasta

file_for_blast = open('Fastaformat.txt', 'r')
f_iterator = Fasta.Iterator(file_for_blast)
f_record = f_iterator.next()

b_results = NCBIWWW.qblast('blastn', 'nr', f_record).read()

b_record = NCBIWWW.BlastParser().parse_str(b_results)

E_VALUE_THRESH = 0.04

for alignment in b_record.alignments:
    for hsp in alignment.hsps:
        if hsp.expect < E_VALUE_THRESH:
            print '****Alignment****'
            print 'sequence:', alignment.title
            print 'length:', alignment.length
            print 'e value:', hsp.expect
            print hsp.query[0:75] + '...'
            print hsp.match[0:75] + '...'
            print hsp.sbjct[0:75] + '...'
****************
This gives following error message(what have I done wrong? Is the bug 
still there??):


Warning (from warnings module):
  File "C:\Python24\lib\site-packages\Bio\Blast\NCBIWWW.py", line 1062
    warnings.warn("qblast works only with blastn and blastp for now.")
UserWarning: qblast works only with blastn and blastp for now.

Traceback (most recent call last):
  File "C:\Python24\MyWorkspace.py", line 23, in -toplevel-
    b_results = NCBIWWW.qblast('blastn', 'nr', f_record).read()
  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 1081, 
in qblast
    rid, rtoe = _parse_qblast_ref_page(handle)
  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 1152, 
in _parse_qblast_ref_page
    return rid, int(rtoe)
ValueError: invalid literal for int(): 1.1 200 OK

Date: Tue, 22 Feb 2005 08:28:44 GMT

Server: Apache/1.3.27 (Unix) mod_fastcgi/2.4.0

Content-Type: text/html

Via: 1.1 www.ncbi.nih.gov

X-Cache: MISS from www.ncbi.nih.gov

Connection: cl
********************
Please advice!

Regards,
Eirik



More information about the BioPython mailing list