YuLab-SMU / clusterProfiler

:bar_chart: A universal enrichment tool for interpreting omics data
https://yulab-smu.top/biomedical-knowledge-mining-book/
1.02k stars 256 forks source link

I want to change cnetplot foldchange scale #199

Open eileen316 opened 5 years ago

eileen316 commented 5 years ago

image

In cnetplot, I want to change foldchange scale. please give an advise~

image

Chuan-Jiang commented 5 years ago

I am in the same situation, Waiting the solutions.

yjhongHK commented 4 years ago

I have the same problem. Waiting for the advice~

sagarutturkar commented 3 years ago

I am in the same situation. I am performing comparative analysis and showing two cnet plots, these looks very nice side-by-side with two different treatments, but when I am comparing foldchange values, the different scale makes is so annoying. Also, reviewer did not like the different scale. It would be great to add min/max scale limits. Please advice.

sagarutturkar commented 3 years ago

Never mind! I was able to achieve this using ggplot features. Hope the code below will help others:

library(RColorBrewer)

RYD  = brewer.pal(n = 8, name = "RdYlBu")

cnetplot(GO.BP, showCategory = Go_select, colorEdge = TRUE, foldChange=log2fc__vec) + 
  scale_colour_gradientn(colours = RYD, limits=c(-6, 6))
  ggtitle("Condition A") +
  theme(plot.title = element_text(size = 20, face = "bold", hjust = 0.5))