Skip to content

Commit

Permalink
Update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Feb 26, 2024
1 parent 0bed81b commit cb7b26d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,9 @@ def compute_individual_scores(alleles_1, allele_probs_1, alleles_2, allele_probs
# Site-level data.
def compute_estimated_allelic_r_squared(gt_probs):
"""
Compute the estimated allelic R^2 for an imputed site.
Compute the estimated allelic R^2 at a site from posterior genotype probabilities.
Assume that all sites are biallelic. Otherwise, the calculation below is incorrect.
Assume that site is biallelic. Otherwise, the calculation below is incorrect.
Note that 0 refers to the major allele and 1 the minor allele.
It is not the true allelic R^2, which needs access to true genotypes to compute.
Expand All @@ -693,7 +693,7 @@ def compute_estimated_allelic_r_squared(gt_probs):
In BEAGLE 4.1, it is AR2: "Allelic R-Squared: estimated squared correlation
between most probable REF dose and true REF dose".
See formulation in the Appendix 1 of Browning and Browning. (2009).
See the formulation in the Appendix 1 of Browning & Browning (2009).
Am J Hum Genet. 84(2): 210–223. doi: 10.1016/j.ajhg.2009.01.005.
:param numpy.ndarray alleles_1: Imputed alleles for haplotype 1.
Expand Down Expand Up @@ -725,9 +725,10 @@ def compute_dosage_r_squared():

def compute_allele_frequency(gt_probs, allele=1):
"""
Estimate allele frequencies from posterior genotype probabilities.
Estimate the frequency of an allele at a site from posterior genotype probabilities.
Assume the site is biallelic. 0 denotes the major allele, and 1 the minor allele.
Assume that site is biallelic. Otherwise, the calculation below is incorrect.
Note that 0 refers to the major allele and 1 the minor allele.
Input are the posterior genotype probabilities at a site for n diploid individuals:
P(00), P(01 or 10), and P(11). The matrix is of size (n, 3).
Expand Down

0 comments on commit cb7b26d

Please sign in to comment.