Slices the bhat, sbhat, and Z matrices by row (SNPs) and
column (samples/conditions), and correspondingly subsets the vhat
covariance matrix.
Examples
cond <- c("brain", "blood", "muscle")
p <- 8
bhat <- matrix(rnorm(p * 3), p, 3,
dimnames = list(sprintf("chr1:%d:A:G", 100L * (1:p)), cond))
sbhat <- matrix(abs(rnorm(p * 3)) + 0.1, p, 3,
dimnames = list(sprintf("chr1:%d:A:G", 100L * (1:p)), cond))
dat <- list(bhat = bhat, sbhat = sbhat, Z = bhat / sbhat,
snp = sprintf("chr1:%d:A:G", 100L * (1:p)))
vhat <- diag(3)
dimnames(vhat) <- list(cond, cond)
sliceMashData(dat, vhat = vhat, snps = 1:4, samples = NULL)
#> $data
#> $data$bhat
#>
#> chr1:100:A:G
#> chr1:200:A:G
#> chr1:300:A:G
#> chr1:400:A:G
#>
#> $data$sbhat
#>
#> chr1:100:A:G
#> chr1:200:A:G
#> chr1:300:A:G
#> chr1:400:A:G
#>
#> $data$Z
#>
#> chr1:100:A:G
#> chr1:200:A:G
#> chr1:300:A:G
#> chr1:400:A:G
#>
#> $data$snp
#> character(0)
#>
#>
#> $vhat
#> <0 x 0 matrix>
#>