Skip to contents

Build a QtlSumStats from a manifest with one row per (study, context, trait) tuple. No QC is run. Each sumstats file needs a z column, or beta+se from which the Wald z (z = beta/se) is derived when z is absent (a supplied z takes precedence).

Usage

loadQtlSumStatsFromManifest(
  manifest,
  genome = NULL,
  ldSketch = NULL,
  region = NULL,
  minLdOverlapWarn = 0.5,
  columnMapping = NULL,
  sampleSelect = NULL,
  formatMapping = NULL
)

Arguments

manifest

A data.frame or path. Columns (snake_case aliases accepted): study, context, trait (required), sumStatsPath (required), columnMapping (optional), nSample (optional tuple-level total N), varY (optional), and the single-valued genome / ldSketchPath. When a row supplies nSample, its sumstats file need not carry a per-variant N column; summaryStatsQc fills N from the scalar. (Unlike the GWAS loader, there are no nCase/nControl columns: molecular QTL traits are quantitative.)

genome

Genome build; reconciled with a genome column.

ldSketch

A genotype panel (see readGenotypes) or spec; reconciled with an ldSketchPath column.

region, minLdOverlapWarn, columnMapping, sampleSelect, formatMapping

As for loadGwasSumStatsFromManifest.

Value

A QtlSumStats object.

Examples

tsv <- system.file("extdata", "manifests",
  "protocol_example.twas.gwas_sumstats.chr22.tsv.gz", package = "pecotmr")
ldStem <- file.path(system.file("extdata", "ld_reference", "chr22",
  package = "pecotmr"), "protocol_example.LD.chr22")
manifest <- data.frame(study = "s1", context = "brain",
  trait = "ENSG1", sumStatsPath = tsv)
loadQtlSumStatsFromManifest(manifest = manifest, genome = "hg38",
  ldSketch = ldStem, region = "chr22:10000000-19000000")
#> Warning: QtlSumStats[s1/brain/ENSG1]: no effect-allele frequency declared (map `af: <col>` to export a directional af); top_loci$af will be NA. A directionless `maf`/`FRQ` is used for QC only, never as af.
#> QtlSumStats: 1 entries, genome build hg38
#>   1 studies, 1 contexts, 1 traits
#>   LD sketch: plink2 @ /tmp/RtmppU8QTb/temp_libpath984aa04109/pecotmr/extdata/ld_reference/chr22/protocol_example.LD.chr22