Feature score from deviation contrasts (random-effects meta per condition)
Source:R/mashPipeline.R
calculateFeatureScores.RdFor each condition's deviation contrast, meta-analyzes the per-variant
absolute effect sizes (random-effects, via metafor::rma) and returns
the pooled Z-score (\(\hat\mu / \mathrm{se}\)). One score per condition –
the "meta" feature score of mash_posterior.ipynb.
Arguments
- contrastResult
A contrast table from
mashPosteriorContrast(variants x contrasts) carryingmean_contrast_*_deviationandse_contrast_*_deviationcolumns.- metaMethod
Between-study variance estimator forwarded to
metafor::rma(default"REML").
Examples
om <- matrix(c(0.1, 0.2, 0.3), 1, 3,
dimnames = list("chr1:100:A:G", c("a", "b", "c")))
pm <- matrix(c(0.5, 0.3, -0.2), 1, 3,
dimnames = list("chr1:100:A:G", c("a", "b", "c")))
pv <- array(diag(3) * 0.1, dim = c(3, 3, 1))
dimnames(pv) <- list(c("a", "b", "c"), c("a", "b", "c"), NULL)
cr <- fitMashContrast(1L, om, pm, pv)
calculateFeatureScores(cr, metaMethod = "mean")
#> # A tibble: 3 × 2
#> condition zScore
#> <chr> <dbl>
#> 1 a 1.16
#> 2 b 0.387
#> 3 c 1.55