[BioPython] How can I get a more explicite error

Yvan.Strahm at bccs.uib.no Yvan.Strahm at bccs.uib.no
Wed Mar 18 14:47:58 EDT 2009


Hello List,

I try to get a grip on Biopython and followed the chapter 6 form the  
tutorial (http://www.biopython.org/DIST/docs/tutorial/Tutorial.html)

I run this script:

from Bio.Blast import NCBIStandalone
import re
import sys

my_blast_db =  
"/export/scratch/yvans/BEE/Apis_mellifera_ligustica_complete_mitochondrial_genome.fasta"
my_blast_file = sys.argv[1]
my_blast_exe = "/Home/lundalm/yvans/src/blast-2.2.19/bin/blastall"

result_handle, error_handle = NCBIStandalone.blastall(my_blast_exe, "blastn",
                                                       my_blast_db,  
my_blast_file,
                                                       gap_open=5,
                                                       gap_extend=2,
                                                       filter ='F',
                                                       expectation=1000)

blast_results = result_handle.read()

my_results=sys.argv[1]+".xml"

save_file = open(my_results, "w")
save_file.write(blast_results)
save_file.close()

I got this error

[yvans at lundalm BEE]$ python bioblast.py s_1_2_eland_extended.8000000.fta
Traceback (most recent call last):
   File "bioblast.py", line 16, in <module>
     blast_results = result_handle.read()
SystemError: Objects/stringobject.c:4271: bad argument to internal function

if the number of sequence blasted agianst the db is greater than 500000.
The sequence are small reads from a solexa sequencing project.

Is there a size limitation?

And should I save(keep) only the sequence I am interested in into  
my_results instead of saving everything?

And is there a way of running some tests before doinr the blast_result.read()?

Now I try to use keep_hits=1 as a blast parameters in order to reduce  
the size of my_result, will see.

Thanks for your time and help

Cheers,
yvan



More information about the BioPython mailing list