Skip to content

Commit eabd7a5

Browse files
authored
Merge pull request #1014 from broadinstitute/dev
Dev
2 parents c5c0682 + b9df3b6 commit eabd7a5

19 files changed

+573
-316
lines changed

v03_pipeline/lib/misc/validation.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,16 @@ def validate_imputed_sex_ploidy(
151151
)
152152
),
153153
)
154-
discrepant_rate = mt.aggregate_cols(hl.agg.fraction(mt.discrepant))
155-
if discrepant_rate:
156-
msg = f'{discrepant_rate:.2%} of samples have misaligned ploidy with their provided imputed sex.'
157-
raise SeqrValidationError(msg)
154+
discrepant_samples = mt.aggregate_cols(
155+
hl.agg.filter(mt.discrepant, hl.agg.collect_as_set(mt.s)),
156+
)
157+
if discrepant_samples:
158+
sorted_discrepant_samples = sorted(discrepant_samples)
159+
msg = f'Found samples with misaligned ploidy with their provided imputed sex (first 10, if applicable) : {sorted_discrepant_samples[:10]}'
160+
raise SeqrValidationError(
161+
msg,
162+
{'imputed_sex_ploidy_failures': sorted_discrepant_samples},
163+
)
158164

159165

160166
def validate_sample_type(

0 commit comments

Comments
 (0)