clusterProfiler icon indicating copy to clipboard operation
clusterProfiler copied to clipboard

Why doesn’t enrichKEGG() support the readable = TRUE parameter like enrichGO()?

Open Wang-Ande opened this issue 7 months ago • 2 comments

The function enrichKEGG() does not seem to support the readable = TRUE/FALSE parameter, unlike enrichGO(). However, the resulting S4 object returned by enrichKEGG() still contains a logical slot named "readable".

Image

Is this an intentional design choice, or is there a way to enable gene ID to gene symbol conversion in enrichKEGG() results, similar to what enrichGO(readable = TRUE) provides?

Wang-Ande avatar Jul 22 '25 08:07 Wang-Ande

Yes, that is correct. I don't know whether Guangchuang did this intentionally, or not.

Anyway, applying the function setReadable() to the results obtained through enrichKEGG() will do this conversion as well. The readable 'slot' will then also be set to TRUE.

> library(clusterProfiler)
> 
> data(geneList, package='DOSE')
> de <- names(geneList)[1:200]
> 
> xx <- enrichKEGG(de, pvalueCutoff=0.01)
Reading KEGG annotation online: "https://rest.kegg.jp/link/hsa/pathway"...
Reading KEGG annotation online: "https://rest.kegg.jp/list/pathway/hsa"...
> head(xx)
                                     category
hsa04110                   Cellular Processes
hsa04657                   Organismal Systems
hsa04218                   Cellular Processes
hsa04061 Environmental Information Processing
hsa04114                   Cellular Processes
hsa04914                   Organismal Systems
                                 subcategory       ID
hsa04110               Cell growth and death hsa04110
hsa04657                       Immune system hsa04657
hsa04218               Cell growth and death hsa04218
hsa04061 Signaling molecules and interaction hsa04061
hsa04114               Cell growth and death hsa04114
hsa04914                    Endocrine system hsa04914
                                                           Description
hsa04110                                                    Cell cycle
hsa04657                                       IL-17 signaling pathway
hsa04218                                           Cellular senescence
hsa04061 Viral protein interaction with cytokine and cytokine receptor
hsa04114                                                Oocyte meiosis
hsa04914                       Progesterone-mediated oocyte maturation
         GeneRatio  BgRatio RichFactor FoldEnrichment    zScore       pvalue
hsa04110    21/113 158/9434 0.13291139      11.096337 14.091100 1.240312e-16
hsa04657    10/113  95/9434 0.10526316       8.788076  8.399911 1.752488e-07
hsa04218    11/113 157/9434 0.07006369       5.849388  6.746304 2.577890e-06
hsa04061     9/113 100/9434 0.09000000       7.513805  7.209975 2.819340e-06
hsa04114    10/113 139/9434 0.07194245       6.006239  6.546772 5.952070e-06
hsa04914     8/113 111/9434 0.07207207       6.017061  5.854178 5.235706e-05
             p.adjust       qvalue
hsa04110 2.356593e-14 2.167282e-14
hsa04657 1.664863e-05 1.531121e-05
hsa04218 1.339186e-04 1.231606e-04
hsa04061 1.339186e-04 1.231606e-04
hsa04114 2.261787e-04 2.080092e-04
hsa04914 1.657974e-03 1.524785e-03
                                                                                                      geneID
hsa04110 8318/991/9133/10403/890/983/4085/81620/7272/9212/1111/9319/891/4174/9232/4171/993/990/5347/701/9700
hsa04657                                                   4312/6280/6279/6278/3627/2921/6364/8061/4318/3576
hsa04218                                                 2305/4605/9133/890/983/51806/1111/891/993/3576/1978
hsa04061                                                       3627/10563/6373/4283/6362/6355/2921/6364/3576
hsa04114                                                     991/9133/983/4085/51806/6790/891/9232/5347/9700
hsa04914                                                                 9133/890/983/4085/6790/891/993/5347
         Count
