shotgun_abf_model: ABF calculation for GWAS meta-analysis through shotgun...

View source: R/shotgun_abf_model.R

shotgun_abf_modelR Documentation

ABF calculation for GWAS meta-analysis through shotgun stochastic search

Description

using shotgun stochastic search algorithm to quickly get the optimal ABF for a single SNP and a phenotype in GWAS meta-analysis.

Usage

shotgun_abf_model(
  betas,
  ses,
  prior.sigma = 0.3,
  prior.cor = "indep",
  prior.rho = NA,
  cryptic.cor = NA,
  log = FALSE,
  log10 = FALSE,
  na.rm = FALSE,
  tolerance = 0,
  n.iter = 50,
  B = 5
)

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.

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.

n.iter

the number of iteration for MCMC. Default is 50.

B

the largest number of subsets involved in the optimal set. Default is 5.

Value

a list containing:

ABF

the optimal ABF calculated

model

the optimal subset model

Examples

library(GWASmeta)
data(single)
betas <- single$betas
ses <- single$ses
re <- shotgun_abf_model(betas,ses)


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