Skip to contents

Return an aligned (variantIds, weights) pair from a single weight-source entry, so cTWAS and causalInferencePipeline extract weights identically whether the source is a TwasWeights collection (its learned weight vector) or a FineMappingResult one (its topLoci posterior effect). The selectors pin the single row the weights come from.

Usage

resolveWeights(x, ...)

# S4 method for class 'FineMappingResultBase'
resolveWeights(x, ...)

# S4 method for class 'TwasWeights'
resolveWeights(
  x,
  study = NULL,
  context = NULL,
  trait = NULL,
  method = NULL,
  ...
)

Arguments

x

A TwasWeights or a FineMappingResult.

...

Reserved for future use.

study, context, trait, method

Optional length-1 selectors pinning one row of a collection, as elsewhere; each NULL (default) leaves that part of the tuple unconstrained. Ignored when x is already a row.

Value

A list with variantIds (character) and weights (numeric) of equal length; both empty when no usable weights are present.

Examples

data(twasWeightsExample)
w <- resolveWeights(twasWeightsExample, study = "protocol_example",
  context = "bulk_rnaseq", trait = "ENSG00000130538", method = "susie")
length(w$variantIds)
#> [1] 168