[Biopython] Passing sequence to local BLAST
Sheila the angel
from.d.putto at gmail.com
Thu Jul 7 10:26:48 UTC 2011
Hi All,
I want to download genbank file from NCBI and pass the protein sequence
directly to the local BLAST. But I am getting error in BLAST step
#-------------------------------------------------------------------------------------------
from Bio import SeqIO
from Bio import Entrez
from Bio.Blast.Applications import NcbiblastpCommandline
id='200203'
handle = Entrez.efetch(db="protein", id=id, rettype="gp")
seq_record = SeqIO.read(handle, "gb")
x=seq_record.seq #getting the
sequence in a variable x
blastp_cline = NcbiblastpCommandline(query=x, db="protein_database",
evalue=0.001) # My BLAST command
result_handle, stderr = blastp_cline() #Running BLAST and
getting error :(
#-------------------------------------------------------------------------------------------
At this last step I am getting error.....
I sort-of understand the problem.....it is taking value of x as a file name
while its a variable which contains the sequence.
Is there any way out to this problem without making temporary file.
Thanks in Advance
--
Cheers
Sheila
More information about the Biopython
mailing list