Skip to content

Commit

Permalink
Print rounded results
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Feb 25, 2024
1 parent 3434bee commit ce698ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ def write_vcf(ref_ts, impdata, out_file, chr_name="1"):
for i in range(impdata.num_sites):
a1, ap1, a2, ap2 = impdata.get_alleles_at_site(i)
gt_probs, dosages = compute_individual_scores(a1, ap1, a2, ap2)
ar2 = compute_estimated_allelic_r_squared(gt_probs)
ar2 = round(compute_estimated_allelic_r_squared(gt_probs), 2)
line_str = ""
line_str += chr_name + "\t"
line_str += impdata.site_pos[i] + "\t"
Expand All @@ -782,8 +782,8 @@ def write_vcf(ref_ts, impdata, out_file, chr_name="1"):
filter_str = "PASS"
line_str += filter_str + "\t"
# INFO
dr2 = 0
af = 0
dr2 = round(0, 2)
af = round(0, 2)
info_str = f"AR2{ar2};DR2{dr2};AF{af}"
line_str += info_str + "\t"
# FORMAT
Expand Down

0 comments on commit ce698ac

Please sign in to comment.