NCBI BLAST+命令行未识别blastn命令问题求助
问题:insitu_probe_generator脚本调用NCBI BLAST+失败
我正在使用GitHub上的insitu_probe_generator脚本生成HCR探针,供实验室全员使用。我有Python使用经验,但从未接触过NCBI BLAST+。
在对生成的探针执行BLAST时遇到报错:调用cline()命令失败。我已经通过pip安装并导入了cline包,但没有效果。了解到问题可能是需要指定NCBI BLAST+可执行文件的路径,但不清楚如何将其集成到他人编写的复杂代码中(BLAST安装在C盘Program Files目录下)。
已尝试的操作
- 通过pip安装cline包(并非脚本强制要求)
- 定义了BLAST可执行文件路径:
但因为代码不是自己编写的,不知道如何正确集成到脚本中。曾参考Stack Overflow上的类似问题(指定blastn.exe路径可解决问题),但未成功。blastn = r"C:\Program Files\NCBI\blast-BLAST_VERSION+\bin\blastn.exe"
环境说明
- 系统:Windows
- 运行环境:Anaconda的Jupyter Notebook
报错信息
ApplicationError Traceback (most recent call last) Cell In[1], line 16 14 strt = start() 15 name,fullseq,amplifier,pause,choose,polyAT,polyCG,BlastProbes,db,dropout,show,report,maxprobe,numbr = strt[0],strt[1],strt[2],strt[3],strt[4],strt[5],strt[6],strt[7],strt[8],strt[9],strt[10],strt[11],strt[12],strt[13] ---> 16 maker(name,fullseq,amplifier,pause,choose,polyAT,polyCG,BlastProbes,db,dropout,show,report,maxprobe,numbr) File c:\Users\wilke\OneDrive - Hubrecht Institute\Jupyter notebooks\insitu_probe_generator-v.0.3.2\maker37cb.py:411, in maker(name, fullseq, amplifier, pause, choose, polyAT, polyCG, BlastProbes, db, dropout, show, report, maxprobe, numbr) 408 ## Probe BLAST setup and execution from FASTA file prepared in previous step 410 cline = bn(query = str(name)+"PrelimProbes.fa", subject = db, outfmt = 6, task = 'blastn-short') #this uses biopython's blastn formatting function and creates a commandline compatible command --> 411 stdout, stderr = cline() #cline() calls the string as a command and passes it to the command line, outputting the blast results to one variable and errors to the other 413 ## From results of blast creating a numpy array (and Pandas database) 414 dt = [(np.unicode_,8),(np.unicode_,40),(np.int32),(np.int32),(np.int32),(np.int32),(np.int32),(np.int32),(np.int32),(np.int32),(np.float),(np.float)] File ~\anaconda3\envs\hcr\lib\site-packages\Bio\Application\__init__.py:574, in AbstractCommandline.__call__(self, stdin, stdout, stderr, cwd, env) 571 stderr_arg.close() 573 if return_code: --> 574 raise ApplicationError(return_code, str(self), stdout_str, stderr_str) 575 return stdout_str, stderr_str ApplicationError: Non-zero return code 1 from 'blastn -outfmt 6 -query tbx18PrelimProbes.fa -subject "C:\\Users\\wilke\\OneDrive - Hubrecht Institute\\Jupyter notebooks\\insitu_probe_generator-v.0.3.2\\fastas\\Tbx18-cDNA.fa" -task blastn-short', message "'blastn' is not recognized as an internal or external command,"
当前使用代码
from start import start from maker37cb import maker import pandas as pd from Bio.Seq import Seq from Bio.Blast.Applications import NcbiblastnCommandline import io import numpy as np import pandas as pd import cline blastn = r"C:\Program Files\NCBI\blast-BLAST_VERSION+\bin\blastn.exe" strt = start() name,fullseq,amplifier,pause,choose,polyAT,polyCG,BlastProbes,db,dropout,show,report,maxprobe,numbr = strt[0],strt[1],strt[2],strt[3],strt[4],strt[5],strt[6],strt[7],strt[8],strt[9],strt[10],strt[11],strt[12],strt[13] maker(name,fullseq,amplifier,pause,choose,polyAT,polyCG,BlastProbes,db,dropout,show,report,maxprobe,numbr)
更新情况
尝试修改源码添加可执行文件路径(参考相关帖子),但仍报错,路径未被识别。
内容的提问来源于stack exchange,提问作者WilkeM
相关产品推荐
相关产品推荐

