Skip to content

Commit

Permalink
Drops dp_ratio test in favour of min alt reads
Browse files Browse the repository at this point in the history
  • Loading branch information
MattWellie committed Feb 10, 2025
1 parent fc33bfb commit 762885d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/talos/RunHailFiltering.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,24 +690,14 @@ def annotate_category_4(mt: hl.MatrixTable, ped_file_path: str) -> hl.MatrixTabl
# require AD & PL for called variants, just not always for HomRef
kid_ab = kid.AD[1] / hl.sum(kid.AD)

# Try to get these all to an expected value of 0.5
dp_ratio = (
hl.case()
.when((tm.locus.in_x_nonpar()) & (~tm.is_female), kid.DP / mom.DP) # Because mom is diploid but kid is not
.when((tm.locus.in_y_nonpar()) & (~tm.is_female), kid.DP / (2 * dad.DP))
.when(tm.locus.in_mito(), kid.DP / (2 * mom.DP))
.when(tm.locus.in_x_nonpar() & tm.is_female, (kid.DP / (mom.DP + dad.DP)) * (3 / 4)) # Because of hemi dad
.default(kid.DP / (mom.DP + dad.DP))
)

# horribly simplified - we don't have the PL or AD for any WTs, so we're really fudging the main parts
# I've also dropped the requirements for different confidence levels, we're treating Low/Medium/High equally
tm = tm.annotate_entries(
de_novo_tested=hl.case()
.when(~has_candidate_gt_configuration, MISSING_INT)
.when(min_alt_depth > kid.AD[1], MISSING_INT)
.when(min_gq > kid.GQ, MISSING_INT)
.when((dp_ratio < min_dp_ratio) | (kid_ab < min_child_ab), MISSING_INT)
.when(kid_ab < min_child_ab, MISSING_INT)
.default(ONE_INT),
)
tm = tm.filter_entries(tm.de_novo_tested == 1)
Expand Down

0 comments on commit 762885d

Please sign in to comment.