Skip to contents

Construct a TwasWeights DFrame-subclass collection from per-tuple vectors and a list of TwasWeightsRow payloads (one per tuple).

Usage

TwasWeights(
  study,
  context,
  trait,
  method,
  entry,
  jointStudies = NULL,
  jointContexts = NULL,
  jointTraits = NULL,
  traitPos = NULL,
  ldSketch = NULL
)

Arguments

study

Character vector of study identifiers. Use the sentinel "joint" for rows produced by a cross-study joint fit.

context

Character vector of context labels. Use "joint" for rows produced by a cross-context joint fit.

trait

Character vector of trait identifiers. Use "joint" for rows produced by a cross-trait joint fit.

method

Character vector of TWAS weight method names.

entry

List / SimpleList of TwasWeightsRow objects.

jointStudies

Optional character vector (length length(study)) listing the semicolon-joined studies participating in each row's cross-study joint fit, or NA_character_ for non-joint rows. When NULL (default) the column is omitted.

jointContexts

Optional character vector for cross-context joints. Same shape as jointStudies.

jointTraits

Optional character vector for cross-trait joints. Same shape as jointStudies.

traitPos

Optional per-row trait genomic anchor (a GRanges or NULL), carried forward as provenance; not part of the identity key. NULL (default) omits the column.

ldSketch

An optional genotype panel (see readGenotypes), or NULL for individual-level fits.

Value

A TwasWeights object.

Examples

twe <- twasWeightsRow(variantIds = sprintf("chr1:%d:A:G", 100L * (1:4)),
  weights = rep(0.1, 4), cvResult = list(rsq = 0.5), standardized = FALSE)
tw <- TwasWeights(study = "s1", context = "brain", trait = "gene1",
  method = "susie", entry = list(twe))
tw
#> TwasWeights: 1 entries
#>   1 studies, 1 contexts, 1 traits, 1 methods
#>   LD sketch: NULL (individual-level fit)