In order to limit a BLAST search by taxonomy, one needs to provide the NCBI taxonomy ID(s) (taxid) for given organism(s). A taxid is simply a number that specifies a node in the taxonomic tree. For example, 9606 is the taxid for human, 9989 is the taxid for rodentia, and 2 is the taxid for all bacteria. Taxids are preferable to organism names as the latter can be ambiguous. For instance, bacteria is both a genus of insects as well as a superkingdom.
Additionally, one may use the -negative_taxids and -negative_taxidlist options to exclude sequences by taxid.
Limiting a BLAST search by taxonomy
$ blastn –db nt –query QUERY –taxids 9606 –outfmt 7 –out OUTPUT.tab
For additional details, please see https://www.ncbi.nlm.nih.gov/books/NBK569839/#usrman_BLAST_feat.Taxonomic_filtering_fo
Publication Details
Publication History
Created: June 23, 2008; Last Update: January 7, 2021.
Copyright
BLAST is a Registered Trademark of the National Library of Medicine
Publisher
National Center for Biotechnology Information (US), Bethesda (MD)
NLM Citation
BLAST® Command Line Applications User Manual [Internet]. Bethesda (MD): National Center for Biotechnology Information (US); 2008-. Limiting a Search by taxonomy. 2008 Jun 23 [Updated 2021 Jan 7].