exh_abf: ABF calculation for GWAS meta-analysis through...

View source: R/exh_abf.R

exh_abfR Documentation

ABF calculation for GWAS meta-analysis through Subset-Exhaustive

Description

Subset-Exhaustive to get the ABFs in all subsets for a single SNP and a phenotype in GWAS meta-analysis.

Usage

exh_abf(
  betas,
  ses,
  prior.sigma = 0.3,
  prior.cor = "indep",
  prior.rho = NA,
  cryptic.cor = NA,
  log = FALSE,
  log10 = FALSE,
  study.names = NULL,
  na.rm = FALSE,
  tolerance = 0
)

Arguments

betas

a numeric vector of observed effect sizes of a single SNP in a set of studies. Each element of the vector is assumed to correspond to a study.

ses

a numeric vector of standard errors corresponding to those in betas. It should have the same length as betas.

prior.sigma

the prior on true effect sizes for each SNP in each study. It can be a flat value, set 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).

prior.cor

a square matrix whose row and column numbers are the same as the number of studies. Its elements are the pairwise correlations between true effect sizes of the studies. It can take values "indep" (independent effects), "fixed" (fixed effects), "correlated" (correlated effects, which requires the prior.rho parameter to be set), as well as individual matrices. If betas and ses are matrices, the same prior.cor will be applied to every row (representing every SNP).

prior.rho

either a single value or the upper triangle of a correlation matrix for the prior.cor matrix when it is set to "correlated". If this value is set, but prior.cor is not set to "correlated", this parameter will be ignored.

cryptic.cor

a square matrix whose row and coumn numbers are the same as the number of 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

sets whether the answer should be given in log space.

log10

sets whether the answer should be given in log10 space.

study.names

if set, the output will label the columns with the study names.

na.rm

if there are NAs in the data, these are removed and the calculation is performed with the remaining data. This happens regardless of how this parameter is set. By default, the output will include a column of NAs for the study with the missing data. Changing this parameter to TRUE removes this column.

tolerance

for the ABF calculation, this can be lowered (or raised, if necessary) if the answers are not what was expected. Should probably never be altered, but is there in case it is needed. Default is 1e-1000.

Value

a data frame containing ABF calculated in all subsets.


sjl-sjtu/GWAS_meta documentation built on May 7, 2024, 5:04 p.m.