Entering edit mode
Hello! I'm trying to use cnetplot
function with a KEGG enrichment object obtained from enrichKEGG
function. However, I get the same error and I don't know how to solve it. I'm using clusterProfiler
package to perform this analysis.
I provide the code to reproduce the data:
# KEGG enrichment of two specific genes:
aa = enrichKEGG(c(5104, 94025))
# plot the results with cnetplot:
cnetplot(aa)
## Error in UseMethod("rescale") :
## no applicable method for 'rescale' applied to an object of class "AsIs"
sessionInfo( )
## R version 4.1.1 (2021-08-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur 11.6
Thanks in advance!
Mmm, to be honest, using only 2 genes for KEGG overrepresentation analysis does not really make sense to me.... but I think the error is due to the fact that only 1 of your 2 input genes is mapped to a KEGG pathway, and therefore scaling of expression values is not possible. (FYI only gene
5104
is annotated in the KEGG database).If you have at least 2 genes that are mapped, it works....!
... but if only a single gene is mapped, it doesn't work! I got the same error as you got, that implies that scaling didn't work (which indeed is not possible with only 1 gene).
Thank you so much! It's true it doesn't make sense to perform an enrichment with only two genes, but since I want to develop a pipeline for my lab, I want to overcome all possible cases.
Thanks again!!