Open ez-xyz opened 1 year ago
@ez-xyz Did you mean to do this?
rows <- 1:1000
single.test <- mash_set_data(simdata$Bhat[rows,,drop = FALSE],simdata$Shat[rows,,drop = FALSE],V = Vhat)
The code you provided only selects one data point.
@pcarbo In my application, I only want to compute the posterior summaries for one test (one eQTL). The example code I provided above mimics that situation by selecting the 1000th test.
@ez-xyz I don't have R right in front of me, but would setting rows <- c(1000, 1000)
work, or setting rows <- c(1000, i)
, where i
is a random row? There may be a bug in handling the special case of 1 row.
@pcarbo Yes, subsetting more than one rows and then running mashr would work.
I tried to follow the code in this vignette to compute the posterior summaries for a single test, but I got the following error message:
Error: each_row(): incompatible size; expected 1x1, got 1x12
Specifically, I modified the code in "Compute posterior summaries" section while keeping everything else the same:
single.test = mash_set_data(simdata$Bhat[1000,,drop=F],simdata$Shat[1000,,drop=F], V=Vhat)
m2 = mash(single.test, g=get_fitted_g(m), fixg=TRUE)