What Is Sequence Alignment and How Does BLAST Perform It?
Updated
Sequence alignment is the process of arranging two or more biological sequences—DNA, RNA, or protein—so that positions with shared ancestry or similar function line up with each other. BLAST (Basic Local Alignment Search Tool) performs a specific kind of alignment: it finds short, local regions of similarity between a query sequence and sequences in a database, then calculates the statistical significance of each match. You would use BLAST when you have a sequence and want to know what it resembles, rather than when you need a full end-to-end alignment of two sequences you already know are related.
What sequence alignment actually produces
An alignment is a set of positional correspondences. When two sequences are aligned, matching positions are placed in the same column, and gaps are inserted where one sequence has residues the other lacks. The output is a row of paired characters plus gap symbols, which lets you count identities, similarities, and differences position by position.
Two sequences can be aligned in fundamentally different scopes:
- Local alignment finds the highest-scoring region of similarity within otherwise dissimilar sequences. It does not require the rest of the sequences to match.
- Global alignment forces the two sequences to be compared across their entire span, from start to end, penalizing gaps and mismatches everywhere.
BLAST is a local alignment tool. That design choice is why it can detect a shared protein domain in two sequences that are otherwise unrelated, and why it does not try to stretch a match across regions that have no similarity.
How BLAST finds local regions of similarity
BLAST does not attempt an exhaustive alignment. It uses a seed-and-extend strategy that trades some sensitivity for large gains in speed, which is what makes database-scale searching practical.
The general mechanism:
- Word generation. The query sequence is broken into short words (for protein searches, a fixed small number of residues). BLAST compiles a list of words that score above a threshold against each query word.
- Database scan. The database is scanned for exact or near-exact hits to those words. These are the seeds.
- Extension. Each seed is extended in both directions, adding positions as long as the alignment score keeps improving. When the score stops rising, the extension halts.
- Reporting. High-scoring segment pairs (HSPs) that survive a score cutoff are reported as local alignments.
The result is a set of local alignments, each covering only the region where the two sequences genuinely resemble each other.
How BLAST calculates statistical significance
A raw alignment score depends on the scoring matrix, gap penalties, and sequence length, so it is not directly comparable across searches. BLAST converts the raw score into an E-value (expectation value), which estimates how many alignments with a score at least that high would be expected by chance alone in a database of that size.
The practical reading of an E-value:
| E-value | Typical interpretation |
|---|---|
| Much less than 1 (e.g., 1e-50) | Very unlikely to occur by chance; strong similarity signal |
| Around 1 | Roughly one such hit expected by chance; weak evidence |
| Much greater than 1 | Consistent with random similarity |
Because the E-value scales with database size, the same alignment can yield a different E-value in a larger database. The site describes BLAST as comparing sequences to sequence databases and calculating the statistical significance of matches, which is exactly this step.
Local vs. global alignment: choosing the right tool
The distinction matters when you pick a method. BLAST's own specialized search list makes the contrast concrete: Global Align compares two sequences across their entire span using the Needleman-Wunsch algorithm, while BLAST itself reports local regions.
| Dimension | BLAST (local) | Global Align (Needleman-Wunsch) |
|---|---|---|
| Scope | Best-matching local regions | Entire length of both sequences |
| Input | One query vs. a database (or a few sequences) | Two sequences you supply |
| Typical use | Finding what a sequence resembles; identifying homologs | Comparing two sequences already known to be related end-to-end |
| Behavior with dissimilar flanks | Ignores them | Penalizes them as gaps or mismatches |
Choose BLAST when you want to discover similarity you did not know was there. Choose a global alignment when you have two sequences of comparable length and want a complete positional comparison.
What alignment results tell you
A significant local alignment is evidence of homology—shared evolutionary origin—which in turn supports inferences about function. If an uncharacterized protein aligns strongly across a conserved domain to a protein with a known function, that domain is likely present and performing a related role. BLAST's stated uses reflect this: inferring functional and evolutionary relationships between sequences and identifying members of gene families.
Two cautions when reading results:
- Similarity is not identity of function. A strong alignment indicates relatedness; it does not by itself prove the two sequences do the same thing in the cell.
- Local matches can be partial. A high-scoring HSP may cover only one domain of a multi-domain protein, so the overall proteins may differ substantially outside that region.
Getting started
BLAST is available through several entry points described on the site:
- Web BLAST — run searches in the browser, including genome searches by organism name or tax ID.
- Standalone and API BLAST — download executables and databases, call BLAST from an application, or run it in the cloud.
- Specialized searches — SmartBLAST for finding highly similar proteins, Primer-BLAST for designing PCR primers, CD-search for conserved domains, IgBLAST for immunoglobulin and T cell receptor sequences, VecScreen for vector contamination, and CDART for conserved domain architecture.
For a first local alignment, start with Web BLAST: paste your nucleotide or protein query, select the appropriate program and database, run the search, and read the reported HSPs alongside their E-values. If instead you need a full end-to-end comparison of two sequences, use Global Align rather than BLAST.