Skip to content

staar: _cond suffix on conditional output files#128

Merged
vineetver merged 1 commit intomasterfrom
staar/tranche-c-conditional
Apr 16, 2026
Merged

staar: _cond suffix on conditional output files#128
vineetver merged 1 commit intomasterfrom
staar/tranche-c-conditional

Conversation

@vineetver
Copy link
Copy Markdown
Owner

Closes #102.

The conditional math already runs today: augment_covariates at pipeline.rs:581-588 expands X with --known-loci before the null is fit, and by the OLS projection identity that is mathematically equivalent to R's method_cond="optimal" two-stage procedure. Downstream score tests see K = G'(I - H_aug)G automatically.

Gap was output: filenames didn't say so. This suffixes mask outputs with _cond and sets meta.conditional=true when --known-loci is active, matching STAARpipelineSummary's layout so summary tooling can tell conditional from unconditional runs.

SPA + --known-loci now warns: SPA reads raw G not the augmented projection, so gene-mask p-values are SPA-adjusted but not conditional. The cond-SPA variant (Gene_Centric_*_cond_spa in R) is a follow-up.

296/296, clippy clean.

The conditional math already runs today — augment_covariates at
pipeline.rs:581-588 expands X with known_loci before the null is fit, and
by the OLS projection identity that is mathematically equivalent to R's
method_cond="optimal" two-stage procedure (regress y~X, then residuals on
[known_loci, X]). Downstream score tests see the Schur-complement-
projected K = G'(I - H_aug)G automatically.

What was missing: the output files didn't say so. This PR suffixes
mask-level outputs with _cond and sets meta.conditional=true when
--known-loci is active, matching STAARpipelineSummary's file layout
(coding_plof.parquet vs coding_plof_cond.parquet) so the summary tooling
can tell conditional from unconditional runs.

SPA + --known-loci now emits a warning: SPA reads raw G not the
augmented projection, so gene-mask p-values in that combo are SPA-
adjusted but not conditional. The cond-SPA variant (Gene_Centric_*_cond_spa
in R) is a follow-up.

296/296, clippy clean.
@vineetver vineetver merged commit cf0f079 into master Apr 16, 2026
3 checks passed
@vineetver vineetver deleted the staar/tranche-c-conditional branch April 16, 2026 21:33
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.

Conditional STAAR single-study: _cond and _cond_spa paths

1 participant