umxGSEM_ldsc: Multivariate LD score regression (OpenMx C++ engine)

View source: R/umxGSEM.R

umxGSEM_ldscR Documentation

Multivariate LD score regression (OpenMx C++ engine)

Description

Runs multivariate LD score regression on munged .sumstats.gz files from umxGSEM_munge() via OpenMx imxLDSC. The return value is a umx covstruc: S and I named by trait, V / N named with OpenMx residual labels (var_SCZ, poly_BIP_SCZ, ...) so it can be passed to umxGSEM() as covstruc.

Usage

umxGSEM_ldsc(
  traits,
  sample.prev,
  population.prev,
  ld,
  wld,
  trait.names = NULL,
  sep_weights = FALSE,
  chr = 22,
  n.blocks = 200,
  ldsc.log = NULL,
  stand = FALSE,
  select = FALSE,
  chisq.max = NA
)

Arguments

traits

Character vector of paths to munged .sumstats.gz files (the return value of umxGSEM_munge()).

sample.prev

Numeric vector of sample prevalences (cases / N). Use NA for continuous traits.

population.prev

Numeric vector of population prevalences for liability-scale conversion. Use NA for continuous traits.

ld

Path to folder containing LD score files (e.g. ⁠eur_w_ld_chr/⁠, or ⁠$ld⁠ from umxGSEM_dl_tutorial_files()).

wld

Path to weight LD score files. Ignored when sep_weights = FALSE (then ld is used for both, matching GenomicSEM).

trait.names

Optional names for the traits (default: munged file basenames with .sumstats.gz stripped).

sep_weights

If TRUE, read regression weights from wld instead of ld.

chr

Highest chromosome to include when select = FALSE (default 22).

n.blocks

Jackknife blocks for V (default 200). Raised automatically when K > 18, as in GenomicSEM.

ldsc.log

Optional path prefix for a short text log. If NULL, no log file is written (unlike GenomicSEM, which always writes one).

stand

If TRUE, also return S_Stand / V_Stand (genetic correlations and their sampling covariance).

select

Chromosome subset: FALSE (use 1:chr), "ODD", "EVEN", or a numeric vector of chromosome numbers.

chisq.max

Optional chi-square outlier cutoff (NA = engine default).

Details

Tutorial 1k-SNP files will run but the estimates are not usable (too few SNPs). For a real structural model use full-sumstat ldsc or Psych_LDSC.

S is K x K genetic covariance (heritabilities on the diagonal). V is the sampling covariance of vech(S), length K(K+1)/2. I holds LDSC intercepts (sample overlap / stratification). Binary traits: supply both sample.prev and population.prev for liability scaling. Continuous traits: NA (a lone 0.5 with population.prev = NA is treated as continuous).

Value

A list with S, V, I, N, m (and S_Stand/V_Stand if stand). Ready for umxGSEM() / umxGSEM_label_ldsc().

See Also

umxGSEM_munge(), umxGSEM(), Psych_LDSC

Other GSEM: Anthro_LDSC, Psych_LDSC, plot.umx_GWAS(), umxGSEM(), umxGSEM_GWAS(), umxGSEM_dl_tutorial_files(), umxGSEM_label_ldsc(), umxGSEM_munge(), umxGSEM_std(), umxGSEM_sumstats(), umxSummary.MxDataStatic(), umxSummary.list()

Examples

## Not run: 
tut = umxGSEM_dl_tutorial_files()
ss = umxGSEM_munge(
  files = tut$sumstats, hm3 = tut$hm3,
  Ns = c(105318, 16731, 173005),
  trait.names = c("SCZ", "BIP", "MDD"),
  output_dir = tut$dir, overwrite = TRUE
)
# Pedagogical only: ~1k SNPs. Use data(Psych_LDSC) for a real model.
covstruc = umxGSEM_ldsc(
  traits = ss,
  sample.prev = c(0.39, 0.45, 0.35),
  population.prev = c(0.01, 0.01, 0.16),
  ld = tut$ld, wld = tut$ld,
  trait.names = c("SCZ", "BIP", "MDD"),
  n.blocks = 20
)
umxSummary(covstruc)

## End(Not run)

umx documentation built on Oct. 11, 2026, 5:07 p.m.