Derive Wald z from beta/se when z is absent - #559
Merged
Conversation
.resolveSumstatCols now requires a z column OR beta+se: when z is absent but beta and se are present it sets Z = beta/se (the Wald z-score, matching susie_rss z_method=wald). A supplied z takes precedence and is never overwritten; it still errors when neither is available. Lets beta/se-only GWAS sumstats run without a precomputed z (the protocol construct step delegates reading to this loader, so no protocol change is needed).
The .fmFitSusieRss rssControl-forwarding test mocks susie_rss_control(), which only exists in susieR >= 0.16.6; on the CI r44 env (susieR 0.16.4) local_mocked_bindings() can't find the binding and errors. Skip it when susieR lacks susie_rss_control - rssControl is a 0.16.6-only feature anyway. (Test came in with StatFunGen#557; it also fails CI here on this branch.)
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.
What
Many case/control GWAS publish
beta+sewith noz. The shared sumstats reader.resolveSumstatColsrequiredz, so those inputs errored and had to be pre-processed.Now it requires
zor (beta+se): whenzis absent it derivesZ = beta/se(the Wald z, matchingsusie_rss'sz_method="wald"). A suppliedztakes precedence; it errors only when neither is available.beta/sestill attach as optional columns.Pure pecotmr change — the protocol's
gwas_sumstats_construct.Rdelegates reading toloadGwasSumStatsFromManifest, andbeta/seare already mappable, so no protocol change is needed.Testing
Against
main(post-#557/#558) + susieR 0.16.6, real chr21 AD_Bellenguez:.resolveSumstatCols.Z=beta/se(max err 1.7e-14), QC completes;zpresent →zused, not beta/se (precedence).sos runon a beta/se-only input completes end-to-end.