cnetplot with enrichKEGG results
Entering edit mode
Last seen 25 days ago

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:

## 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!

clusterProfiler enrichKEGG cnetplot • 185 views
Entering edit mode

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....!

> data(geneList, package='DOSE')
> de2 <- names(geneList)[1:2]
> yy2 <- enrichKEGG(de2)
> cnetplot(yy2)

... 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).

> de1 <- names(geneList)[1]
> yy1 <- enrichKEGG(de1)
> cnetplot(yy1)
Error in UseMethod("rescale") : 
  no applicable method for 'rescale' applied to an object of class "AsIs"
Entering edit mode

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!!


Login before adding your answer.

Traffic: 405 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6