bogdanlab / focus

FOCUS: Fine-mapping Of CaUsal gene Sets
GNU General Public License v3.0
43 stars 17 forks source link

p-values in the output plot is on negative natural log scale? #55

Open ruthchia opened 1 year ago

ruthchia commented 1 year ago

Hi, I wanted to check if the -log10(P) values included in the focus plot are on the log10 or natural log scale. I did some conversions of the Z-scores and noticed that it did not match up when I recalculated it in R.

For example, for a Z-score value of 4.5800, the FOCUS outputted -log10(P) in the plot was 12.27869 . When I calculated in R (see below), I got a different value. Can you please help clarify? Did I miss something that resulted in my calculations being incorrect?

Thanks, Ruth

> Z = 4.5800
> P = 2*pnorm(abs(Z), lower.tail = FALSE) # convert Z-score to P-values
> P
[1] 4.649759e-06
> -log10(P). # convert P-values to -log10(P)
[1] 5.33257
quattro commented 1 year ago

Hi Ruth,

Yes good catch. It looks like it is still in natural log, and not log10. For example,

> Z = 4.5800
> 2*pnorm(abs(Z), lower.tail = FALSE)
[1] 4.649759e-06
> pnorm(abs(Z), lower.tail = FALSE, log.p=TRUE) + log(2)  # log(2 * p)
[1] -12.2787
ruthchia commented 1 year ago

Great - thanks for your quick response!