Entering edit mode
Dear all here, just wondering how to color specific node or gene symbol from cnetplot?
library(DOSE)
library(enrichplot)
library(clusterProfiler)
data(geneList)
deg <- names(geneList)[abs(geneList) > 2]
enrichment.result <- enrichDGN(deg)
edox <- setReadable(enrichment.result, "org.Hs.eg.db", "ENTREZID")
cnt_enrichment <- enrichplot::cnetplot(edox)
Now in the plot I would like to color the node or the gene symbol itself of the following MARCO, GZMB, CXCL11, CXCL10 LAG3, CCL8 as red and PDK1, GABRP, MELK and CENPE as blue.
I would appreciate it if someone could show me how to do it. Thanks ADR
@james-w-macdonald-5106, this is brilliant. Thank you so much!!
Hi, thanks a lot for you reply. I have the same issue than adR but when I applied your solution, I see the changes in term of color in the ggplot object (obj$data$color) but when I would like to print the ggplot object ("check it out" part) in the graphic devise of RStudio, I see no changes.
You might want to ensure that you are actually printing the fixed object. I don't use RStudio, so have no idea if
x11
has any effect, but if I wanted to check it, I would instanciate another graphics device and print again. Since it worked for both me and adR, my prior would be that you made a mistake somewhere. But without seeing the code you used it's all conjecture on my part.