Skip to content

Skip PIP-screened regions gracefully instead of erroring - #565

Merged
danielnachun merged 1 commit into
StatFunGen:mainfrom
Yining97:rss-pip-skip-graceful
Aug 4, 2026
Merged

Skip PIP-screened regions gracefully instead of erroring#565
danielnachun merged 1 commit into
StatFunGen:mainfrom
Yining97:rss-pip-skip-graceful

Conversation

@Yining97

@Yining97 Yining97 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What

summaryStatsQc(pipCutoffToSkip) empties a no-signal region (df[FALSE, ]) and records qcInfo$entryAudit[[i]]$pipScreenSkipped. Nothing consumed that flag, so fineMappingPipeline looped the 0-variant entry and .fmExtractZN threw "entry has no SNP mcol". Three problems: (1) misleading message (reads like corrupt input); (2) hard stop() → non-zero exit → shows as FAILED in an array job, indistinguishable from a real error; (3) pipScreenSkipped written and never read.

Now fineMappingPipeline (GwasSumStats + QtlSumStats) consults .fmEntrySkipInfo(data, i) before extracting z/N: a screened (or 0-variant) entry is skipped with a clear region skipped: <reason> message and no row; an all-screened collection returns a valid 0-row result (allowEmpty on the builders) instead of erroring.

Impact

  • Fixes all three. A PIP-screened region completes as a skip (exit 0, clear reason), not a failure.
  • No protocol change (verified): fine_mapping.R handles a 0-row result and gwas_rss_plot.R already write_emptys an empty FMR.
  • Non-screened regions unchanged.

Testing

susieR 0.16.6: test_fineMappingPipeline (474) + test_sumstatsQc (825) green — new tests: screened GWAS → empty FMR + skip message; mixed screened+real → only real rows; 0-variant entry skipped without the flag; QtlSumStats screened trait → empty result. Real chr21 AD_Bellenguez: forced screen (cutoff 0.163 > max SER PIP 0.153) → fineMappingPipeline returns a 0-row GwasFineMappingResult with the skip message, where pre-change it errored "entry has no SNP mcol".

summaryStatsQc(pipCutoffToSkip) empties a no-signal region and records
qcInfo$entryAudit[[i]]$pipScreenSkipped, but nothing read it:
fineMappingPipeline hit .fmExtractZN and threw 'entry has no SNP mcol' -
a misleading hard stop that shows a screened region as FAILED in an
array job. Add .fmEntrySkipInfo(data, i); both SumStats methods now
consult it, skip the entry with a clear 'region skipped: <reason>'
message and no row, and an all-screened collection returns a valid
0-row result (allowEmpty on the builders) instead of stop(). Fixes the
misleading message, the non-zero exit, and the dangling flag.
@danielnachun
danielnachun merged commit 3796f49 into StatFunGen:main Aug 4, 2026
6 of 7 checks passed
@Yining97
Yining97 deleted the rss-pip-skip-graceful branch August 4, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants