Skip to contents

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

Usage

TwasWeights(
  studyName,
  context,
  trait,
  method,
  entry,
  jointStudies = NULL,
  jointContexts = NULL,
  jointTraits = NULL,
  traitPos = NULL,
  region = NULL,
  ldReference = NULL
)

Arguments

studyName

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.

region

Optional per-row analysis WINDOW (a GRanges or NULL) – the interval each row's fit was run over, carried forward as provenance; not part of the identity key. NULL (default) omits the column, and genomicRegion then derives the window from the span of the variants present.

ldReference

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),
  weightStandardized = FALSE)
tw <- TwasWeights(studyName = "s1", context = "brain", trait = "gene1",
  method = "susie", entry = list(twe))
tw
#> TwasWeights: 1 entries
#>   1 studies, 1 contexts, 1 traits, 1 methods
#>   LD reference: NULL (individual-level fit)