YuLab-SMU / clusterProfiler

:bar_chart: A universal enrichment tool for interpreting omics data
https://yulab-smu.top/biomedical-knowledge-mining-book/
1k stars 253 forks source link

"No gene can be mapped" even with your own example #579

Open jdenavascues opened 1 year ago

jdenavascues commented 1 year ago

--> No gene can be mapped....

Hi,

I have tried to look for solutions for this in SO, biostars, bioconductor, your html manual, the PDF vignette, and your GitHub issues... nothing has worked, so here I am.

I want to use gseKEGG and enrichKEGG with Drosophila melanogaster differentially expressed genes, but I keep getting the error.

Probably the best minimal reproducible examples are from your online book/manual:

library(clusterProfiler)
geneList, package="DOSE")
gene <- names(geneList)[abs(geneList) > 2]
kk <- enrichKEGG(gene         = gene,
                 organism     = 'hsa',
                 pvalueCutoff = 0.05)
head(kk)

Reading KEGG annotation online: Reading KEGG annotation online: --> No gene can be mapped.... --> Expected input gene ID: --> return NULL...

kk2 <- gseKEGG(geneList     = geneList,
               organism     = 'hsa',
               minGSSize    = 120,
               pvalueCutoff = 0.05,
               verbose      = FALSE)
head(kk2)

Reading KEGG annotation online: Reading KEGG annotation online: --> No gene can be mapped.... --> Expected input gene ID: --> return NULL...

Things I have tried

(minimal example with _Drosophilagenes)

# dummy data
df <- data.frame(gene_symbol = c("nAChRalpha2", "Act42A", "Ama", "ase", "asp", "Col4a1"),
                     ensemblGeneID = c("FBgn0000039", "FBgn0000043", "FBgn0000071", "FBgn0000137", "FBgn0000140", "FBgn0000299"),
                     log2FoldChange = c(-2.235647, -1.672559, -2.975020, -3.340225, -1.915317, -4.276045))

# to get the ncbi-geneid keys for each gene
ensembl <- useEnsembl(biomart = "ENSEMBL_MART_ENSEMBL",
                     dataset="dmelanogaster_gene_ensembl",
                     host = "https://oct2022.archive.ensembl.org")
attributes <- listAttributes(ensembl)
ezlist <- getBM(attributes=c('entrezgene_id', 'ensembl_gene_id', 'external_gene_name'), mart = ensembl)

# get the NCBI gene IDs for the fly genes
df$`ncbi-geneid` <- ezlist %>%
  filter(ensembl_gene_id %in% df$ensemblGeneID) %>%
  dplyr::select(entrezgene_id) %>% unlist()

# try clusterProfiler KEGG tools
## (I have tried without as.character or as.list too)
kg <- enrichKEGG(gene         = as.list(as.character(df$`ncbi-geneid`)),
                 organism     = 'dme',
                 pvalueCutoff = 0.05)

--> No gene can be mapped.... --> Expected input gene ID: --> return NULL...

(note that this time it does no display "Reading KEGG annotation online:" ¯_(ツ)_/¯ )

I have checked directly that the annotations for my genes actually exist in the KEGG database:

# download the Drosophila KEGG keys versus NCBI gene IDs:
## (I got here inspecting your R code)
kegconv <- read.csv('https://rest.kegg.jp/conv/ncbi-geneid/dme/', sep = '\t', header = FALSE)
kegconv <- kegconv %>%
  dplyr::rename(dme = V1, geneid = V2) %>%
  mutate(dme = str_replace(dme, "dme:", ""),
         geneid = str_replace(geneid, "ncbi-geneid:", ""))

# get the KEGG keys for my genes:
df$`kegg` <- kegconv %>%
  filter(geneid %in% df$`ncbi-geneid`) %>%
  dplyr::select(dme) %>% unlist()

# try clusterProfiler KEGG tools:
## (I have tried without as.list too)
kg2 <- enrichKEGG(gene         = as.list(df$kegg),
                 organism     = 'dme',
                 pvalueCutoff = 0.05)

All with with the same non-result. I am at my wits' end and I am no longer sure whether this is a problem with my code or an issue with yours or the KEGG API - that is why I am raising it here (as not even your example code in a clean session works for me).

I hope this is a real problem and not a silly mistake on my part, but I would be very grateful if you could suggest anything to make it work.

partrita commented 1 year ago

I've got same problem.

jdenavascues commented 1 year ago

Could this have to do with the recent (minor) change in the KEGG API ? https://www.kegg.jp/kegg/rest/

