Trying to do a local blast using NCBIBLAST+, already downloaded in the mentioned path. I am using Win10 and Spyder.
from Bio.Blast.Applications import NcbiblastpCommandline
blastp=r"C:\NCBI\blast-BLAST_VERSION+\bin\blastp.exe"
blastp_cline= NcbiblastpCommandline(blastp,query="test.fasta",db='Bos_transcript_and_prot\\bos_protein.fasta',outfmt=5,evalue=0.001, out="test.xml")
blastp_cline
from Bio.Blast import NCBIXML
with open("test.xml") as result_handle:
E_VALUE_THRESH=0.01
blast_records = NCBIXML.parse(result_handle)
blast_record = NCBIXML.read(result_handle)
for alignment in blast_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] + "...")
I have my database created as well as the fasta files contain only protein sequences. Still .XML file is not getting created and also the blastp_cline variable is not getting created. Thanks in advance
For execution of the command use:
stdout, stderr = blastp_cline()