Skip to contents

Construct a CtwasResult DFrame-subclass collection of cTWAS runs from per-tuple vectors and a list of CtwasResultEntry payloads (one per run). A single-context run is one row; a multi-context run emits per-context rows sharing the same jointContexts set and jointly-estimated group priors.

Usage

CtwasResult(
  gwasStudy,
  study,
  context,
  method,
  entry,
  jointStudies = NULL,
  jointContexts = NULL
)

Arguments

gwasStudy

Character vector of GWAS (disease) study identifiers.

study

Character vector of QTL study identifiers.

context

Character vector of context labels (scalar per row).

method

Character vector of weight-method names.

entry

List / SimpleList of CtwasResultEntry objects.

jointStudies

Optional character vector (length length(gwasStudy)) listing the joined studies for a multi-study run, NA_character_ otherwise. NULL (default) omits the column.

jointContexts

Optional character vector for multi-context runs. Same shape as jointStudies.

Value

A CtwasResult object.

Examples

cre <- CtwasResultEntry(
  finemap = data.frame(id = c("g1", "g2"), susie_pip = c(0.9, 0.1)),
  susieAlpha = data.frame(id = c("g1", "g2"), alpha = c(0.9, 0.1)))
cr <- CtwasResult(gwasStudy = "gwas1", study = "s1", context = "brain",
  method = "susie", entry = list(cre))
cr
#> CtwasResult: 1 run(s)
#>   1 GWAS stud(y/ies), 1 method(s): susie