Overview
A hidden Markov model (HMM) is a statistical model that represents a sequence of observable events as being generated by an underlying sequence of unobserved (hidden) states. In bioinformatics, HMMs model biological sequences where the hidden states might represent exon/intron boundaries, protein secondary structure elements, or conserved columns in a multiple sequence alignment. The power of the HMM framework lies in its ability to capture position-specific conservation patterns, insertions, and deletions through a unified probabilistic architecture trained from known examples.
Key Concepts
An HMM is defined by three sets of parameters: transition probabilities between hidden states, emission probabilities of observing a symbol from each state, and initial state probabilities. The Viterbi algorithm finds the most probable sequence of hidden states for a given observation, for example, the most likely gene structure for a genomic DNA sequence. The forward-backward algorithm computes the posterior probability of each state at each position, which can be used to assess prediction confidence. Profile HMMs, built from multiple sequence alignments, model protein domain families. The HMMER software package uses profile HMMs for sensitive remote homology detection, outperforming BLAST for divergent sequences.
Applications
HMMs are used for gene prediction in prokaryotic and eukaryotic genomes, identifying splice sites and coding regions. Profile HMMs classify proteins into families and superfamilies, aiding protein structure prediction and functional annotation. They model substrate specificity in enzyme classification and nomenclature and detect regulatory elements in DNA structure and topology. In metagenomics, HMMs assign functional roles to fragments of unknown origin.
Practical Protocol
The HMMER software suite enables building and searching profile HMMs. To search a protein query against a Pfam domain database, use hmmscan: hmmscan --cpu 8 --domtblout domains.txt Pfam-A.hmm query_proteins.fasta. The output domtblout file reports per-domain hits with E-values, bit scores, and alignment coordinates. The domain E-value measures the significance of a domain match; values < 0.01 indicate confident hits. The bit score (in nats) is independent of the database size, enabling cross-comparison. To build a custom profile HMM from a multiple sequence alignment: build the HMM with hmmbuild my_domain.hmm aligned_seqs.sto, where the input alignment should be in Stockholm format. Calibrate the HMM for E-value computation: hmmcalibrate --cpu 8 my_domain.hmm. Search a sequence database with your HMM: hmmsearch -E 1e-5 --cpu 8 --tblout hits.txt my_domain.hmm target_sequences.fasta. The --tblout table lists the best-scoring hit per target sequence. For iterative homology detection and alignment, use jackhmmer: jackhmmer -N 5 --cpu 8 --tblout jackhmmer_output.txt query.fasta uniprot_sprot.fasta. Jackhmmer iteratively searches the database, using each round’s hits to build a new HMM for the next round, converging after 5 iterations typically. Interpreting E-values: in HMMER3, the E-value accounts for the size of the target database and the HMM length; values < 0.01 are considered significant for domain identification. For annotating entire metagenomic contigs, use the hmmer pipeline integrated in tools like METABOLIC or DRAM, which scan predicted open reading frames against Pfam, TIGRFAMs, and other HMM databases to assign functional categories.
resource: Lab Lexicon ORF Finder