From 778a449a05b1293abec2537fbc62a65aedd300a9 Mon Sep 17 00:00:00 2001 From: Shing Zhan Date: Sun, 14 Jan 2024 16:43:07 +0000 Subject: [PATCH] Add TODO --- python/tests/beagle_numba.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/tests/beagle_numba.py b/python/tests/beagle_numba.py index 580ceae5f9..bfde1e4a5c 100644 --- a/python/tests/beagle_numba.py +++ b/python/tests/beagle_numba.py @@ -333,18 +333,19 @@ def interpolate_allele_prob( alleles = np.arange(4) # ACGT ref_panel_size = ref_h.shape[1] x = len(ungenotyped_pos) - weights, marker_interval_start = get_weights( + weights, left_idx = get_weights( genotyped_pos, ungenotyped_pos, genotyped_cm, ungenotyped_cm ) p = np.zeros((x, len(alleles)), dtype=np.float32) for i in range(x): - k = marker_interval_start[i] + m = left_idx[i] for j in range(ref_panel_size): for a in alleles: if ref_h[i, j] == a: - p[i, a] += weights[i] * sm[k, j] - p[i, a] += (1 - weights[i]) * sm[k + 1, j] + p[i, a] += weights[i] * sm[m, j] + p[i, a] += (1 - weights[i]) * sm[m + 1, j] # Rescale probabilities. + # TODO: Check if this is necessary. Could this be a subtle source of error? p_rescaled = p / np.sum(p, axis=1)[:, np.newaxis] return p_rescaled