Skip to content

feat(qc): relax sumstats QC thresholds for exome/wgs-gwas studies#1269

Merged
addramir merged 1 commit into
devfrom
relax-qc-thresholds-exwas-wgs
Jul 22, 2026
Merged

feat(qc): relax sumstats QC thresholds for exome/wgs-gwas studies#1269
addramir merged 1 commit into
devfrom
relax-qc-thresholds-exwas-wgs

Conversation

@addramir

Copy link
Copy Markdown
Contributor

Summary

Closes opentargets/issues#4416.

Studies whose analysisFlags contain ExWAS or wgsGWAS (exome / whole genome sequencing sources) now use relaxed thresholds in StudyIndex.annotate_sumstats_qc:

check default seq (ExWAS/wgsGWAS)
mean_beta 0.05 1.0
PZ (mean_diff_pz & se_diff_pz) 0.05 skipped
min gc_lambda 0.7 0.1
max gc_lambda 2.5 2.5
min n_variants 2_000_000 1_000_000

New seq_threshold_* parameters carry the relaxed values; default (non-seq) behaviour is unchanged.

Notes

  • The issue also proposes sourcing gc_lambda for 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

  • Added 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

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for mean_beta, gc_lambda, and n_variants when 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"]
@addramir
addramir merged commit c648372 into dev Jul 22, 2026
10 checks passed
@addramir
addramir deleted the relax-qc-thresholds-exwas-wgs branch July 22, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relax quality control thresholds for exome/wgs-gwas

3 participants