LinuxCommandLibrary

blastn

Nucleotide-to-nucleotide sequence alignment search

TLDR

Align sequences using megablast with e-value threshold

$ blastn -query [query.fa] -subject [subject.fa] -evalue [1e-9]
copy
Align sequences using standard blastn
$ blastn -task blastn -query [query.fa] -subject [subject.fa]
copy
Align with custom tabular output to file
$ blastn -query [query.fa] -subject [subject.fa] -outfmt '6 qseqid qlen qstart qend sseqid slen sstart send bitscore evalue pident' -out [output.tsv]
copy
Search nucleotide databases with multiple threads
$ blastn -query [query.fa] -db [path/to/blast_db] -num_threads [16] -max_target_seqs [10]
copy
Search the remote non-redundant nucleotide database
$ blastn -query [query.fa] -db nt -remote
copy
Display help
$ blastn -h
copy

SYNOPSIS

blastn [options]

DESCRIPTION

blastn performs nucleotide-to-nucleotide BLAST (Basic Local Alignment Search Tool) searches. It finds regions of similarity between nucleotide sequences, which can indicate functional, structural, or evolutionary relationships.
The tool supports multiple search algorithms including megablast (default, for highly similar sequences), discontiguous megablast, and standard blastn. Results can help identify genes, compare genomes, or find homologous sequences.

PARAMETERS

-query file

Input file with query sequences in FASTA format
-subject file
Subject sequence file for direct comparison
-db name
BLAST database name for searching
-evalue threshold
Expectation value (E) threshold for reporting matches
-task name
Algorithm variant: megablast, dc-megablast, or blastn
-outfmt format
Output format (0=pairwise, 6=tabular, 7=tabular with headers)
-out file
Output file name
-num_threads n
Number of CPU threads to use
-max_target_seqs n
Maximum number of aligned sequences to keep
-remote
Execute search on NCBI servers

CAVEATS

Large database searches require significant memory and time. Remote searches are rate-limited. Local database searches require pre-formatted BLAST databases created with makeblastdb.

HISTORY

BLAST was developed at NCBI (National Center for Biotechnology Information) with the original algorithm published in 1990 by Altschul et al. It has become one of the most widely used bioinformatics tools.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community