YuLab-SMU / DOSE

:mask: Disease Ontology Semantic and Enrichment analysis
https://yulab-smu.top/biomedical-knowledge-mining-book/
116 stars 36 forks source link

`Error in get("DOLite2EG") : object 'DOLite2EG' not found` when re-run `enrichDO` #85

Open zxy0912 opened 2 months ago

zxy0912 commented 2 months ago

conduct the DO analysis with DOSE::enrichDO(), problem with loading DOLite dataset.

library(clusterProfiler)
library(org.Hs.eg.db)
library(enrichplot)
library(GOSemSim)

library(DOSE)

runDO <- function(gene_set,  maxGSSize = 500) {
  eg <- bitr(gene_set,
             fromType = "SYMBOL", 
             toType = "ENTREZID", 
             OrgDb = "org.Hs.eg.db")

  edo_res <- enrichDO(gene = eg$ENTREZID,
                      # OrgDb =org.Hs.eg.db,
                      ont = "DOLite",
                      pAdjustMethod = "BH",
                      minGSSize = 10,
                      maxGSSize = maxGSSize,
                      pvalueCutoff = 1,
                      qvalueCutoff = 0.2,
                      readable = TRUE)
  return(edo_res)
}

first time is OK

> edo_res <- runDO(genelist)
'select()' returned 1:1 mapping between keys and columns

failed when re-run the function

> edo_res <- runDO(genelist)
'select()' returned 1:1 mapping between keys and columns
Error in get("DOLite2EG") : object 'DOLite2EG' not found

This issue can be fixed after reloading the DOSE package.

> detach("package:DOSE")
> library(DOSE)
GuangchuangYu commented 2 months ago

DOLite was removed in the current version.