Skip to contents

Estimates genetic covariance using the HDL method, which uses LD eigenvalue decomposition for more precise estimation than LDSC.

Usage

hdl(
  traits,
  sample.prev = NA,
  population.prev = NA,
  trait.names = NULL,
  LD.path,
  Nref = 335265,
  method = "piecewise"
)

Arguments

traits

Character vector of paths to .sumstats.gz files

sample.prev

Numeric vector of sample prevalences (NA for continuous traits)

population.prev

Numeric vector of population prevalences (NA for continuous)

trait.names

Character vector of trait names (defaults to V1, V2, ...)

LD.path

Path to HDL LD reference panel directory (text format)

Nref

Reference panel sample size (default 335265 for UKB)

method

HDL method: "piecewise" (default) or "jackknife"

Value

A list with components:

S

Genetic covariance matrix (k x k)

V

Sampling covariance matrix

I

Intercept matrix

m

Number of SNPs used

Examples

if (FALSE) { # \dontrun{
# HDL uses a text-format LD panel directory (see convert_hdl_panels()).
result <- hdl(
  traits = c("T1.sumstats.gz", "T2.sumstats.gz"),
  sample.prev = c(NA, NA),
  population.prev = c(NA, NA),
  LD.path = "hdl_text_panels/",
  trait.names = c("V1", "V2")
)
result$S
} # }