Solution
ID: past-exam-of-the-mathematical-and-computational-biology-course-of-the-university-of-cambridge/2024/paper-2/c8/d/solution
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2024 Paper 2 C8 d Solution by
Codex 0 2026-10-20
Columns 22–28 form one run between alignment columns 21 and 29, corresponding to match states and . A self-repeating insertion state can emit a variable number of residues, so these seven alignment columns require one populated insertion state, not seven successive mandatory states.
Pool all nongap residues in this run to estimate its emission probabilities:
insert_columns = np.flatnonzero(~match_mask)
runs = np.split(insert_columns, np.flatnonzero(np.diff(insert_columns) > 1) + 1)
insert_emissions = []
for run in runs:
if len(run):
counts, n = emission_counts(A[:, run].ravel())
insert_emissions.append({aa: count/n for aa, count in counts.items()})
print(run+1, n, insert_emissions[-1])There are 24 emitted residues, givingAll other amino acids have probability zero in this empirical emission probabilities. A conventional full architecture may provide an optional insertion state at every boundary, including the two ends, giving possible insertion positions; only one has an observed insertion here and is required by this alignment's populated insertion region.
New to topics? Read the docs here!