Jitter p-values in volcano plot
1
0
Entering edit mode
philipp.rewe ▴ 20
@philipprewe24159
Last seen 4.1 years ago
Würzburg

Hi, I working with a DESeq2 data set and I am using the package EnhancedVolcano to visualize my data. This is one example:

enter image description here

As you can see some of the genes have such a low p-value that DESeq2 places 0. This does not look very nice in the plot - said my PI. I guess there are two ways to address this issue (which is not really an issue rather than an aesthetic thing): Either in DESeq2 by calculating the exact p-value if possible or by placing randomly very low p-values or in EnhancedVolcano by applying some kind of jitter function to the values of the y-axis. I know that EnhancedVolcano is based on ggplot2 and there is the function called geom_jitter() but I am not able to apply it to my data.

Please let me know if you need more information or data. Thank you guys in advance!

Cheers, Philipp

EnhancedVolcano DESeq2 • 4.4k views
ADD COMMENT
2
Entering edit mode
@mikelove
Last seen 11 hours ago
United States

I've used jitter for very small p-values before, see Figure 4 here:

Because DEXSeq outputs an adjusted p-value of 0 for some of the genes, we set these instead to a jittered value around 10−20, so that their number and location on the x-axis could be visualized. These jittered values should only be used for visualization.

https://f1000research.com/articles/7-952#f4

ADD COMMENT
1
Entering edit mode

Hey, just a quick feedback. I managed by following the description in the link: enter image description here

# subsetting rows with p-value 0:
pval_0 <- subset(res, res$pvalue == 0)
# creating a random list of numbers around 1e-300. 
pval_jitter <- round(rnorm(nrow(pval_0), mean =295, sd = 5),0) 
pval_jitter <- 1*10^-pval_jitter
# replace old p-values by new values
pval_0$pvalue <- pval_jitter
# creating a new data set for visualisation 
resA_1 <- subset(res,res$pvalue!=0)
resA_2 <- rbind(resA_1, padj0)

I guess it can be done in a more elegant way. But it does the job for me. I also noticed that numbers lower than 1e-320 or so are automatically set to 0. I do not know why.

Again, thank you so much for your help and these great packages!

Cheers, Philipp

ADD REPLY
1
Entering edit mode

At some point R will represent a small p-value with 0.

!> t.test(rnorm(1000), rnorm(1000,3))$p.value
 [1] 0
ADD REPLY
0
Entering edit mode

Just for the EnhancedVolcano part, this may very well work and is worth a try:

EnhancedVolcano(...) + ggplot2::geom_jitter()
ADD REPLY
0
Entering edit mode

Thanks for your quick response. I tried that already but I did not really understand what actually happened in the resulting plot: enter image description here

ADD REPLY
1
Entering edit mode

Ah, I see what happened there - geom_jitter() just adds a default black dot over the original geom points. You may need something like:

EnhancedVolcano(...) + ggplot2::geom_point(colour = 'white') + ggplot2::geom_jitter()

We are somewhat getting into a rabbit hole, though. If your supervisor is merely worried about aesthetics, then I would respond with this: good science and data does not have to be aesthetically pleasing.

ADD REPLY
1
Entering edit mode

haha, I will relay it to him.

ADD REPLY
0
Entering edit mode

Great, thanks a lot! I might not be able to apply that to my data though but I will give it a try.

ADD REPLY

Login before adding your answer.

Traffic: 635 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6