This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to run blastp against nr databse locally

I have downloaded the preformatted nr db using the below command and uncompressed all files to a folder. The folder contains multiple files such as nr.pto, nr.pot, nr.38.pog etc.

wget 'ftp://ftp.ncbi.nlm.nih.gov/blast/db/nr.*.tar.gz'

Executing the following command says blastp -query file.fasta -db nr -out results.out BLAST Database error: No alias or index file found for protein database [nr] in search path.

I tried doing makeblastdb -dbtype prot -in nr and it deleted all the files in my nr folder.

Is this the right step before executing a blastp?

nr blastp

normally to create a index file for blast databases I run:

makeblastdb -in file -dbtype prot

2 answers

You are missing an alias file, this is a text file that points to all those nr files. See this page for more info https://www.ncbi.nlm.nih.gov/books/NBK279693/

And also instead of wget you can use update_blastdb.pl --passive --decompress nr to download the full nr database. The script is included as part of the blast distribution.

If you do blastp -query file.fasta -db nr -out results.out make sure that the alias file is in your current folder. Otherwise it would be blastp -query file.fasta -db your/database/folder/nr -out results.out

The alias file name is nr.pal and is present in the last nr.tar.gz file

@gb Thank you I had the nr.pal file and I did as you suggested. Now it says Error:Not a valid version 4 database.

Do I have to run makeblastdb in nr folder before the blastp?

@gb Thank you I had the nr.pal file and I did as you suggested. Now it says Error:Not a valid version 4 database.

Do I have to run makeblastdb in nr folder before the blastp?

No, you don't have to run makeblastdb. Are you using an old version of blast?

You can see that by doing blastp -version

You can either update blast, which is definitely the most recommended thing to do. Or you download the v4 database ftp://ftp.ncbi.nlm.nih.gov/blast/db/v4/

my version is blastp: 2.7.1+ Package: blast 2.7.1, build Mar 12 2018 19:11:30

Yes thank you it was the version incompatibility. It works fine with the latest executables.

Be aware that v4 indexes are no longer being updated (after Feb 2020).

The entire process of installing BLAST databases and running BLAST searches is automated using the BioLegato applications found in the BIRCH system http://home.cc.umanitoba.ca/~psgendb. The following videos show BioLegato in action:

Installing BLAST databases on your own computer https://www.youtube.com/watch?v=R_gxDCXNUHY

BLAST Searches Through a Data Science Lens https://www.youtube.com/watch?v=Os3eKqXF4Mw

Log in to answer this question.