foldchange is not shown in cnetplot
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:
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,
I encountered the same issue as i use the foldChange function in cnetplot during my GO analysis process. Hope to get support. Thanks.
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)