Hidden Markov models for sequence: profiles, states and decoding
A profile hidden Markov model represents a whole family by position-specific emission and transition probabilities rather than by one representative sequence. This topic covers how decoding assigns states to a new sequence and what that assignment provides.
What a learner can do afterwards
- Describe the match, insert and delete states of a profile model and what each one emits
- Explain what a single most probable path gives that per-position posteriors do not
- Explain how a well-trained profile can detect remote homologues missed by a single-sequence search
1 · Read
You have used substitution scores and gap penalties for pairwise alignment. A profile HMM models a protein family from a multiple alignment. It stores position-specific residue emission probabilities and transition probabilities between states. Conserved columns often favour a small set of residues. Variable columns can have broader, unequal probabilities. A match state need not emit the consensus residue.
Match states emit residues aligned to consensus columns. Insert states emit extra residues, and a self-loop allows repeated insert emissions. Delete states skip consensus columns without emitting. For example, M1 emits A, I1 emits G then S, M2 emits T, D3 skips column 3, and M4 emits L. This path emits AGSTL.
The joint probability of a path and its emitted sequence is the product of its start probability, each transition probability, each emitted residue's probability and the end probability. Delete states have no emission factor. For a fixed sequence and model, Viterbi selects an allowed path maximising this product. It returns one alignment and state assignment, even when close alternatives leave some residues uncertain.
A residue's state posterior sums probability over all paths assigning that state to that residue, conditional on the sequence and model. It measures model-based support. For example, 85% support exceeds 55% support. Posterior decoding uses these marginal probabilities. Choosing each residue's most probable state independently need not obey transition rules. State posteriors are not probabilities of shared ancestry.
Each residue's two bars sum to 100%. These are marginal state probabilities, not complete-path probabilities.
A best path can hide uncertainty. Several nearly tied paths may disagree about a residue's state. Use state posteriors to assess support at individual residues. A constrained decoding method can use posterior information while requiring an allowed path; independent marginal choices alone do not impose that requirement.
A well-trained profile combines family-specific residue distributions and gap patterns across positions. Weak agreement can accumulate and reveal a remote homologue missed by a search with one member. Training quality and search settings matter. Assess scores against a calibrated background model. A significant match supports a relationship; it does not prove ancestry or make every alignment position certain.
Profiles model family residue and gap patterns. Viterbi gives an allowed best path; posteriors describe state support under the model. Search matches still need significance checks.
Original lesson, questions and flashcards about protein-family hidden Markov models, written for this learning dataset.
Original readings and flashcards about protein-family profiles and decoding uncertainty, written for this learning dataset.
More to read
Representing variation within a protein family
A family alignment proposes corresponding positions in several proteins. At each position, some residues may occur often and others rarely. A profile HMM represents these patterns with emission distributions and transitions between states. Its match states correspond to consensus positions, but they can emit residues other than the consensus letter.
Gap patterns also contain information. An insert state can emit additional residues, with a self-loop allowing repeated emissions. A delete state advances past a consensus position without consuming a residue from the observed sequence.
Family information can help when one representative sequence is a poor search query. A new protein may agree with several family patterns without closely matching that one member. A profile can combine these contributions across positions. The result depends on the alignment used for training and the search settings.
A search score still needs a calibrated comparison with a background model. Statistical support for a match is evidence to investigate. It does not prove the proposed ancestry or make every position in the resulting alignment certain.
A selected alignment and its uncertainty
A state path explains how a model could emit the observed sequence. For example, M1 can emit A, two visits to I1 can emit G and S, M2 can emit T, D3 can skip a consensus column, and M4 can emit L. The emitted sequence is AGSTL. D3 adds no letter.
For a fixed model, the probability of a path and sequence combines start, transition, emission and end probabilities. Viterbi selects an allowed full path with the highest probability for the observed sequence. It gives an alignment even when several alternatives have similar support.
A state posterior pools probability across paths. It asks how much support belongs to paths assigning a particular state to a particular residue, conditional on the sequence and model. A high posterior is model-based support, not proof that the model captures the true evolutionary history.
Choosing the most probable state independently at each residue solves a marginal problem. The resulting choices need not obey all transition rules. Requiring a valid full path is a separate constraint. This is why a report should identify the decoding method and distinguish selected state labels from their posterior support.
2 · Watch
En anglaisTake it off screen
Where it sits
Optional connections
This opens up
Nothing builds on it yet.
8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.