Skip to content

Commit

Permalink
Update estimation of allele frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Mar 8, 2024
1 parent 7905759 commit da5bff6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,8 @@ def compute_allele_frequency(
assert len(allele_probs_2) == n, "Lengths of alleles and probabilities differ."
cum_ap_hap1 = np.sum(allele_probs_1[alleles_1 == allele])
cum_ap_hap2 = np.sum(allele_probs_2[alleles_2 == allele])
cum_ap_total = np.sum(allele_probs_1) + np.sum(allele_probs_2)
est_af = (cum_ap_hap1 + cum_ap_hap2) / cum_ap_total
# See `printInfo` in `VcfRecBuilder.java` in BEAGLE 4.1 source code.
est_af = (cum_ap_hap1 + cum_ap_hap2) / (2 * n)
return est_af


Expand Down

0 comments on commit da5bff6

Please sign in to comment.