blastn
Quick Start
- Command:
blastn - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/blastn - Version: 2.17.0+
- Full reference:
references/help.md
When To Use This Tool
- Search nucleotide queries against nucleotide databases.
- Prefer
blastnfor genome fragments, amplicons, contigs, or transcript sequences. - Use
-task megablastfor close matches and-task blastn-shortfor short primers or probes. - Use
tblastninstead when the query is protein and the target is nucleotide.
Common Patterns
# 1) Standard local database search with tabular output
blastn \
-query query.fa \
-db nt_db \
-outfmt "6 qaccver saccver pident length qstart qend sstart send evalue bitscore" \
-evalue 1e-10 \
-max_target_seqs 20 \
-num_threads 8
# 2) Primer or short oligo search
blastn \
-task blastn-short \
-query primers.fa \
-db nt_db \
-word_size 7 \
-outfmt 6
# 3) Query-vs-subject search without a prebuilt BLAST database
blastn \
-query query.fa \
-subject subject.fa \
-outfmt 7
Recommended Workflow
- Decide whether you are searching a local BLAST database (
-db) or a one-off FASTA subject (-subject). - Set
-taskfirst, because it changes defaults and search behavior materially. - Emit machine-readable output with
-outfmt 6or7unless you explicitly want pairwise text. - Interpret hits using e-value, percent identity, query coverage, and biological context together.
Guardrails
- Use
-helprather than--help; BLAST+ distinguishes those forms. -dband-subjectare mutually exclusive.- The default task is
megablast, which is fast but less sensitive for divergent homologs. - Always specify
-outfmtexplicitly for reproducible downstream parsing. -remotechanges execution mode and is usually not what you want for bulk local workflows.