How to generate circular cnetplot and color nodes and edges in the same plot ?
1
0
Entering edit mode
Blandine • 0
@f7de3201
Last seen 15 hours ago
Canada

Hi everyone, I am looking for generate a circular cnetplot like the c plot enter image description here

But the only thing I am able to generate are the a and b plots. It's like the "circular" isn't working, and I am not able to generate the categorie legend and the color of the edge either. I am able to put colors on the nodes with foldchange though, What I am missing ? Thank you so much for your help ! Here is my code.

````` go_enrichment <- enrichGO( gene = common_genes, OrgDb = org.Hs.eg.db, keyType = "ENTREZID", ont = "BP", pvalueCutoff = 0.05, readable = TRUE )

color.params <- list(foldChange = foldChange) # Specify fold-change for coloring

p <- cnetplot( go_enrichment, showCategory = 10,
circular = TRUE,
colorEdge = TRUE,
color.params = color.params,
cex.params = cex.params
)

sessionInfo( )

```

cnetplot DESeq2 • 79 views
ADD COMMENT
0
Entering edit mode
Guido Hooiveld ★ 4.1k
@guido-hooiveld-2020
Last seen 6 hours ago
Wageningen University, Wageningen, the …

Since the release of enrichplot of October 2024, the code of the function cnetplot has been completely rewritten by Guangchuang in order to allow more customization of the plots. See for example here. Apparently not all of the (online) documentation do reflect these changes yet.

The code to generate such circular cnetplot is now:

> library(clusterProfiler)
> library(enrichplot)
> 
> data(geneList, package = "DOSE")
> de <- names(geneList)[1:100]
> yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01)
> 
> yy <- setReadable(yy, 'org.Hs.eg.db', 'ENTREZID')
> 
> 
> p <- cnetplot(yy,
+               igraph::layout_in_circle,
+               color_edge = 'category',
+               showCategory = 4,
+               foldChange = geneList)
> 
> print(p)
> 
> packageVersion("enrichplot")
[1] '1.26.6'

enter image description here

ADD COMMENT

Login before adding your answer.

Traffic: 1014 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