staar: _cond suffix on conditional output files#128
Merged
Conversation
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.
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.
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.