Overview
BLAST (Basic Local Alignment Search Tool) is the standard algorithm for comparing a query sequence against a database of known sequences. It rapidly identifies statistically significant local alignments, providing functional annotation for novel genes, detecting homology across distant species, and revealing evolutionary relationships. BLAST sacrifices the guaranteed optimality of full dynamic programming for a heuristic that is fast enough to search databases containing billions of residues. The statistical significance of each hit is reported as an E-value, the expected number of chance alignments with a given score in a database of that size.
Key Concepts
BLAST works by first breaking the query into short words (typically 3 for proteins, 11 for nucleotides), scanning the database for exact matches to these words, and then extending promising matches in both directions to build longer alignments. Variants address specific use cases: BLASTP compares protein queries against protein databases, BLASTN compares nucleotide queries against nucleotide databases, BLASTX translates a nucleotide query in all six reading frames for protein-level comparison, and PSI-BLAST iteratively builds a position-specific score matrix to detect distant homologs. MegabLAST is optimized for highly similar sequences, while discontiguous MegabLAST handles cross-species comparisons.
Applications
BLAST is the first step in annotating unknowns from DNA sequencing projects. It assigns putative function to novel proteins by detecting homology to characterized protein structures. In bacterial genetics, BLAST identifies virulence factors and antibiotic resistance genes. Recombinant DNA technology uses BLAST to verify construct integrity by aligning sequencing reads against expected vector sequences.
Practical Protocol
Standard BLAST searches are run via the NCBI web interface or command line. For a protein query against the nr database using command-line BLAST: blastp -query query.fasta -db nr -out results.txt -evalue 1e-5 -num_threads 8 -outfmt "6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore stitle". The -outfmt 6 produces tabular output ideal for downstream parsing. The E-value (expectation value) represents the number of hits expected by chance at a given score given the database size, values < 1 × 10⁻⁵ for proteins or < 1 × 10⁻¹⁰ for nucleotides indicate significant homology. The bit score is a normalized score independent of database size, enabling comparison across searches; scores above 50 are usually meaningful for proteins. For a translated search (nucleotide query against protein database), use BLASTX: blastx -query ests.fasta -db swissprot -out blastx_results.txt -evalue 1e-5. For highly similar sequences, use MegabLAST: blastn -task megablast -query query.fna -db nt -out megablast_results.txt -evalue 1e-50. Optimize parameters: reduce word size to 2 (for proteins) or 7 (for nucleotides) to increase sensitivity for distant homologs; increase the threshold for extending seed hits. For iterative profile search, run PSI-BLAST: psiblast -query seed.fasta -db nr -out psi_results.txt -num_iterations 3 -evalue 1e-3. PSI-BLAST constructs a position-specific scoring matrix (PSSM) from the first-round hits and uses it for subsequent rounds, detecting remote homologs that standard BLAST misses. For large-scale batch searches, use diamond which is 100–1000× faster than BLASTP: diamond blastp -d nr.dmnd -q query.fasta -o diamond_results.txt --outfmt 6 --evalue 1e-5 --threads 16.