Extract weights from a TwasWeightsRow or from one entry
of a TwasWeights collection.
Usage
getWeights(x, ...)
# S4 method for class 'TwasWeights'
getWeights(x, study = NULL, context = NULL, trait = NULL, method = NULL, ...)
# S4 method for class 'TwasWeightsRow'
getWeights(x, ...)Arguments
- x
A
TwasWeightsRoworTwasWeights.- ...
Class-specific selection arguments.
- study
Character (length 1) or
NULL. Restrict the selection to this study;NULLmatches all studies.- context
Character (length 1) or
NULL. Restrict the selection to this context;NULLmatches all contexts.- trait
Character (length 1) or
NULL. Restrict the selection to this trait;NULLmatches all traits.- method
Character (length 1) or
NULL. Restrict the selection to this fine-mapping / weight method;NULLmatches all methods.
Examples
twe <- twasWeightsRow(variantIds = sprintf("chr1:%d:A:G", 100L * (1:4)),
weights = rep(0.1, 4), cvResult = list(rsq = 0.5), standardized = FALSE)
getWeights(twe)
#> [1] 0.1 0.1 0.1 0.1