We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 663b5db commit cb323a0Copy full SHA for cb323a0
python/tests/beagle_numba.py
@@ -585,10 +585,9 @@ def interpolate_allele_probs(
585
if max(sum_probs_a_k, sum_probs_a_kM1) > _MIN_THRESHOLD:
586
probs[i, a] += w * sum_probs_a_kM1
587
probs[i, a] += (1 - w) * sum_probs_a_k
588
- # Rescale probabilities.
589
- # TODO: Check if this is necessary. Could this be a subtle source of error?
590
- assert np.all(np.sum(probs, axis=1) > 0), "Sum of allele probabilities is not > 0."
591
- probs_rescaled = probs / np.sum(probs, axis=1)[:, np.newaxis]
+ site_sums = np.sum(probs, axis=1)
+ assert np.all(site_sums > 0), "Some site sums of allele probabilities is <= 0."
+ probs_rescaled = probs / site_sums[:, np.newaxis]
592
if return_weights:
593
return (probs_rescaled, weights)
594
return (probs_rescaled, None)
0 commit comments