I have also tried to do GSEA of KEGG pathways using other packages (gage) and I also run into trouble.

partrita commented 1 year ago

Could this have to do with the recent (minor) change in the KEGG API ? https://www.kegg.jp/kegg/rest/

I have also tried to do GSEA of KEGG pathways using other packages (gage) and I also run into trouble.

There is no changed any API syntax documents of KEGG. I fixed with updating clusterProfiler to 4.7 from 4.6. Hope this will help.

This is my session info.

R version 4.2.2 (2022-10-31)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS/LAPACK: /home/fkt/mambaforge/envs/scRNA/lib/libopenblasp-r0.3.21.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=ko_KR.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=ko_KR.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=ko_KR.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=ko_KR.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] clusterProfiler_4.7.1.003 EnhancedVolcano_1.16.0   
 [3] ggrepel_0.9.3             ggpubr_0.6.0             
 [5] enrichplot_1.18.4         msigdbr_7.5.1            
 [7] org.Mm.eg.db_3.16.0       AnnotationDbi_1.60.2     
 [9] IRanges_2.32.0            S4Vectors_0.36.2         
[11] Biobase_2.58.0            BiocGenerics_0.44.0      
[13] future_1.31.0             forcats_1.0.0            
[15] stringr_1.5.0             dplyr_1.1.2              
[17] purrr_1.0.1               readr_2.1.4              
[19] tidyr_1.3.0               tibble_3.2.1             
[21] ggplot2_3.4.2             tidyverse_1.3.2          
[23] SeuratObject_4.1.3        Seurat_4.3.0             
huerqiang commented 1 year ago

Please use the latest version of clusterProfiler.

gloriafight commented 1 year ago

Please use the latest version of clusterProfiler.

Hi, I also faced this problem. This version is "4.9.0".

