This is a test version of Biostars. For the public version, visit https://www.biostars.org.
I need help to fix this script, it runs nicely but gives error message that I am not able to fix.
~/Documents/Blast/makeblastdb -in Bmori.fst -dbtype nucl -out Bmori_BlastDB -parse_seqids; ## Creating Bmori database

$BLAST_DB='Bmori_BlastDB'; ## storing in a variable
@QUERY_FILES=`ls *.fas`; ## list all the transcriptomes of different species

foreach $tmp (@QUERY_FILES)
{
    #print "$tmp";
    chomp($tmp); ##remove new line character
    /appl/bio/blast/2.2.31/bin/blastn -query $tmp -db $BLAST_DB -out $tmp\_vs\_$BLAST_DB.txt -evalue 0.01 -outfmt 6; ## blast version 2.2.25 command
}

Error message:

BLAST Database error: No alias or index file found for nucleotide database [Bmori_BlastDB.psq] in search path [/homeappl/home/shuezu/transcriptomes:/proj/csc/biosci/biodb/production/blast:]
gene blast

1 answer

Check the name of your database file, in particular, check that the name you're passing to blastn has the same suffix as the file on disk. You must use the name of the file you ran formatdb on. A common mistake is to use the name of the index file created by formatdb, e.g. if you formatted the file sequences.fa with formatdb -i sequences.fa -p F, you should also have sequences.fa.nhr, sequences.fa.nin and sequences.fa.nsq and the name of the database used by blastn will be sequences.fa.

Log in to answer this question.