NCBIblastPcommandline错误

2024-09-27 00:15:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试从一个目录中的几个文件自动输出blast。这里的变量是硬编码的,但稍后将由用户定义。我的填充将通过一个循环进行更改,但我在python中对文件运行NcbiblastpCommandline时遇到问题。目标是在本地运行blast,输入多个更大的fasta文件,这样blast将按顺序运行每个批处理文件,输出到tsv,在那里我解析数据并传递给clustalw本地对齐。在

Input_file="minifasta.fasta"
data="uniprot_database"
E_Value_Thresh=1e-10
counter=1
Filename2= 'Batch'+str(counter)
from Bio.Blast.Applications import NcbiblastpCommandline
blast_output_file='blastout.tsv'
NcbiblastpCommandline.outfile=Filename2
from Bio.Blast.Applications import NcbiblastpCommandline
cline = NcbiblastpCommandline(query=Input_file, db=data,outfmt=6, 
out=blast_output_file, evalue= E_Value_Thresh)
print(cline)
stdt, stdr= cline()

我一直收到一个错误消息,说“NcbiblastpCommandline”对象不可编辑。我被定向到stdt,stdr行,但没有stdt,stdr另一个错误消息说命令没有被重新注册,错误消息指向stdout\u str,我找不到Python3中NcbiblastpCommandline用法的最新示例来指导我。在

我收到的完整错误是:

^{pr2}$

Tags: 文件消息inputdatatsvvalue错误fasta
1条回答
网友
1楼 · 发布于 2024-09-27 00:15:50

首先运行which blastp,找到blastp的完整路径,并将其作为NcbiblastpCommandline的参数。在

from Bio.Blast.Applications import NcbiblastpCommandline
blastp_path = '/path/to/blastp'
cline = NcbiblastpCommandline(cmd=blastp_path, query=Input_file, db=data,outfmt=6, 
out=blast_output_file, evalue= E_Value_Thresh)

如果现在执行print(cline),它应该打印出要运行的完整命令。通过复制/粘贴此输出并从命令行运行它,再次检查这是否有效。在

相关问题 更多 >

    热门问题