Skip to content

Article image
Multiple Sequence Alignment: Comparing Three or More Sequences

May 16, 2026 · Updated: May 25, 2026

Overview

Multiple sequence alignment (MSA) aligns three or more biological sequences to identify conserved regions shared across an entire family. Whereas pairwise alignment reveals similarity between two sequences, MSA captures the evolutionary depth of a homologous group, highlighting residues that have been maintained over millions of years. These conserved positions are often critical for structure, catalysis, or regulation. MSA is the prerequisite for phylogenetic tree construction, protein domain identification, and the generation of sequence logos that visualize conservation patterns.

Key Concepts

Progressive alignment, implemented in Clustal Omega and MUSCLE, builds an MSA by first constructing a guide tree from pairwise distances and then iteratively aligning the most closely related sequences. Iterative methods refine the initial alignment by realigning subsets to improve the overall objective score. Consistency-based tools like T-Coffee incorporate information from pairwise alignments against a third sequence to improve accuracy. For very large datasets, MAFFT uses fast Fourier transforms to accelerate alignment. Quality assessment metrics such as the sum-of-pairs score and column score evaluate alignment reliability, and trimming tools remove poorly aligned regions before downstream analysis.

Applications

MSA is indispensable for comparative genomics of bacterial genetics, where it identifies genes conserved across pathogenic strains. It improves the sensitivity of homology searching in DNA sequencing projects and reveals functionally important residues in protein structure prediction. In evolutionary biology, MSA provides the multiple-sequence input required for maximum-likelihood and Bayesian phylogenetic inference, enabling reconstruction of ancestral sequences and dating of speciation events.

Practical Protocol

For a protein MSA with MAFFT, prepare a FASTA file of homologous sequences (e.g., from BLAST or OrthoFinder results). Run MAFFT with the L-INS-i strategy, the most accurate for <200 sequences: mafft --localpair --maxiterate 1000 input.fasta > aligned.fasta. For larger datasets (200–1000 sequences), use the FFT-NS-2 strategy: mafft --retree 2 --maxiterate 2 input.fasta > aligned.fasta. For very large datasets (>1000 sequences), use the PartTree algorithm: mafft --parttree input.fasta > aligned.fasta. For nucleotide alignments, use mafft --nuc --adjustdirection input.fasta > aligned.fasta to handle reverse complement strands. Alternatively, run MUSCLE v5: muscle -align input.fasta -output aligned.fasta. Assess alignment quality by visual inspection using Jalview: load the aligned FASTA file, color by ClustalX scheme (highlighting conserved positions), and examine the conservation histogram. Trim poorly aligned regions with trimAl: trimal -in aligned.fasta -out trimmed.fasta -automated1 which automatically selects the optimal trimming threshold based on the alignment’s characteristics. For stricter trimming, use -gt 0.1 (remove columns with gaps in >10% of sequences) or -resoverlap 0.75 -seqoverlap 80 for the heuristic automated2 method. Calculate alignment summary statistics with esl-alistat from the HMMER suite: esl-alistat aligned.fasta. Generate a sequence logo with WebLogo or the R package ggseqlogo to visualize position-specific amino acid conservation. Convert the alignment to PHYLIP format for phylogenetic inference: sed -e 's/>//' aligned.fasta | paste - - | awk '{print $1, $2}' > aligned.phy. Run IQ-TREE for maximum-likelihood tree inference: iqtree -s aligned.phy -m MFP -bb 1000 -nt AUTO.