ek <- enrichKEGG(gene = eg$ENTREZID, organism = "hsa", #人 pvalueCutoff =1, qvalueCutoff = 1, keyType = "ncbi-geneid") --> No gene can be mapped.... --> Expected input gene ID: --> return NULL...

gloriafight commented 1 year ago

I solved my problem. https://github.com/YuLab-SMU/clusterProfiler/issues/561#issuecomment-1467266614

eternalzq007 commented 1 year ago

Please use the latest version of clusterProfiler.

Hi, I've got same problem. And I use the latest version of clusterProfiler and I've tried this method(https://github.com/YuLab-SMU/clusterProfiler/issues/561#issuecomment-1467266614), but still show "No gene can be mapped". Hope you can help me to figure it out, thanks!

And this is my session info. ─ Session info ──────────────────────────────────────────────────────────────────── setting value version R version 4.3.0 (2023-04-21 ucrt) os Windows 10 x64 (build 19044) system x86_64, mingw32 ui RStudio language (EN) collate Chinese (Simplified)_China.utf8 ctype Chinese (Simplified)_China.utf8 tz Asia/Shanghai date 2023-06-09 rstudio 2023.03.1+446 Cherry Blossom (desktop) pandoc NA

─ Packages ──────────────────────────────────────────────────────────────────────── package version date (UTC) lib source AnnotationDbi 1.62.1 2023-05-02 [1] Bioconductor ape 5.7-1 2023-03-13 [1] CRAN (R 4.3.0) aplot 0.1.10 2023-03-08 [1] CRAN (R 4.3.0) Biobase 2.60.0 2023-04-25 [1] Bioconductor BiocGenerics 0.46.0 2023-04-25 [1] Bioconductor BiocManager 1.30.20 2023-02-24 [1] CRAN (R 4.3.0) BiocParallel 1.34.1 2023-05-05 [1] Bioconductor Biostrings 2.68.1 2023-05-16 [1] Bioconductor bit 4.0.5 2022-11-15 [1] CRAN (R 4.3.0) bit64 4.0.5 2020-08-30 [1] CRAN (R 4.3.0) bitops 1.0-7 2021-04-24 [1] CRAN (R 4.3.0) blob 1.2.4 2023-03-17 [1] CRAN (R 4.3.0) cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0) callr 3.7.3 2022-11-02 [1] CRAN (R 4.3.0) cli 3.6.1 2023-03-23 [1] CRAN (R 4.3.0) clusterProfiler 4.9.0.002 2023-05-22 [1] Github (https://github.com/YuLab-SMU/clusterProfiler/commit/abbaf1e) codetools 0.2-19 2023-02-01 [2] CRAN (R 4.3.0) colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.0) cowplot 1.1.1 2020-12-30 [1] CRAN (R 4.3.0) crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0) createKEGGdb 0.0.3 2023-05-22 [1] Github (https://github.com/YuLab-SMU/createKEGGdb/commit/c7f6308) curl 5.0.0 2023-01-12 [1] CRAN (R 4.3.0) data.table 1.14.8 2023-02-17 [1] CRAN (R 4.3.0) DBI 1.1.3 2022-06-18 [1] CRAN (R 4.3.0) DelayedArray 0.26.3 2023-05-22 [1] Bioconductor DESeq2 1.40.1 2023-05-02 [1] Bioconductor devtools 2.4.5 2022-10-11 [1] CRAN (R 4.3.0) digest 0.6.31 2022-12-11 [1] CRAN (R 4.3.0) DOSE 3.26.1 2023-05-03 [1] Bioconductor downloader 0.4 2015-07-09 [1] CRAN (R 4.3.0) dplyr 1.1.2 2023-04-20 [1] CRAN (R 4.3.0) ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.0) enrichplot 1.20.0 2023-04-25 [1] Bioconductor fansi 1.0.4 2023-01-22 [1] CRAN (R 4.3.0) farver 2.1.1 2022-07-06 [1] CRAN (R 4.3.0) fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) fastmatch 1.1-3 2021-07-23 [1] CRAN (R 4.3.0) fgsea 1.26.0 2023-04-25 [1] Bioconductor fs 1.6.2 2023-04-25 [1] CRAN (R 4.3.0) generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0) GenomeInfoDb 1.36.0 2023-04-25 [1] Bioconductor GenomeInfoDbData 1.2.10 2023-05-22 [1] Bioconductor GenomicRanges 1.52.0 2023-04-25 [1] Bioconductor ggforce 0.4.1 2022-10-04 [1] CRAN (R 4.3.0) ggfun 0.0.9 2022-11-21 [1] CRAN (R 4.3.0) ggplot2 3.4.2 2023-04-03 [1] CRAN (R 4.3.0) ggplotify 0.1.0 2021-09-02 [1] CRAN (R 4.3.0) ggraph 2.1.0 2022-10-09 [1] CRAN (R 4.3.0) ggrepel 0.9.3 2023-02-03 [1] CRAN (R 4.3.0) ggtree 3.8.0 2023-04-25 [1] Bioconductor glue 1.6.2 2022-02-24 [1] CRAN (R 4.3.0) GO.db 3.17.0 2023-05-22 [1] Bioconductor GOSemSim 2.26.0 2023-04-25 [1] Bioconductor graphlayouts 1.0.0 2023-05-01 [1] CRAN (R 4.3.0) gridExtra 2.3 2017-09-09 [1] CRAN (R 4.3.0) gridGraphics 0.5-1 2020-12-13 [1] CRAN (R 4.3.0) gson 0.1.0 2023-03-07 [1] CRAN (R 4.3.0) gtable 0.3.3 2023-03-21 [1] CRAN (R 4.3.0) HDO.db 0.99.1 2023-05-22 [1] Bioconductor htmltools 0.5.5 2023-03-23 [1] CRAN (R 4.3.0) htmlwidgets 1.6.2 2023-03-17 [1] CRAN (R 4.3.0) httpuv 1.6.11 2023-05-11 [1] CRAN (R 4.3.0) httr 1.4.6 2023-05-08 [1] CRAN (R 4.3.0) igraph 1.4.2 2023-04-07 [1] CRAN (R 4.3.0) IRanges 2.34.0 2023-04-25 [1] Bioconductor jsonlite 1.8.4 2022-12-06 [1] CRAN (R 4.3.0) KEGG.db 1.0 2023-05-22 [1] Bioconductor KEGGREST 1.40.0 2023-04-25 [1] Bioconductor later 1.3.1 2023-05-02 [1] CRAN (R 4.3.0) lattice 0.21-8 2023-04-05 [2] CRAN (R 4.3.0) lazyeval 0.2.2 2019-03-15 [1] CRAN (R 4.3.0) lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.3.0) locfit 1.5-9.7 2023-01-02 [1] CRAN (R 4.3.0) magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) MASS 7.3-58.4 2023-03-07 [2] CRAN (R 4.3.0) Matrix 1.5-4 2023-04-04 [2] CRAN (R 4.3.0) MatrixGenerics 1.12.0 2023-04-25 [1] Bioconductor matrixStats 0.63.0 2022-11-18 [1] CRAN (R 4.3.0) memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0) mime 0.12 2021-09-28 [1] CRAN (R 4.3.0) miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.3.0) munsell 0.5.0 2018-06-12 [1] CRAN (R 4.3.0) nlme 3.1-162 2023-01-31 [2] CRAN (R 4.3.0) org.Dm.eg.db 3.17.0 2023-05-22 [1] Bioconductor patchwork 1.1.2 2022-08-19 [1] CRAN (R 4.3.0) pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0) pkgbuild 1.4.0 2022-11-27 [1] CRAN (R 4.3.0) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0) pkgload 1.3.2 2022-11-16 [1] CRAN (R 4.3.0) plyr 1.8.8 2022-11-11 [1] CRAN (R 4.3.0) png 0.1-8 2022-11-29 [1] CRAN (R 4.3.0) polyclip 1.10-4 2022-10-20 [1] CRAN (R 4.3.0) prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.3.0) processx 3.8.1 2023-04-18 [1] CRAN (R 4.3.0) profvis 0.3.8 2023-05-02 [1] CRAN (R 4.3.0) promises 1.2.0.1 2021-02-11 [1] CRAN (R 4.3.0) ps 1.7.5 2023-04-18 [1] CRAN (R 4.3.0) purrr 1.0.1 2023-01-10 [1] CRAN (R 4.3.0) qvalue 2.32.0 2023-04-25 [1] Bioconductor R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0) RColorBrewer 1.1-3 2022-04-03 [1] CRAN (R 4.3.0) Rcpp 1.0.10 2023-01-22 [1] CRAN (R 4.3.0) RCurl 1.98-1.12 2023-03-27 [1] CRAN (R 4.3.0) remotes 2.4.2 2021-11-30 [1] CRAN (R 4.3.0) reshape2 1.4.4 2020-04-09 [1] CRAN (R 4.3.0) rlang 1.1.1 2023-04-28 [1] CRAN (R 4.3.0) RSQLite 2.3.1 2023-04-03 [1] CRAN (R 4.3.0) rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.3.0) S4Arrays 1.0.4 2023-05-14 [1] Bioconductor S4Vectors 0.38.1 2023-05-02 [1] Bioconductor scales 1.2.1 2022-08-20 [1] CRAN (R 4.3.0) scatterpie 0.1.9 2023-04-22 [1] CRAN (R 4.3.0) sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0) shadowtext 0.1.2 2022-04-22 [1] CRAN (R 4.3.0) shiny 1.7.4 2022-12-15 [1] CRAN (R 4.3.0) stringi 1.7.12 2023-01-11 [1] CRAN (R 4.3.0) stringr 1.5.0 2022-12-02 [1] CRAN (R 4.3.0) SummarizedExperiment 1.30.1 2023-05-01 [1] Bioconductor tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0) tidygraph 1.2.3 2023-02-01 [1] CRAN (R 4.3.0) tidyr 1.3.0 2023-01-24 [1] CRAN (R 4.3.0) tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0) tidytree 0.4.2 2022-12-18 [1] CRAN (R 4.3.0) treeio 1.24.0 2023-04-25 [1] Bioconductor tweenr 2.0.2 2022-09-06 [1] CRAN (R 4.3.0) urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.3.0) usethis 2.1.6 2022-05-25 [1] CRAN (R 4.3.0) utf8 1.2.3 2023-01-31 [1] CRAN (R 4.3.0) vctrs 0.6.2 2023-04-19 [1] CRAN (R 4.3.0) viridis 0.6.3 2023-05-03 [1] CRAN (R 4.3.0) viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.3.0) withr 2.5.0 2022-03-03 [1] CRAN (R 4.3.0) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.0) XVector 0.40.0 2023-04-25 [1] Bioconductor yulab.utils 0.0.6 2022-12-20 [1] CRAN (R 4.3.0) zlibbioc 1.46.0 2023-04-25 [1] Bioconductor

[1] C:/Users/61726/AppData/Local/R/win-library/4.3 [2] C:/Program Files/R/R-4.3.0/library

Z-Zen commented 1 year ago

Hello,

I am having the same issue as the people above. Is there any timeline available for when will it be fixed, please?

Thank you

njausxl commented 1 year ago

软件是好软件,安装是真难安装,富集也是出各种问题,为了装这个一个软件,重新安装R版本,将所有包重新装,结果还是不行。

难道真的不知道这个问题一直存在吗,难道只会微信宣传自己的人设,努力卖书?

好几年了,一直没有明确的解决方案,有问题不解决,无话可说。

祝好!

huerqiang commented 1 year ago

我个人觉得要想使用好一个软件,善于使用搜索引擎是个必备的技能。尤其是已经被作者明确回答的问题。