umxGSEM_munge: Munge Genomic SEM Summary Statistics

View source: R/umxGSEM.R

umxGSEM_mungeR Documentation

Munge Genomic SEM Summary Statistics

Description

umxGSEM_munge allows you to format and filter summary statistics files for Genomic SEM / LDSC using the high-speed OpenMx C++ munging engine. munge creates the *.sumstats.gz files for umxGSEM_ldsc().

For a tutorial run, umxGSEM_dl_tutorial_files() supplies 1k-SNP sumstats plus w_hm3.snplist. For production, download full consortium sumstats and gunzip the Zenodo HapMap3 list (⁠https://zenodo.org/records/7773502/files/w_hm3.snplist.gz⁠). Local ldsc also needs Alkes EUR LD scores (⁠https://alkesgroup.broadinstitute.org/LDSCORE/eur_w_ld_chr.tar.bz2⁠); skip that if you already have a covstruc such as Psych_LDSC. 1000G EUR plink (~10-20 GB) is only required if sumstats lack allele frequency and you need an FRQ filter.

Usage

umxGSEM_munge(
  files = NULL,
  hm3 = "w_hm3.snplist",
  Ns = NULL,
  trait.names = NULL,
  info.filter = 0.9,
  maf.filter = 0.01,
  column.names = list(),
  output_dir = getwd(),
  cores = -1,
  overwrite = FALSE,
  ...
)

Arguments

files

A character vector of summary statistics files to munge.

hm3

Path to the HapMap3 SNP reference list (e.g. ⁠$hm3⁠ from umxGSEM_dl_tutorial_files(), or a production w_hm3.snplist).

Ns

A numeric vector of sample sizes (one per file). If a single value is provided, it will be replicated for all files.

trait.names

A character vector of names for the traits. Defaults to the basenames of the files.

info.filter

Info score threshold filter (defaults to 0.9).

maf.filter

Minor Allele Frequency threshold filter (defaults to 0.01).

column.names

A list of custom column name mappings. Synonyms are automatically resolved if left empty.

output_dir

Path to the directory where munged files should be saved. Defaults to getwd().

cores

Number of CPU cores/threads to use. Defaults to -1 (uses all available threads).

overwrite

Whether to overwrite existing munged files (defaults to FALSE).

...

Additional arguments passed to OpenMx imxMunge when available (GenomicMx).

Details

umxGSEM_munge will intelligently search for synonyms for heading names: SNP: snp, rsid, marker, snpid, rs, markername A1: a1, allele1, effect_allele, inc_allele, reference_allele A2: a2, allele2, non_effect_allele, dec_allele, other_allele P: p, p-value, pval, p.value effect: effect, or, beta, logor, est, estimate

note: Ensure that the summary statistics are full, not "23&me" style "top x thousand SNPs". Nor just pruned SNPs.

Value

A character vector of paths to the munged files.

See Also

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

Examples

## Not run: 
tut = umxGSEM_dl_tutorial_files()
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
)

## End(Not run)

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