clusterProfiler icon indicating copy to clipboard operation
clusterProfiler copied to clipboard

cnetplot() in the latest clusterProfiler, v4.14.4, does not work correctly

Open kxy2772 opened this issue 10 months ago • 6 comments

Hi, cnetplot function in clusterProfiler, v4.14.4 does not work with compareCluster results correctly. The default colors of genes (items) do not match to clusters as they are in the old version. The colors of genes are all grey. I did some tests. It seems that the issue is from the newly implemented library ggtangle.
Thanks for your help.

kxy2772 avatar Feb 20 '25 09:02 kxy2772

Can you provide a reproducible example?

GuangchuangYu avatar Mar 11 '25 07:03 GuangchuangYu

Thanks for the response.

My codes:

cmp.reac.dc <- compareCluster(geneCluster = geneID.list.dc, fun = "enrichPathway", readable=TRUE )

cnetplot(cmp.go.dc )

The old version gave this result: Image

For new version, when I made the call, I get an error:

cnetplot(cmp.go.dc ) Error in geom_cnet_label(node_label = "category") : could not find function "geom_cnet_label"

I then installed "ggtangle", and did library(ggtangle), I run cnetplot() again. It gave this:

Image

kxy2772 avatar Mar 15 '25 03:03 kxy2772

I got the same problem when running the codes in your tutorial book:

data(gcSample) str(gcSample)

ck <- compareCluster(geneCluster = gcSample, fun = enrichKEGG) ck <- setReadable(ck, OrgDb = org.Hs.eg.db, keyType="ENTREZID")

cnetplot(ck)

kxy2772 avatar Mar 15 '25 04:03 kxy2772

I too faced the same issue.

After installing ggtangle package it started to work

thanks to @kxy2772

abhilashdasari avatar Mar 28 '25 16:03 abhilashdasari

I too faced the same issue.

After installing ggtangle package it started to work

thanks to @kxy2772

Thanks. Yes, after installing ggtangle, the program works for me too. The problem was the colors of the nodes were not correct for data from compareCluster(), They suppose to be a color or a mixture of colors depending on what categories the genes belong to. Now the colors of the nodes are all grey.

kxy2772 avatar Apr 02 '25 23:04 kxy2772

I too faced the same issue. After installing ggtangle package it started to work thanks to @kxy2772

Thanks. Yes, after installing ggtangle, the program works for me too. The problem was the colors of the nodes were not correct for data from compareCluster(), They suppose to be a color or a mixture of colors depending on what categories the genes belong to. Now the colors of the nodes are all grey.

You are correct; any solution for the node's color problem? or do we need to wait for the next update from @GuangchuangYu ?

abhilashdasari avatar Apr 09 '25 08:04 abhilashdasari