Error in .testForValidKeys(x, keys, keytype, fks)
1
0
Entering edit mode
yuwt8920 • 0
@a4b4d2d3
Last seen 20 months ago
Japan

I used the data in org.Hs.eg.db and AnnotationForge to build a local OrgDb, but when I used this OrgDb to run enrichGO, I got the following error. Can anyone tell me how to resolve?

rlibrary(RSQLite)
library(org.Hs.eg.db)
library(dplyr)
library(stringr)
library(AnnotationForge)
library(tidyverse)
options(stringsAsFactors = F)

result <- select(org.Hs.eg.db, 
                  keys = keys(org.Hs.eg.db, keytype = "ENTREZID"),
                  columns = c("ENSEMBL", "GENENAME", "SYMBOL", "UNIPROT", "GO"),
                  keytype = "ENTREZID")

data <- result %>% dplyr::select(GID=ENTREZID, Gene_Name=GENENAME, Gene_Symbol=SYMBOL, 
                                 Gene_Ensembl=ENSEMBL, Gene_Uniprot=UNIPROT, GO=GO, 
                                 EVIDENCE=EVIDENCE)

gene_info <- dplyr::select(data,GID,Gene_Name) %>%
  dplyr::filter(!is.na(Gene_Name))

gene2symbol <- dplyr::select(data,GID,Gene_Symbol) %>%
  dplyr::filter(!is.na(Gene_Symbol))

gene2ensembl <- dplyr::select(data,GID,Gene_Ensembl) %>%
  dplyr::filter(!is.na(Gene_Ensembl))

gene2uniprot <- dplyr::select(data,GID,Gene_Uniprot) %>%
  dplyr::filter(!is.na(Gene_Uniprot))

gene2go <- dplyr::select(data,GID,GO,EVIDENCE) %>%
  dplyr::filter(GO!=" ",!is.na(GO)) 

# remove duplication
gene_info <- unique(gene_info)
gene2symbol <- unique(gene2symbol)
gene2ensembl <- unique(gene2ensembl)
gene2uniprot <- unique(gene2uniprot)
gene2go <- unique(gene2go)

# build
AnnotationForge::makeOrgPackage(gene_info=gene_info,
                                go=gene2go,
                                symbol=gene2symbol,
                                ensembl=gene2ensembl,
                                uniprot=gene2uniprot,
                                maintainer='xxx<xxx@fxxx.com>',
                                author='xxx',
                                version="1.0" ,
                                outputDir=getwd(), 
                                tax_id="9606",
                                genus="Homo",
                                species="sapiens",
                                goTable="go")

# Terminal run:R CMD build org.Hsapiens.eg.db

install.packages('org.Hsapiens.eg.db_1.0.tar.gz', repos = NULL)
library(org.Hsapiens.eg.db)
library(clusterProfiler)

symbolList <- c("GPX3",  "GLRX",   "LBP",   "CRYAB", "DEFB1")

eg <- bitr(symbolList, 
            fromType="SYMBOL",    
            toType=c("GID","ENSEMBL","UNIPROT"),  
            OrgDb="org.Hsapiens.eg.db") 

genelist <- eg$UNIPROT
genelist = genelist[!duplicated(genelist)] 

go <- enrichGO(genelist,
                OrgDb = org.Hsapiens.eg.db,  
                ont='ALL',             
                pAdjustMethod = 'BH',  
                pvalueCutoff = 1,      
                qvalueCutoff = 1,      
                keyType = 'UNIPROT',   
                readable = T)

head(go)

**# ERROR**
> go <- enrichGO(genelist,
+                 OrgDb = org.Hsapiens.eg.db,  
+                 ont='ALL',             
+                 pAdjustMethod = 'BH',  
+                 pvalueCutoff = 1,      
+                 qvalueCutoff = 1,      
+                 keyType = 'UNIPROT',   
+                 readable = T)
Error in .testForValidKeys(x, keys, keytype, fks) : 
  None of the keys entered are valid keys for 'GOALL'. Please use the keys method to see a listing of valid arguments.


sessionInfo( )

> sessionInfo( )
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=zh_CN.UTF-8       LC_NUMERIC=C               LC_TIME=zh_CN.UTF-8       
 [4] LC_COLLATE=zh_CN.UTF-8     LC_MONETARY=zh_CN.UTF-8    LC_MESSAGES=zh_CN.UTF-8   
 [7] LC_PAPER=zh_CN.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] Homo.sapiens_1.3.1                      TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2
 [3] OrganismDbi_1.36.0                      GenomicFeatures_1.46.5                 
 [5] GenomicRanges_1.46.1                    GenomeInfoDb_1.30.1                    
 [7] RSQLite_2.3.0                           org.Mmusculus.eg.db_1.0                
 [9] org.Mm.eg.db_3.14.0                     clusterProfiler_4.2.2                  
[11] org.Hsapiens.eg.db_1.0                  lubridate_1.9.2                        
[13] forcats_1.0.0                           purrr_1.0.1                            
[15] tidyr_1.3.0                             tibble_3.2.1                           
[17] ggplot2_3.4.2                           tidyverse_2.0.0                        
[19] AnnotationForge_1.36.0                  stringr_1.5.0                          
[21] dplyr_1.1.2                             devtools_2.4.5                         
[23] usethis_2.1.6                           ComplexHeatmap_2.10.0                  
[25] ggstatsplot_0.11.1                      limma_3.50.3                           
[27] future.apply_1.10.0                     future_1.32.0                          
[29] readxl_1.4.2                            topGO_2.46.0                           
[31] SparseM_1.81                            GO.db_3.14.0                           
[33] graph_1.72.0                            DOSE_3.20.1                            
[35] org.Hs.eg.db_3.14.0                     AnnotationDbi_1.56.2                   
[37] IRanges_2.28.0                          S4Vectors_0.32.4                       
[39] Biobase_2.54.0                          BiocGenerics_0.40.0                    
[41] readr_2.1.4                             RCurl_1.98-1.12                        

