
Maximize the log likelihood to infer the heritability enrichment folds jointly.
Source:R/sHDL.joint.R
sHDL.joint.Rd
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 alsosHDL::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 theDr.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, defaultfix.h2 = NULL
, which means estimate the heritability.- fix.intercept
Whether to fix the intercept to
fix.intercept
or estimate the intercept, defaultfix.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 isNULL
, which meansc(0.1, 1, 1, ..., 1)
. Iffix.h2
orfix.intercept
is notNULL
, the starting values forh2
orintercept
will be ignored.- lwr
Lower bounds for
c(h2, intercept, fold1, fold2, ..., foldn)
. Default isNULL
, which meansc(0, 0, 0, 0, ..., 0)
. Whenfix.h2
orfix.intercept
is notNULL
. Whenfix.h2
orfix.intercept
is notNULL
, the lower bounds forh2
orintercept
will be ignored.- upr
Upper bounds for
c(h2, intercept, fold1, fold2, ..., foldn)
, default isNULL
, which meansc(1, 5, M/Md_1, M/Md_2, ..., M/Md_n)
, whereMd_i
is the sum of the weights of the i-th annotation. Whenfix.h2
orfix.intercept
is notNULL
, the upper bounds forh2
orintercept
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.