Skip to contents

Return the TwasWeightsRow for one (study, context, trait, method) row of a TwasWeights collection.

Usage

twasWeights(x, studyName = NULL, context = NULL, trait = NULL, method = NULL)

# S4 method for class 'TwasWeights'
twasWeights(x, studyName = NULL, context = NULL, trait = NULL, method = NULL)

Arguments

x

A TwasWeights object.

studyName, context, trait, method

Single character identifiers. All required when the collection has more than one row; optional when the collection has a single row.

Value

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