chr1swallace / coloc

Repo for the R package coloc
138 stars 44 forks source link

[Question] Calculating coloc.abf PP.H4.abf #146

Closed ctat41 closed 5 months ago

ctat41 commented 5 months ago

Hello,

I am wondering about the calculation of PP.H4.abf from this paper by giambartolomei et al. If I am understanding the methods correctly, then the summary abf is calculated for each region by adding the two log abfs from each study per snp, then summing over every snp in the region, and then multiplying this by the prior probability.

However, when I try to do this manually using my coloc.abf values I get approximately half of what the PP.H4.abf is showing for the summary.

>coloc.results$summary
       nsnps    PP.H0.abf    PP.H1.abf    PP.H2.abf    PP.H3.abf    PP.H4.abf 
1.506000e+03 1.435915e-19 6.200432e-20 3.138784e-01 1.353161e-01 5.508054e-01 

>coloc.results$results %>% pull(internal.sum.lABF) %>% sum()*1e-5
0.2707642

Am I misunderstanding the calculation?

Also, from the coloc.abf vignette, SNP.PP.H4 is "the posterior probabilities for each SNP to be causal conditional on H4 being true". Does this mean that to calculate the SNP.PP.H4, $P(\textrm{snp is causal}) = P(SNP.PP.H4 | PP.H4) = \frac{P(SNP.PP.H4 \cap PP.H4)}{PP.H4.abf}$?

Thank you.