Skip to content

Carry study-level n_sample through rss_analysis - #1395

Merged
gaow merged 1 commit into
StatFunGen:mainfrom
Yining97:rss-study-n
Jul 30, 2026
Merged

Carry study-level n_sample through rss_analysis#1395
gaow merged 1 commit into
StatFunGen:mainfrom
Yining97:rss-study-n

Conversation

@Yining97

Copy link
Copy Markdown
Contributor

What

Study-level total N (n_sample) plumbing for the RSS pipeline:

  • gwas_rss_manifest.R — reads an optional n_sample column from --gwas-meta, carries it into the manifest.
  • gwas_sumstats_construct.R — new --n-sample flag → the loader manifest → GwasSumStats(nSample=).
  • rss_analysis.ipynb — forwards n_sample to --n-sample when present (guarded like n_case/n_control).

Entry construction from study scalars lives in pecotmr's loadGwasSumStatsFromManifest, so this side is thin plumbing.

Depends on

pecotmr rss-study-n (the nSample slot + resolution + the loader's study-scalar entry build).

Testing

Against both open pecotmr PRs merged + susieR 0.16.6, real chr21 AD_Bellenguez:

  • construct.R end-to-end: study n_sampleN=study-n (487511); study c/c→effective (292500); per-variant→effective (283145); no N source→errors.
  • Manifest verified via the sos-generated generate_manifest script.
  • (A full sos run was blocked by a host r-base/r-pecotmr toolchain mismatch unrelated to this change; the generated step scripts run correctly under the r-pecotmr R.)

gwas_rss_manifest.R reads an optional n_sample column from --gwas-meta and
emits it in the manifest; gwas_sumstats_construct.R adds --n-sample ->
GwasSumStats(nSample=) via loadGwasSumStatsFromManifest; rss_analysis.ipynb
forwards it when present. Lets a study reporting only a study-level total N
(or study-level case/control) be fine-mapped without per-variant N.
@gaow
gaow merged commit 788e206 into StatFunGen:main Jul 30, 2026
2 checks passed
@Yining97
Yining97 deleted the rss-study-n branch July 30, 2026 16:13
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