Skip to contents

Filters and harmonizes GWAS summary statistics for use with ldsc.

Usage

munge(
  files,
  hm3,
  trait.names = NULL,
  N = NULL,
  info.filter = 0.9,
  maf.filter = 0.01,
  log.name = NULL,
  column.names = list(),
  parallel = FALSE,
  cores = NULL,
  overwrite = TRUE
)

Arguments

files

Character vector of GWAS file paths

hm3

Path to HapMap3 SNP reference file

trait.names

Character vector of trait names

N

Optional sample-size override. Accepts NULL (infer N from every file), a scalar (applied uniformly to all traits), or a length-length(files) vector with one entry per trait (use NA in any slot to infer N from that file). Matches GenomicSEM::munge's per-trait override semantics.

info.filter

INFO score filter threshold (default 0.9)

maf.filter

MAF filter threshold (default 0.01)

log.name

Log file name (ignored in gsemr)

column.names

Named list of column name overrides

parallel

Accepted for API compatibility; gsemr's munge is currently single-threaded so this has no effect.

cores

Accepted for API compatibility; see parallel.

overwrite

Overwrite existing files (ignored in gsemr)

Value

Character vector of output file paths (invisibly)

Examples

if (FALSE) { # \dontrun{
# Munge raw GWAS files against a HapMap3 reference SNP list.
munge(
  files = c("gwas1.txt", "gwas2.txt"),
  hm3 = "w_hm3.snplist",
  trait.names = c("T1", "T2")
)
# Writes T1.sumstats.gz, T2.sumstats.gz to the working directory.
} # }