enrichplot icon indicating copy to clipboard operation
enrichplot copied to clipboard

foldchange is not shown in cnetplot

Open sitr1014 opened this issue 4 years ago • 2 comments

Hi,

I am trying to use the very basic function of "cnetplot" to show enriched pathways and the corresponding gene expression changes within the enriched pathway. I am doing this under the clusterprofiler 4.0. My starting input data(name is magenta2_cluster) is a data frame like this: Screen Shot 2021-07-21 at 4 56 45 PM My code is magenta2_KEGG=enrichKEGG(gene=magenta2_cluster$ENTREZID, organism = "mmu", pvalueCutoff = 0.01, qvalueCutoff = 0.05) magenta2_KEGG_x=setReadable(magenta2_KEGG, 'org.Mm.eg.db', 'ENTREZID') p2=cnetplot(magenta2_KEGG_x,foldChange = magenta2_cluster$F)

But the p2 plot didn't show any color to represent the expression changes of the gene node, any thought? ps: I know a lot of genes have a fold change of 0 but I have checked for specific genes which do has a fold change like 20 and it still has no color.

Many thanks,

sitr1014 avatar Jul 21 '21 21:07 sitr1014

I encountered the same issue as i use the foldChange function in cnetplot during my GO analysis process. Hope to get support. Thanks.

gogozyz avatar Sep 23 '21 05:09 gogozyz

Please forgive me if I am mistaken, but I believe that the foldChange takes a named vector as input with values as magenta2_cluster$logFC ( or F, if that is what you'd like to color by) in your example and names as magenta2_cluster$ENTREZID, and then sort(YourNamedVector, decreasing = TRUE). I was having issues with this, but worked once I used the sorted named vector as the input. Hope this helps! (I'm using version 1.12.3 of enrichplot)

clstacy avatar Feb 03 '22 17:02 clstacy