Skip to contents

Extract weights from mr.ash.rss (susieR)

Usage

mrAshRssWeights(stat, LD, varY, sigma2E, s0, w0, z = numeric(0), ...)

Arguments

stat

A list of summary statistics with elements b (effect sizes), seb (standard errors) and n (per-variant sample sizes).

LD

Numeric LD (correlation) matrix aligned to the variants in stat.

varY

Numeric. Variance of the phenotype.

sigma2E

Numeric. Residual error variance estimate.

s0

Numeric vector of prior mixture standard deviations (the sigma0 grid).

w0

Numeric vector of prior mixture weights (summing to 1).

z

Optional numeric vector of z-scores; defaults to numeric(0) (derived from stat).

...

Additional arguments forwarded to mr.ash.rss.

Value

A numeric vector of the posterior mean of the coefficients.

Examples

data(eqtlRegionExample)
X <- eqtlRegionExample$X[, 1:30]
y <- eqtlRegionExample$yRes
ss <- lapply(seq_len(ncol(X)), function(j) {
  coef(summary(lm(y ~ X[, j])))[2, 1:2]
})
stat <- list(b = vapply(ss, `[`, numeric(1), 1L),
  seb = vapply(ss, `[`, numeric(1), 2L), n = rep(nrow(X), ncol(X)))
mrAshRssWeights(stat, cor(X), varY = var(y), sigma2E = var(y),
  s0 = c(0, 0.1, 0.5), w0 = c(0.8, 0.1, 0.1))
#>                [,1]
#>  [1,] -1.255350e-09
#>  [2,] -1.255350e-09
#>  [3,]  2.607000e-10
#>  [4,] -1.612172e-10
#>  [5,] -1.612172e-10
#>  [6,] -3.437262e-10
#>  [7,] -5.630480e-10
#>  [8,]  1.013868e-09
#>  [9,] -1.133489e-10
#> [10,] -1.133489e-10
#> [11,] -2.414229e-10
#> [12,] -4.445716e-10
#> [13,] -1.256939e-10
#> [14,] -9.525855e-11
#> [15,] -2.414229e-10
#> [16,]  1.013868e-09
#> [17,] -2.110191e-10
#> [18,] -2.371480e-10
#> [19,]  1.304826e-09
#> [20,] -2.371480e-10
#> [21,] -2.371480e-10
#> [22,] -3.437262e-10
#> [23,] -2.371480e-10
#> [24,]  2.860192e-11
#> [25,] -1.256940e-10
#> [26,] -3.437262e-10
#> [27,] -4.113177e-09
#> [28,] -1.184402e-09
#> [29,]  6.175135e-10
#> [30,]  4.776471e-10