You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
need better documentation for computing posterior for linear combinations of effects #130
We can compute the posterior summaries Ab for any matrix A, but this is not well documented.
Here was a user request (by email)
we have a situation with stimulated and unstimulated cells. We've mapped eQTL for each cell type, and have run mash. What we're interested in is cases where the effect size differs in the stimulated and unstimulated condition. We've been identifying those based on the local false sign rates (e.g. requiring lfsr < 0.1 for discovery, and calling it a context-specific eQTL if the lfsr is > 0.2 or 0.5 in the other condition). It would be wonderful to have something more principled that doesn't rely on arbitrary cutoffs, such as a direct test of whether B1 = B2. Is it possible to extract those summaries from mash currently, or how can we go about doing so?
The answer is that we can do this using the matrix A in mash_compute_posterior_matrices
Eg the following runs mash on simulted 5 conditions, but computes posterior for B1-B2
simdata = simple_sims(50,5,1)
data = mash_set_data(simdata$Bhat, simdata$Shat)
m = mash(data, cov_canonical(data))
mash_compute_posterior_matrices(m,data,A=rbind(c(1,-1,0,0,0)))
The role of A could be better documented in the function (eg add this example), and perhaps also in a vignette.
What we hope to achieve is, that for a fine-mapped variant, we can get the posterior difference between contexts, and assess its significance in terms of lfsr. This can be summarized in a figure like the following:
I don't think all the technical details are correct now as you can see the lfsr is off. But if this is aligned with what you have in mind, we'd be happy to formalize this as a vignette to users.
Thank you, this was very useful! Can you clarify some things about the process and output for me?
The A matrix is essentially asking if the -1 and +1 betas are different, right? How should I think about this comparison if I wanted to do multiple comparisons (e.g. A = c(-1, 1, -1, 1, 0, 0, 0, 0))?
@TaurVil I'm working with @yunqiyang0215 to polish up as a pull request to the mashr package for other co-authors to review ... please allow me to touch base with @yunqiyang0215 and get back on this. If it takes longer than I hope I'll get back on more details here.
Activity
stephens999 commentedon Oct 1, 2024
it seems the documentation for
mash_compute_posterior_matricesandcompute_posterior_matricescould be usefully combined?gaow commentedon Oct 1, 2024
A while ago, we looked into this with @yunqiyang0215 and generated a rough vignette
mashr_posterior_demo.R.txt
and a write-up on this application
mashr_posterior.pdf. This may not be exactly what you need but might be similar?
What we hope to achieve is, that for a fine-mapped variant, we can get the posterior difference between contexts, and assess its significance in terms of lfsr. This can be summarized in a figure like the following:
I don't think all the technical details are correct now as you can see the lfsr is off. But if this is aligned with what you have in mind, we'd be happy to formalize this as a vignette to users.
TaurVil commentedon Oct 25, 2024
Thank you, this was very useful! Can you clarify some things about the process and output for me?
gaow commentedon Oct 25, 2024
@TaurVil I'm working with @yunqiyang0215 to polish up as a pull request to the mashr package for other co-authors to review ... please allow me to touch base with @yunqiyang0215 and get back on this. If it takes longer than I hope I'll get back on more details here.