首页 > 解决方案 > biopython中成对爆炸的问题

问题描述

我尝试在 python 脚本中的两个序列之间运行成对爆炸并使用 biopython 爆炸工具。

db='blast_database'通过向blast_cline添加参数,我对本地数据库运行爆炸没有问题。但是如果我用它替换这个参数subject='tmp_subject.fas'就不行了。

我的代码:

from Bio.Blast.Applications import NcbiblastnCommandline

blast_cline = NcbiblastnCommandline(query='tmp_query.fas', subject='tmp_subject.fas', evalue=1, outfmt=5, out='tmp.xml')

blast_cline()

我收到此错误消息:

Bio.Application.ApplicationError: Non-zero return code 3 from 'blastn -out tmp.xml -outfmt 5 -query tmp_query.fas -evalue 1 -subject tmp_subject.fas', message 'BLAST engine error: Empty CBlastQueryVector'

标签: pythonbioinformaticsbiopythonblast

解决方案


这应该工作:

from Bio.Blast.Applications import NcbiblastnCommandline
blast_cline = NcbiblastnCommandline(query='tmp_query.fas', subject='tmp_subject.fas', evalue=1, outfmt=5)()[0]
print(blast_cline)

推荐阅读