Row-bind two or more TwasWeights collections into one – e.g.
assembling per-gene weight sets into a single per-region collection for
cTWAS. Joint-specification metadata columns are carried through.
Arguments
- ...
Two or more
TwasWeightsobjects, or a singlelistof them.- ldSketch
Optional genotype panel (see
readGenotypes) to attach to the combined collection. DefaultNULL. Applied when combining two or more inputs; a single input is returned unchanged.
Examples
twe <- twasWeightsRow(
variantIds = sprintf("chr1:%d:A:G", 100L * (1:4)), weights = rep(0.1, 4),
cvResult = list(rsq = 0.5), standardized = FALSE)
tw1 <- TwasWeights(study = "s1", context = "brain", trait = "g1",
method = "susie", entry = list(twe))
tw2 <- TwasWeights(study = "s2", context = "brain", trait = "g1",
method = "susie", entry = list(twe))
combineTwasWeights(tw1, tw2)
#> TwasWeights: 2 entries
#> 2 studies, 1 contexts, 1 traits, 1 methods
#> LD sketch: NULL (individual-level fit)