This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to run BLAST locally for multiple fasta files

Hi All!

I would like to know how can I run BLAST locally in multiple files. Here is the command I am using for a single file:

bsub -n 16 blastp -query sequences_dsrb_sol_1_10.fasta -db database/nhr -outfmt '6 std salltitles' -num_threads 16 -max_target_seqs 1 -evalue 1e-30 -out faa_two_testing_s3_proteins_sol_1_10_taxonomy.txt

And here is the command I tried for multiple files:

bsub -n 16 ls *.fasta | parallel -a - blastp -query {} -db database/nhr -outfmt '6 std salltitles' -num_threads 16 -max_target_seqs 1 -evalue 1e-30 -out {}.txt

However, I get the following error:

/usr/bin/bash: blastp: command not found

Do you know any other methods to run BLAST in parallel for multiple fasta files?

Thank you!

fasta blast

2 answers

Are you using a job scheduler on a compute cluster? Based on bsub in your command, you must be. If you are on a cluster using parallel on top likely does not make sense since you may as well start individual jobs in parallel (pun intended) using the scheduler.

Since the error is about blastp not being found you first need to sort out $PATH or if your cluster uses modules system then load the module for blast first.

Hi GenoMax!

I try to load the module from the shell file but it always sends an error. Even if I run it outside without a shell file, seems like it doesn't run BLAST if the parallel command is there. Do you know what could be happening?

Thanks!

contact your system admin and ask them how your system is set up

So sounds like you are using modules for software management on your cluster? So relevant module would need to be added in the shell or inside your script.

If you have a job scheduler available then using that for independent jobs to run blast on the list of files makes more sense than using parallel.

You can use SEDA (https://www.sing-group.org/seda/). The "BLAST" operation (https://www.sing-group.org/seda/manual/operations.html#blast) allows to do this.

Log in to answer this question.