[BioPython] Blast Error

Omenkeukwu, Gregory OmenkeukwuG at americanimaging.net
Mon Jan 16 13:05:27 EST 2006



> I get the following error when I run the BLAST code in the tutorial. I will appreciate any help I can get on this issue. Thanks
> 
> 
> 
> Warning (from warnings module):
>   File "C:\Python24\lib\site-packages\Bio\Blast\NCBIWWW.py", line 1070
>     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\biopython examples\blast_example.py", line 10, in -toplevel-
>     result_handle = NCBIWWW.qblast('blastn', 'nr', f_record)
>   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 1092, in qblast
>     rid, rtoe = _parse_qblast_ref_page(handle)
>   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 1177, in _parse_qblast_ref_page
>     return rid, int(rtoe)
> ValueError: invalid literal for int(): 1.0 400 We don't support 0.9
> 
> 
> 
> 
> 
> 
> just for reference, the code I am running is listed below
> 
> from Bio import Fasta
> 
> file_for_blast = open('m_cold.fasta', 'r')
> f_iterator = Fasta.Iterator(file_for_blast)
> 
> f_record = f_iterator.next()
> 
> 
> from Bio.Blast import NCBIWWW
> result_handle = NCBIWWW.qblast('blastn', 'nr', f_record)
> 
> 
> # save the results for later, in case we want to look at it
> save_file = open('my_blast.out', 'w')
> blast_results = result_handle.read()
> save_file.write(blast_results)
> save_file.close()
> 
> import cStringIO
> blast_out = cStringIO.StringIO(blast_results)
> 
> 
> blast_out = open('my_blast.out', 'r')
> 
> 
> from Bio.Blast import NCBIXML
> 
> b_parser = NCBIXML.BlastParser()
> b_record = b_parser.parse(blast_out)
> 
> 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] + '...'
> 
> 
> Gregory Omenkeukwu
> Provider Information Management
> 



======================================================================
The material in this transmission contains confidential information
intended for the addressee. If you are not the addressee, any disclosure 
or use of this information by you is strictly prohibited. If you have
received this transmission in error, please delete it and destroy
all copies. Notify American Imaging Management at 847 564-8500.
Thank You. 
======================================================================




More information about the BioPython mailing list