Skip to contents

This function is a wrapper for the SDPR C++ implementation, which performs Markov Chain Monte Carlo (MCMC) for estimating effect sizes and heritability based on summary statistics and reference LD matrices.

Usage

sdpr(
  bhat,
  R,
  n,
  perVariantSampleSize = NULL,
  array = NULL,
  a = 0.1,
  c = 1,
  M = 1000,
  a0k = 0.5,
  b0k = 0.5,
  iter = 1000,
  burn = 200,
  thin = 5,
  numThreads = 1,
  optLlk = 1,
  verbose = TRUE,
  seed = NULL
)

Arguments

bhat

A vector of marginal beta values for each SNP.

R

The LD correlation matrix (a single matrix over the analysed window).

n

The total sample size of the GWAS.

perVariantSampleSize

(Optional) A vector of sample sizes for each SNP. If NULL (default), it will be initialized to a vector of length equal to `bhat`, with all values set to `n`.

array

(Optional) A vector of genotyping array information for each SNP. If NULL (default), it will be initialized to a vector of 1's with length equal to `bhat`.

a

Factor to shrink the reference LD matrix. Default is 0.1.

c

Factor to correct for the deflation. Default is 1.

M

Max number of variance components. Default is 1000.

a0k

Hyperparameter for inverse gamma distribution. Default is 0.5.

b0k

Hyperparameter for inverse gamma distribution. Default is 0.5.

iter

Number of iterations for MCMC. Default is 1000.

burn

Number of burn-in iterations for MCMC. Default is 200.

thin

Thinning interval for MCMC. Default is 5.

numThreads

Number of threads to use. Default is 1.

optLlk

Which likelihood to evaluate. 1 for equation 6 (slightly shrink the correlation of SNPs) and 2 for equation 5 (SNPs genotyped on different arrays in a separate cohort). Default is 1.

verbose

Whether to print verbose output. Default is true.

seed

Integer or NULL. Random seed for the Gibbs sampler; NULL leaves the RNG state unchanged.

Value

A list with betaEst (the estimated effect sizes) and h2 (the estimated heritability).

Details

Internal: sdprWeights is the public interface. It forwards the arguments below other than bhat, R and n through SdprOptions, and with fitRetention returns this function's list as the "fit" attribute of its weights.

Note

This function wraps a rewritten and adapted version of the SDPR C++ implementation. SDPR is described in Zhou G, Zhao H (2021), "A fast and robust Bayesian nonparametric method for prediction of complex traits using summary statistics", PLoS Genetics 17(7): e1009697. doi:10.1371/journal.pgen.1009697