Skip to content

Commit c906faa

Browse files
committed
Fix wrong denominator in max_missing_an fraction filter (closes #998)
1 parent c6616a2 commit c906faa

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

malariagen_data/anoph/snp_data.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,9 +1872,10 @@ def biallelic_snp_calls(
18721872

18731873
# Apply missingness condition.
18741874
if max_missing_an is not None:
1875-
an_missing = (ds_out.sizes["samples"] * ds_out.sizes["ploidy"]) - an
1875+
an_total = ds_out.sizes["samples"] * ds_out.sizes["ploidy"]
1876+
an_missing = an_total - an
18761877
if isinstance(max_missing_an, float):
1877-
an_missing_frac = an_missing / an
1878+
an_missing_frac = an_missing / an_total
18781879
loc_missing = an_missing_frac <= max_missing_an
18791880
else:
18801881
loc_missing = an_missing <= max_missing_an

0 commit comments

Comments
 (0)