Skip to content

Commit

Permalink
Implement skip when no particular allele is observed
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Mar 11, 2024
1 parent 9895525 commit 89e2869
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,13 @@ def interpolate_allele_probs(
w = weights[i]
for a in alleles:
is_a_in_ref_h = ref_h[i, :] == a
if np.sum(is_a_in_ref_h) == 0:
continue
if use_threshold:
# TODO: Check whether this is implemented correctly. Not used by default.
# Threshold based on "the number of subsets in the partition Am of H".
threshold_Am = np.sum(is_a_in_ref_h)
_MIN_THRESHOLD = min(0.005, 1 / threshold_Am)
threshold_Am = 1 / np.sum(is_a_in_ref_h)
_MIN_THRESHOLD = min(0.005, threshold_Am)
if k == 0:
# See 'setFirstAlleleProbs' in 'LSHapBaum.java'.
assert w == 1.0, "Weight should be 1.0."
Expand Down

0 comments on commit 89e2869

Please sign in to comment.