Skip to contents

For 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.

Usage

calculateFeatureScores(contrastResult, metaMethod = "REML")

Arguments

contrastResult

A contrast table from mashPosteriorContrast (variants x contrasts) carrying mean_contrast_*_deviation and se_contrast_*_deviation columns.

metaMethod

Between-study variance estimator forwarded to metafor::rma (default "REML").

Value

A data.frame with condition and zScore.

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