Skip to contents

Maximize the log likelihood to infer the heritability enrichment folds jointly.

Usage

sHDL.joint(
  Dr.path,
  gwas.df,
  LD.path,
  output.file = NULL,
  annots = NULL,
  mc.cores = 1,
  fill.missing.N = c("none", "min", "max", "median", "mean"),
  lim = exp(-18),
  lam.cut = NULL,
  verbose = FALSE,
  fix.h2 = NULL,
  fix.intercept = NULL,
  maxit = 1000,
  pgtol = 0.001,
  start.v = NULL,
  lwr = NULL,
  upr = NULL,
  pattern = ".*chr(\\d{1,2})\\.(\\d{1,2})[_\\.].*",
  par.h2 = FALSE,
  nthreads = 1
)

Arguments

Dr.path

The path to the pre-computed diag(Dr) data, see also sHDL::sHDL.joint.reduct.dim.

gwas.df

A data frame including GWAS summary statistics of genetic variants for a trait. The input data frame should include following columns: SNP, SNP ID; A1, effect allele; A2, reference allele; N, sample size; Z, z-score; If Z is not given, alternatively, you may provide: b, estimate of marginal effect in GWAS; se, standard error of the estimates of marginal effects in GWAS.

LD.path

Path to the directory where linkage disequilibrium (LD) information is stored, compatible with HDL LD reference panels.

output.file

Where the log and results should be written. If you do not specify a file, the log will be printed on the console.

annots

A vector of annotation names, default NULL, which means all annotations in the Dr.path will be used.

mc.cores

Number of cores to use for parallelization, default mc.cores = 1.

fill.missing.N

If the sample size is missing in the GWAS summary statistics, fill.missing.N is used to fill the missing values.

lim

Tolerance limitation to ensure the positive-definiteness of covariance matrices, default lim = exp(-18).

lam.cut

Eigenvalue cutoff for LD matrices, default lam.cut = NULL, which means no cutoff. For analyses with a limited number of traits and annotations, a lower cutoff (such as 0.1, or even not using a cutoff at all) is recommended. For large-scale analyses, a higher cutoff (such as 1) is recommended, to yield fast computation.

verbose

Whether to print the log on the console, default verbose = FALSE.

fix.h2

Whether to fix the heritability to fix.h2 or estimate the heritability, default fix.h2 = NULL, which means estimate the heritability.

fix.intercept

Whether to fix the intercept to fix.intercept or estimate the intercept, default fix.intercept = NULL, which means estimate the intercept.

maxit

Maximum number of iterations, default maxit = 1000.

pgtol

Tolerance for convergence, default pgtol = 1e-3.

start.v

Starting values for c(h2, intercept, fold1, fold2, ..., foldn), where n is the number of annotations. Default is NULL, which means c(0.1, 1, 1, ..., 1). If fix.h2 or fix.intercept is not NULL, the starting values for h2 or intercept will be ignored.

lwr

Lower bounds for c(h2, intercept, fold1, fold2, ..., foldn). Default is NULL, which means c(0, 0, 0, 0, ..., 0). When fix.h2 or fix.intercept is not NULL. When fix.h2 or fix.intercept is not NULL, the lower bounds for h2 or intercept will be ignored.

upr

Upper bounds for c(h2, intercept, fold1, fold2, ..., foldn), default is NULL, which means c(1, 5, M/Md_1, M/Md_2, ..., M/Md_n), where Md_i is the sum of the weights of the i-th annotation. When fix.h2 or fix.intercept is not NULL, the upper bounds for h2 or intercept will be ignored.

pattern

Chromosome and picece pattern of LD files, default is ".*chr(\d{1,2})\.(\d{1,2})[_\.].*".

par.h2

Whether to estimate the partitioned heritability, default par.h2 = FALSE.

nthreads

Number of threads to use for matrix operations, default nthreads = 1. The default value is suitable for most cases, do not change it unless you are sure about the performance.

Value

A list is returned with:

  • item The name of the parameter.

  • estimation The estimated value of the parameter.

  • se The standard error of the parameter.

  • p The p-value of the parameter.

  • note The note of the parameter.