loaded via a namespace (and not attached):
  [1] estimability_1.4.1          rappdirs_0.3.3              rtracklayer_1.54.0         
  [4] coda_0.19-4                 bit64_4.0.5                 DelayedArray_0.20.0        
  [7] data.table_1.14.8           KEGGREST_1.34.0             doParallel_1.0.17          
 [10] generics_0.1.3              callr_3.7.3                 shadowtext_0.1.2           
 [13] correlation_0.8.4           bit_4.0.5                   tzdb_0.3.0                 
 [16] enrichplot_1.14.2           xml2_1.3.3                  httpuv_1.6.9               
 [19] SummarizedExperiment_1.24.0 viridis_0.6.2               hms_1.1.3                  
 [22] promises_1.2.0.1            fansi_1.0.4                 restfulr_0.0.15            
 [25] progress_1.2.2              dbplyr_2.3.2                igraph_1.4.2               
 [28] DBI_1.1.3                   htmlwidgets_1.6.2           paletteer_1.5.0            
 [31] ellipsis_0.3.2              insight_0.19.1              biomaRt_2.50.3             
 [34] MatrixGenerics_1.6.0        vctrs_0.6.1                 remotes_2.4.2              
 [37] cachem_1.0.7                withr_2.5.0                 ggforce_0.4.1              
 [40] vroom_1.6.1                 emmeans_1.8.5               GenomicAlignments_1.30.0   
 [43] treeio_1.23.1               prettyunits_1.1.1           cluster_2.1.4              
 [46] ape_5.7-1                   lazyeval_0.2.2              crayon_1.5.2               
 [49] pkgconfig_2.0.3             tweenr_2.0.2                nlme_3.1-162               
 [52] statsExpressions_1.5.0      pkgload_1.3.2               rlang_1.1.0                
 [55] globals_0.16.2              lifecycle_1.0.3             miniUI_0.1.1.1             
 [58] downloader_0.4              filelock_1.0.2              BiocFileCache_2.2.1        
 [61] cellranger_1.1.0            polyclip_1.10-4             matrixStats_0.63.0         
 [64] datawizard_0.7.1            Matrix_1.5-4                aplot_0.1.10               
 [67] GlobalOptions_0.1.2         processx_3.8.1              png_0.1-8                  
 [70] viridisLite_0.4.1           rjson_0.2.21                parameters_0.21.0          
 [73] bitops_1.0-7                Biostrings_2.62.0           blob_1.2.4                 
 [76] shape_1.4.6                 qvalue_2.26.0               parallelly_1.35.0          
 [79] gridGraphics_0.5-1          scales_1.2.1                memoise_2.0.1              
 [82] magrittr_2.0.3              plyr_1.8.8                  zlibbioc_1.40.0            
 [85] compiler_4.1.2              scatterpie_0.1.8            BiocIO_1.4.0               
 [88] RColorBrewer_1.1-3          clue_0.3-64                 Rsamtools_2.10.0           
 [91] cli_3.6.1                   XVector_0.34.0              urlchecker_1.0.1           
 [94] listenv_0.9.0               patchwork_1.1.2             ps_1.7.5                   
 [97] MASS_7.3-58.3               tidyselect_1.2.0            stringi_1.7.12             
[100] yaml_2.3.7                  GOSemSim_2.20.0             ggrepel_0.9.3              
[103] fastmatch_1.1-3             tools_4.1.2                 timechange_0.2.0           
[106] parallel_4.1.2              circlize_0.4.15             rstudioapi_0.14            
[109] foreach_1.5.2               gridExtra_2.3               farver_2.1.1               
[112] ggraph_2.1.0                digest_0.6.31               BiocManager_1.30.20        
[115] shiny_1.7.4                 Rcpp_1.0.10                 later_1.3.0                
[118] httr_1.4.5                  colorspace_2.1-0            XML_3.99-0.14              
[121] fs_1.6.1                    splines_4.1.2               yulab.utils_0.0.6          
[124] RBGL_1.70.0                 rematch2_2.1.2              tidytree_0.4.2             
[127] graphlayouts_0.8.4          ggplotify_0.1.0             sessioninfo_1.2.2          
[130] xtable_1.8-4                jsonlite_1.8.4              ggtree_3.7.2               
[133] tidygraph_1.2.3             zeallot_0.1.0               ggfun_0.0.9                
[136] R6_2.5.1                    profvis_0.3.7               pillar_1.9.0               
[139] htmltools_0.5.5             mime_0.12                   glue_1.6.2                 
[142] fastmap_1.1.1               BiocParallel_1.28.3         codetools_0.2-19           
[145] fgsea_1.20.0                pkgbuild_1.4.0              mvtnorm_1.1-3              
[148] utf8_1.2.3                  lattice_0.21-8              curl_5.0.0                 
[151] munsell_0.5.0               DO.db_2.9                   GetoptLong_1.0.5           
[154] GenomeInfoDbData_1.2.7      iterators_1.0.14            reshape2_1.4.4             
[157] gtable_0.3.3                bayestestR_0.13.1
clusterProfiler AnnotationForge • 1.9k views
ADD COMMENT
0
Entering edit mode
yuwt8920 • 0
@a4b4d2d3
Last seen 20 months ago
Japan

I have solved the problem.

ADD COMMENT

Login before adding your answer.

Traffic: 689 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6