Skip to content

Commit

Permalink
Correct compute_forward_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Mar 4, 2024
1 parent fe70e44 commit 0581375
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ def compute_forward_matrix(ref_h, query_h, trans_probs, mismatch_probs):
if query_a == ref_a:
em_prob = 1.0 - mismatch_probs[i]
fwd_mat[i, j] = em_prob
fwd_mat[i, j] *= scale * fwd_mat[i - 1, j] + shift
if i > 0:
fwd_mat[i, j] *= scale * fwd_mat[i - 1, j] + shift
site_sum = np.sum(fwd_mat[i, :])
# Prior probabilities are multiplied when i = 0.
last_sum = site_sum / h if i == 0 else site_sum
Expand Down

0 comments on commit 0581375

Please sign in to comment.