meta_abf: Meta-Analysis with an Approximate Bayes Factor

Description Usage Arguments Value Note Author(s) See Also Examples

Description

This function performs a meta-analysis on summary statistics from multiple genome-wide association studies. It takes as its inputs the effect size estimates (betas) and associated standard errors (ses), and for some prior on true effect size and on the relationship between the effect size across studies, returns a Bayes factor that shows the evidence in favour of the alternative model against the null model of no true effect.

Usage

1
2
3
meta.abf(betas, ses, prior.sigma, prior.cor = "indep",
prior.rho = NA, cryptic.cor = NA, log = FALSE,
log10 = FALSE, tolerance = 1e-1000)

Arguments

betas

This is a vector, matrix, or data frame of observed effect sizes of a single SNP in a set of studies. If betas is a vector, then this assumes a single SNP and each element of the vector corresponds to a study. If betas is a matrix, then the rows correspond to SNPs and the columns to studies.

ses

This is a vector, matrix, or data frame of standard errors corresponding to those in betas. Its class and dimensions should be identical to those of betas.

prior.sigma

This is the prior on true effect sizes for each SNP in each study. It can be a single value that applies to all studies, set individually for each study (i.e. a vector whose length is equal to the number of studies in the meta-analysis) or set for each study and SNP (i.e. a matrix of same dimension as betas and ses).

prior.cor

This is the prior on the relationship between true effect sizes in each study. It is a square matrix whose row and column numbers are the same as the number of studies. Its elements are the pairwise correlation coefficients between true effect sizes of the studies.

It can also take values “indep” (independent effects, where the values are 0 uniformly), “fixed” (fixed effects, where the values are 1 uniformly), “correlated” (uniform correlated effects, which requires the prior.rho parameter to be set). You may also simply input the desired matrix directly.

If betas and ses are matrices, the same prior.cor will be applied to every row (representing every SNP).

prior.rho

If prior.cor is set to “correlated”, then this is the value of the off-diagonal elements when the pair-wise correlation coefficients are all assumed to be the same value (for instance, all 0.5 or all 1). If prior.cor takes any other value, prior.rho is ignored.

cryptic.cor

This is a square matrix whose row and coumn numbers are the same as the number of studies. The off-diagonal elements are the pairwise correlation coefficients between the studies. If the studies in the meta-analysis are not independent of each other, it may be necessary to set this parameter so that the covariance in null effects is accounted for.

log

When TRUE, the calculation will return the log of the Bayes factors. Cannot be TRUE if log10 = TRUE.

log10

When TRUE, the calculation will return the log10 of the Bayes factors. Cannot be TRUE if log = TRUE.

tolerance

This is the relative tolerance to detect zero singular values. Used in an internal function during the calculation of the approximate Bayes factor. This should probably never be altered, but is there as a last resort if the calculation is not returning the values that are expected.

Value

Returns the approximate Bayes factor for the data under the given priors against the null. For a single SNP, this is a single value. For a matrix with rows of SNPs, this will return a numeric vector.

Note

Missing data should be marked NA. Where these are included, the calculation will be performed with the subset of the data for which there is information.

Author(s)

Trochet, Holly and Pirinen, Matti

See Also

exh.abf, wakefield.abf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#Obtain the matrices of betas and standard errors
betas <- cotsapas[,grep("\\.beta", names(cotsapas))]
ses <- cotsapas[,grep("\\.SE", names(cotsapas))]

betas[1:10,]
ses[1:10,]

#Perform an independent effects meta-analysis
meta.abf(betas, ses, prior.sigma = 0.2, prior.cor = "indep", log10 = TRUE)

#Single SNP analysis
i <- 1
meta.abf(betas[i,], ses[i,], prior.sigma = 0.2, prior.cor = "correlated", prior.rho = 0.5, log10 = TRUE)

trochet/metabf documentation built on Nov. 9, 2021, 1:08 p.m.