Entering edit mode
22 months ago
vvs.hazia
▴
10
Trying different tutorials, the only code that produced the BLAST output using biopython in JupiterNotebooke in my case is below. But the resulting file is empty - there is no match produced. On the other hand, the web ncbiblast produces matches, so it should exist. I guess the problem is in the database, here it is custom-made from GRCh38_latest_genomic.fna.gz by makeblastdb command in the Comand line. But I did not find how to imply a custom database in this case properly. Can somebody help me? please?
#THE CODE:
blast_results = {}
fasta_string = open("Homo_sapiens_GAPDH_genomic_sequence.fa").read()
result_handle = NCBIWWW.qblast(program="blastn",database="human",sequence=fasta_string, format_type='XML', nucl_penalty=-1, nucl_reward=1, word_size=11, gapcosts="4 1", filter="none")
with open("GAPDH_human_out.xml", 'w') as save_file:
blast_results = result_handle.read()
save_file.write(blast_results)
#THE OUTPUT FILE CONTENTS:
<BlastOutput>
<BlastOutput_program>blastn</BlastOutput_program>
<BlastOutput_version>BLASTN 2.13.0+</BlastOutput_version>
<BlastOutput_reference>Stephen F. Altschul, Thomas L. Madden, Alejandro A. Schäffer, Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997), "Gapped BLAST and PSI-BLAST: a new generation of protein database search programs", Nucleic Acids Res. 25:3389-3402.</BlastOutput_reference>
<BlastOutput_db>human</BlastOutput_db>
<BlastOutput_query-ID>Query_22687</BlastOutput_query-ID>
<BlastOutput_query-def>chromosome:GRCh38:12:6533912:6538974:1</BlastOutput_query-def>
<BlastOutput_query-len>3863</BlastOutput_query-len>
<BlastOutput_param>
<Parameters>
<Parameters_expect>10</Parameters_expect>
<Parameters_sc-match>1</Parameters_sc-match>
<Parameters_sc-mismatch>-1</Parameters_sc-mismatch>
<Parameters_gap-open>4</Parameters_gap-open>
<Parameters_gap-extend>1</Parameters_gap-extend>
</Parameters>
</BlastOutput_param>
<BlastOutput_iterations>
<Iteration>
<Iteration_iter-num>1</Iteration_iter-num>
<Iteration_query-ID>Query_22687</Iteration_query-ID>
<Iteration_query-def>chromosome:GRCh38:12:6533912:6538974:1</Iteration_query-def>
<Iteration_query-len>3863</Iteration_query-len>
<Iteration_hits> </Iteration_hits>
<Iteration_stat>
<Statistics>
<Statistics_db-num>0</Statistics_db-num>
<Statistics_db-len>0</Statistics_db-len>
<Statistics_hsp-len>0</Statistics_hsp-len>
<Statistics_eff-space>0</Statistics_eff-space>
<Statistics_kappa>-1</Statistics_kappa>
<Statistics_lambda>-1</Statistics_lambda>
<Statistics_entropy>-1</Statistics_entropy>
</Statistics>
</Iteration_stat>
</Iteration>
</BlastOutput_iterations>
</BlastOutput>
Please use
101010
button to formatcode
part of your question in future. I have done it for you this time.Thanks :))