hsa04110    21
hsa04657    10
hsa04218    11
hsa04061     9
hsa04114    10
hsa04914     8
> 
> yy <- setReadable(xx, OrgDb='org.Hs.eg.db', keyType='ENTREZID')

> head(yy)
                                     category
hsa04110                   Cellular Processes
hsa04657                   Organismal Systems
hsa04218                   Cellular Processes
hsa04061 Environmental Information Processing
hsa04114                   Cellular Processes
hsa04914                   Organismal Systems
                                 subcategory       ID
hsa04110               Cell growth and death hsa04110
hsa04657                       Immune system hsa04657
hsa04218               Cell growth and death hsa04218
hsa04061 Signaling molecules and interaction hsa04061
hsa04114               Cell growth and death hsa04114
hsa04914                    Endocrine system hsa04914
                                                           Description
hsa04110                                                    Cell cycle
hsa04657                                       IL-17 signaling pathway
hsa04218                                           Cellular senescence
hsa04061 Viral protein interaction with cytokine and cytokine receptor
hsa04114                                                Oocyte meiosis
hsa04914                       Progesterone-mediated oocyte maturation
         GeneRatio  BgRatio RichFactor FoldEnrichment    zScore       pvalue
hsa04110    21/113 158/9434 0.13291139      11.096337 14.091100 1.240312e-16
hsa04657    10/113  95/9434 0.10526316       8.788076  8.399911 1.752488e-07
hsa04218    11/113 157/9434 0.07006369       5.849388  6.746304 2.577890e-06
hsa04061     9/113 100/9434 0.09000000       7.513805  7.209975 2.819340e-06
hsa04114    10/113 139/9434 0.07194245       6.006239  6.546772 5.952070e-06
hsa04914     8/113 111/9434 0.07207207       6.017061  5.854178 5.235706e-05
             p.adjust       qvalue
hsa04110 2.356593e-14 2.167282e-14
hsa04657 1.664863e-05 1.531121e-05
hsa04218 1.339186e-04 1.231606e-04
hsa04061 1.339186e-04 1.231606e-04
hsa04114 2.261787e-04 2.080092e-04
hsa04914 1.657974e-03 1.524785e-03
                                                                                                                           geneID
hsa04110 CDC45/CDC20/CCNB2/NDC80/CCNA2/CDK1/MAD2L1/CDT1/TTK/AURKB/CHEK1/TRIP13/CCNB1/MCM5/PTTG1/MCM2/CDC25A/CDC6/PLK1/BUB1B/ESPL1
hsa04657                                                            MMP1/S100A9/S100A8/S100A7/CXCL10/CXCL3/CCL20/FOSL1/MMP9/CXCL8
hsa04218                                                    FOXM1/MYBL2/CCNB2/CCNA2/CDK1/CALML5/CHEK1/CCNB1/CDC25A/CXCL8/EIF4EBP1
hsa04061                                                                  CXCL10/CXCL13/CXCL11/CXCL9/CCL18/CCL8/CXCL3/CCL20/CXCL8
hsa04114                                                              CDC20/CCNB2/CDK1/MAD2L1/CALML5/AURKA/CCNB1/PTTG1/PLK1/ESPL1
hsa04914                                                                          CCNB2/CCNA2/CDK1/MAD2L1/AURKA/CCNB1/CDC25A/PLK1
         Count
hsa04110    21
hsa04657    10
hsa04218    11
hsa04061     9
hsa04114    10
hsa04914     8
> 
> 

guidohooiveld avatar Jul 22 '25 13:07 guidohooiveld

Thanks for your response! Yes, I'm aware of the setReadable() function and have used it before — it works well.

I was just curious why enrichKEGG() doesn't support the readable parameter directly, like enrichGO() does. I'm wondering whether this is a design decision or just hasn't been implemented yet.

Wang-Ande avatar Jul 22 '25 13:07 Wang-Ande