feat(qc): relax sumstats QC thresholds for exome/wgs-gwas studies#1269
Merged
Conversation
Studies whose analysisFlags contain ExWAS or wgsGWAS now use relaxed thresholds in StudyIndex.annotate_sumstats_qc: higher mean beta bound, lower min GC lambda, lower min variant count, and the PZ check skipped. Addresses opentargets/issues#4416. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Updates StudyIndex.annotate_sumstats_qc to apply relaxed summary-stats QC thresholds for sequencing-based GWAS studies (identified via analysisFlags containing ExWAS or wgsGWAS), while keeping default behavior unchanged for other studies.
Changes:
- Added
seq_threshold_*parameters and conditional logic to use relaxed thresholds formean_beta,gc_lambda, andn_variantswhen a study is marked as sequencing-based. - Skipped the PZ (mean/se diff PZ) QC check for sequencing-based studies.
- Added a unit test covering relaxed-threshold behavior for sequencing-based studies alongside strict behavior for non-seq studies.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/gentropy/dataset/study_index.py |
Applies seq-specific relaxed QC thresholds and skips PZ checks for ExWAS/wgsGWAS studies. |
tests/gentropy/dataset/test_study_index.py |
Adds coverage to ensure seq studies pass relaxed checks while non-seq studies still fail strict checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+696
to
+702
| # QC values that fail every default check but pass the relaxed ones: | ||
| qc_data = [ | ||
| ("s1", 0.5, 0.5, 0.5, 0.5, 1, 1), # case-case -> non-seq | ||
| ("s2", 0.5, 0.5, 0.5, 0.5, 1, 1), # ExWAS -> seq | ||
| ("s3", 0.5, 0.5, 0.5, 0.5, 1, 1), # case-case + ExWAS -> seq | ||
| ("s4", 0.5, 0.5, 0.5, 0.5, 1, 1), # no flags -> non-seq | ||
| ] |
Comment on lines
+711
to
+718
| annotated = study_index.annotate_sumstats_qc( | ||
| qc, | ||
| **self.thresholds, | ||
| seq_threshold_mean_beta=1.0, | ||
| seq_threshold_min_gc_lambda=0.1, | ||
| seq_threshold_max_gc_lambda=2.5, | ||
| seq_threshold_min_n_variants=1, | ||
| ) |
| assert StudyQualityCheck.FAILED_MEAN_BETA_CHECK.value in flags["s1"] | ||
| assert StudyQualityCheck.FAILED_PZ_CHECK.value in flags["s1"] | ||
| assert StudyQualityCheck.FAILED_GC_LAMBDA_CHECK.value in flags["s1"] | ||
| assert StudyQualityCheck.SMALL_NUMBER_OF_SNPS.value in flags["s4"] |
project-defiant
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes opentargets/issues#4416.
Studies whose
analysisFlagscontainExWASorwgsGWAS(exome / whole genome sequencing sources) now use relaxed thresholds inStudyIndex.annotate_sumstats_qc:mean_betamean_diff_pz&se_diff_pz)gc_lambdagc_lambdan_variantsNew
seq_threshold_*parameters carry the relaxed values; default (non-seq) behaviour is unchanged.Notes
gc_lambdafor these studies from the Heritability step rather than the QC step. That is a larger change involving cross-step data flow and is left out of this small PR.Tests
test_annotation_relaxed_thresholds_for_seq_studies— seq studies pass all relaxed checks while non-seq studies still fail the strict ones.🤖 Generated with Claude Code