Skip to content

Dev #1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 13, 2025
Merged

Dev #1014

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions v03_pipeline/lib/misc/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,16 @@ def validate_imputed_sex_ploidy(
)
),
)
discrepant_rate = mt.aggregate_cols(hl.agg.fraction(mt.discrepant))
if discrepant_rate:
msg = f'{discrepant_rate:.2%} of samples have misaligned ploidy with their provided imputed sex.'
raise SeqrValidationError(msg)
discrepant_samples = mt.aggregate_cols(
hl.agg.filter(mt.discrepant, hl.agg.collect_as_set(mt.s)),
)
if discrepant_samples:
sorted_discrepant_samples = sorted(discrepant_samples)
msg = f'Found samples with misaligned ploidy with their provided imputed sex (first 10, if applicable) : {sorted_discrepant_samples[:10]}'
raise SeqrValidationError(
msg,
{'imputed_sex_ploidy_failures': sorted_discrepant_samples},
)


def validate_sample_type(
Expand Down
Loading
Loading