Skip to content

Commit 891078f

Browse files
committed
Allow missing calls when checking Male ploidy discrepancy
1 parent 0e3fd21 commit 891078f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

v03_pipeline/lib/misc/validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def validate_imputed_sex_ploidy(
104104
mt = mt.select_cols(
105105
discrepant=(
106106
(
107-
# All calls are diploid but the sex is Male
108-
hl.agg.all(mt.GT.is_diploid())
107+
# All calls are diploid or missing but the sex is Male
108+
hl.agg.all(mt.GT.is_diploid() | hl.is_missing(mt.GT))
109109
& (sex_check_ht[mt.s].predicted_sex == Sex.MALE.value)
110110
)
111111
| (

v03_pipeline/lib/misc/validation_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,21 @@ def test_validate_imputed_sex_ploidy(self) -> None:
106106
),
107107
],
108108
},
109-
cols={'s': ['HG00731_1', 'HG00732_1']},
109+
# Male, Female, Male
110+
cols={'s': ['HG00731_1', 'HG00732_1', 'NA19678_1']},
110111
entries={
111112
'GT': [
112113
[
113114
hl.Call(alleles=[0], phased=False),
114115
hl.Call(alleles=[0], phased=False),
116+
hl.missing(hl.tcall),
115117
],
116118
],
117119
},
118120
).key_rows_by('locus')
119121
self.assertRaisesRegex(
120122
SeqrValidationError,
121-
'50.00% of samples have misaligned ploidy',
123+
'66.67% of samples have misaligned ploidy',
122124
validate_imputed_sex_ploidy,
123125
mt,
124126
sex_check_ht,

0 commit comments

Comments
 (0)