diff --git a/python/tests/beagle.py b/python/tests/beagle.py index 0281e6ef93..6e9d3592a1 100644 --- a/python/tests/beagle.py +++ b/python/tests/beagle.py @@ -226,17 +226,15 @@ def compute_backward_probability_matrix(ref_h, query_h, rho, mu): assert m == len(rho) assert m == len(mu) assert 0 <= np.min(rho) and np.max(rho) <= 1 - # BEAGLE caps mismatch probabilities at 0.5. assert 0 <= np.min(mu) and np.max(mu) <= 0.5 bm = np.zeros((m, h), dtype=np.float64) - # Initialise the last column - bm[-1, :] = 1.0 / h + bm[-1, :] = 1.0 / h # Initialise the last column for i in np.arange(m - 2, -1, -1): query_a = query_h[i + 1] for j in np.arange(h): ref_a = ref_h[i + 1, j] em_prob = mu[i + 1] if ref_a != query_a else 1.0 - mu[i + 1] - # Note that BEAGLE only keeps the values at one site at a time. + # Note that BEAGLE keeps the values at one site at a time. bm[i, j] = bm[i + 1, j] * em_prob sum_site = np.sum(bm[i, :]) scale = (1 - rho[i + 1]) / sum_site