mhahsler/rBLAST

Error: Executable for blastx not found!

Closed this issue · 9 comments

Hi I am following the 16s guidelines, but for the viral database for blastx, looks like I downloaded the database correctly, but I get this error at the bottom.
Thanks!

if (!file.exists("D:\viralproteinDB")) {

list.files("D:\viralproteinDB")
[1] "ref_viruses_rep_genomes.ndb" "ref_viruses_rep_genomes.nhr"
[3] "ref_viruses_rep_genomes.nin" "ref_viruses_rep_genomes.nnd"
[5] "ref_viruses_rep_genomes.nni" "ref_viruses_rep_genomes.nog"
[7] "ref_viruses_rep_genomes.nos" "ref_viruses_rep_genomes.not"
[9] "ref_viruses_rep_genomes.nsq" "ref_viruses_rep_genomes.ntf"
[11] "ref_viruses_rep_genomes.nto" "taxdb.btd"
[13] "taxdb.bti"

bl <- blast(db="D:/viralproteinDB/ref_viruses_rep_genomes", type="blastx")
bl
Error: Executable for blastx not found! Please make sure that the software is correctly installed and, if necessary, path variables are set.

I just tried it on the 16s example and same error::

if (!file.exists("16S_rRNA_DB")) {

list.files("D:\16S_rRNA_DB")
[1] "16S_ribosomal_RNA.ndb" "16S_ribosomal_RNA.nhr"
[3] "16S_ribosomal_RNA.nin" "16S_ribosomal_RNA.nnd"
[5] "16S_ribosomal_RNA.nni" "16S_ribosomal_RNA.nog"
[7] "16S_ribosomal_RNA.nos" "16S_ribosomal_RNA.not"
[9] "16S_ribosomal_RNA.nsq" "16S_ribosomal_RNA.ntf"
[11] "16S_ribosomal_RNA.nto" "taxdb.btd"
[13] "taxdb.bti"
bl <- blast(db = "D:\16S_rRNA_DB\16S_ribosomal_RNA")
Error: Executable for blastn not found! Please make sure that the software is correctly installed and, if necessary, path variables are set.

The error message says that you need to install blastn and set the path if necessary...

OH I see,

Is this how I set the path?

Sys.setenv(PATH = paste(Sys.getenv("D:\blast2.13.0\bin"), "D:\blast2.13.0\bin", sep= .Platform$path.sep))

Sys.setenv(PATH = paste(Sys.getenv("D:\blast2.13.0\bin"), "D:\blast2.13.0\bin", sep= .Platform$path.sep)) > download.file("https://ftp.ncbi.nlm.nih.gov//blast//executables//blast+//LATEST//ncbi-blast-2.13.0+-x64-win64.tar.gz", "ncbi-blast-2.13.0+-x64-win64.tar.gz",mode='wb') trying URL 'https://ftp.ncbi.nlm.nih.gov//blast//executables//blast+//LATEST//ncbi-blast-2.13.0+-x64-win64.tar.gz' Content type 'application/x-gzip' length 120927588 bytes (115.3 MB) downloaded 115.3 MB > untar("ncbi-blast-2.13.0+-x64-win64.tar.gz", exdir="D:\blast2.13.0") > Sys.setenv(PATH = paste(Sys.getenv("D:\blast2.13.0\bin"), "D:\blast2.13.0\bin", sep= .Platform$path.sep)) > Sys.getenv("PATH") [1] ";D:\blast2.13.0\bin" > Sys.which("blastn") blastn "" > system("blastn -version") [1] 127
--
 
  |  
 


download.file("https://ftp.ncbi.nlm.nih.gov//blast//executables//blast+//LATEST//ncbi-blast-2.13.0+-x64-win64.tar.gz", "ncbi-blast-2.13.0+-x64-win64.tar.gz",mode='wb')
untar("ncbi-blast-2.13.0+-x64-win64.tar.gz", exdir="D:\blast2.13.0")
Sys.setenv(PATH = paste(Sys.getenv("D:\blast2.13.0\bin"), "D:\blast2.13.0\bin", sep= .Platform$path.sep))
Sys.getenv("PATH")
Sys.which("blastn")
system("blastn -version")

Ok I saw on some previous posts this is how you set the path:
download.file("https://ftp.ncbi.nlm.nih.gov//blast//executables//blast+//LATEST//ncbi-blast-2.13.0+-x64-win64.tar.gz", "ncbi-blast-2.13.0+-x64-win64.tar.gz",mode='wb')

untar("ncbi-blast-2.13.0+-x64-win64.tar.gz", exdir="D:\blast2.13.0")

Sys.setenv(PATH = paste(Sys.getenv("PATH"), "D:\blast2.13.0\bin", sep= .Platform$path.sep))

.getenv("PATH")
Sys.which("blastn")
system("blastn -version")

I am getting

Sys.getenv("PATH")
[1] ";D:\blast2.13.0\bin;D:\blast2.13.0\bin;D:\blast2.13.0\bin;D:\blast2.13.0\bin"
Sys.which("blastn")
blastn
""
system("blastn -version")
[1] 127

It doesn't look like a version??

I am still getting an error even when I set the path:

if (!file.exists("D:\viralproteinDB")) {
download.file("https://ftp.ncbi.nlm.nih.gov//blast//db//ref_viruses_rep_genomes.tar.gz", "ref_viruses_rep_genomes.tar.gz", mode='wb')

untar("ref_viruses_rep_genomes.tar.gz", exdir="D:\viralproteinDB")
}
list.files("D:\viralproteinDB")

bl <- blast(db="D:\viralproteinDB\ref_viruses_rep_genomes", type="blastx")
bl

Error: Executable for blastx not found! Please make sure that the software is correctly installed and, if necessary, path variables are set.

Thanks!

blastn
""

This means that the executable was not found. Instead of "" it should show the path and the executable. I am not a Windows person.

From ? blast:

R needs to be able to find the executable (mostly an issue with Windows). Try Sys.which("blastn") to see if the program is properly installed. If not, then you probably need to set the environment variable called PATH using something like Sys.setenv(PATH = paste(Sys.getenv("PATH"), "path_to_BLAST", sep= .Platform$path.sep)). You can use Sys.getenv("PATH") first to see what is currently in the search path.

Hi,

I ended up setting the path and it worked finally.
Sys.setenv(PATH = paste(Sys.getenv("PATH"), "H:\blast2.13.0\ncbi-blast-2.13.0+\bin", sep= .Platform$path.sep))

Sys.setenv(PATH = paste(Sys.getenv("PATH"), "H:\blast2.13.0\ncbi-blast-2.13.0+\bin", sep= .Platform$path.sep))
Sys.which("blastn")
blastn
"H:\blast2.13.0\ncbi-blast-2.13.0+\bin\blastn.exe"
system("blastn -version")
blastn: 2.13.0+
Package: blast 2.13.0, build Feb 22 2022 08:32:52