This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filter command-line BLAST results by organism

In legacy blast (blastall) it was easy to do a remote BLAST query from the command line that only returned hits for a single organism:

blastall -u "[Arabidopsis thaliana[organism]" -p blastp -d nr -i my_protein_input.fas -o my_protein_input_vs_nr_Athaliana.blastout.txt

However, this seems to have been removed with the release of BLAST+. Aside from filtering hits after they are returned, is it possible to perform a query on the 'nr' database that only returns hits for a single specified taxon?

alignment blast genome taxonomy

I think you just add the -remote flag and use -entrez_query instead

How can use more than one species in the remote search.

Thanks

1 answer

I'm having a similar problem. It seems the best option is to create your own database. Make a blast_db with the fasta file for your organism if you have it, otherwise you have to do something like this:

  1. Download the prebuilt nr database (ncbi?).
  2. Search the Entrez Protein database with query: "txid7742[ORGN]"
  3. Select "Send to File" and choose format "GI list"
  4. Use the list of GIs from the previous step with the blastdb_aliastool to build an aliased blastdb of just your organism (takes several seconds), eg:

    blastdb_aliastool -gilist vertebrates.gi_list.txt -db nr -out nr_vertebrates -title nr_vertebrates
    
  5. Search against your new (aliased) database:

    blastx -query query.fa -db nr_vertebrates
    

(from this thread: Vertebrate Subset Nr Database? Build My Own?)

Log in to answer this question.