Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential issue of computing posterior summaries for a single test #118

Open
ez-xyz opened this issue Jul 31, 2023 · 4 comments
Open

Potential issue of computing posterior summaries for a single test #118

ez-xyz opened this issue Jul 31, 2023 · 4 comments

Comments

@ez-xyz
Copy link

ez-xyz commented Jul 31, 2023

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)

@pcarbo
Copy link
Member

pcarbo commented Aug 1, 2023

@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.

@ez-xyz
Copy link
Author

ez-xyz commented Aug 1, 2023

@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.

@pcarbo
Copy link
Member

pcarbo commented Aug 1, 2023

@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.

@ez-xyz
Copy link
Author

ez-xyz commented Aug 1, 2023

@pcarbo Yes, subsetting more than one rows and then running mashr would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants