Solution

ID: past-exam-of-the-mathematical-and-computational-biology-course-of-the-university-of-cambridge/2025/paper-2/2/a/solution

With no deletion states allowed, each match state must emit once in every aligned sequence. Thus the four gap-free alignment columns, , become . Columns and form one optional run, represented by a single looping insertion state ; column requires a separate insertion state after . Two insertion states are sufficient and minimal in an ordered profile hidden Markov model: the two optional regions are separated by a compulsory emission and occupy different positions in the profile.
Estimate each transition probability by the number of observed uses of that transition divided by all transitions leaving its source state. The complete arrow diagram is given below; repeated labels denote the same state, so the second and third lines supply the branches of the first line. Start and End are silent:
Three aligned sequences visit , giving three exits to , while one sequence emits twice there, giving one self-transition. Thus its exit and loop probabilities are and , respectively. Two sequences visit and two bypass it. All absent transitions have probability zero.
The probability mass functions of the emitting states, estimated from all characters assigned to each state with no added counts, are
In particular, pooling the two optional columns into pools four emissions: two T, one A and one G. This is a generative Hidden Markov model, so it can generate other run lengths and combinations as well as the training sequences; reproducing each training column deterministically is not its purpose.

New to topics? Read the docs here!