Skip to content

Issue with gseDO in DOSE: Error "‘organism’ is not a slot in class ‘NULL’" when using mouse data #778

Open
@dikiprawisuda

Description

@dikiprawisuda

Description

When running the gseDO function from the DOSE package with mouse data (organism = 'mmu'), I encounter the following error:

<simpleError in (function (cl, name, valueClass) ... : ‘organism’ is not a slot in class “NULL”>

According to the gseDO documentation (?gseDO), 'mmu' is a supported organism alongside 'hsa'. However, the function fails when organism = 'mmu' is used, suggesting a potential bug or issue with how the organism parameter is handled internally for mouse data.

cat("--- Minimal gseDO Test ---\n")
#> --- Minimal gseDO Test ---
library(DOSE)
#> 
#> DOSE v4.0.1 Learn more at https://yulab-smu.top/contribution-knowledge-mining/
#> 
#> Please cite:
#> 
#> Guangchuang Yu, Li-Gen Wang, Guang-Rong Yan, Qing-Yu He. DOSE: an
#> R/Bioconductor package for Disease Ontology Semantic and Enrichment
#> analysis. Bioinformatics. 2015, 31(4):608-609
library(org.Mm.eg.db)
#> Loading required package: AnnotationDbi
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> 
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:stats':
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#> 
#>     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
#>     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
#>     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
#>     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
#>     Position, rank, rbind, Reduce, rownames, sapply, saveRDS, setdiff,
#>     table, tapply, union, unique, unsplit, which.max, which.min
#> Loading required package: Biobase
#> Welcome to Bioconductor
#> 
#>     Vignettes contain introductory material; view with
#>     'browseVignettes()'. To cite Bioconductor, see
#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
#> Loading required package: IRanges
#> Loading required package: S4Vectors
#> 
#> Attaching package: 'S4Vectors'
#> The following object is masked from 'package:utils':
#> 
#>     findMatches
#> The following objects are masked from 'package:base':
#> 
#>     expand.grid, I, unname
#> 
#> Attaching package: 'IRanges'
#> The following object is masked from 'package:grDevices':
#> 
#>     windows
#> 
library(tidyverse)

# Create a fake ranked list of mouse Entrez IDs
set.seed(123)
all_mouse_genes <- keys(org.Mm.eg.db, keytype = "ENTREZID")
fake_gene_list <- rnorm(2000)
names(fake_gene_list) <- sample(all_mouse_genes, 2000)
fake_gene_list <- sort(fake_gene_list, decreasing = TRUE)

cat("Created a fake gene list with", length(fake_gene_list), "genes.\n")
#> Created a fake gene list with 2000 genes.
print(head(fake_gene_list))
#>     62146    114162 105245364 132440783 100034798 131341402 
#>  3.390371  3.290517  3.241040  3.184044  2.832226  2.816084

# Run gseDO with the correct organism
cat("\nRunning gseDO with organism = 'mm'...\n")
#> 
#> Running gseDO with organism = 'mm'...
gse_res <- NULL
tryCatch({
  gse_res <- gseDO(
    geneList = fake_gene_list,
    organism = 'mmu',
    pvalueCutoff = 1, # Be permissive to get some result
    verbose = TRUE,
    seed = TRUE
  )
}, error = function(e) {
  cat("\n--- ERROR CAUGHT ---\n")
  print(e)
})
#> using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
#> preparing geneSet collections...
#> --> Expected input gene ID: 5265,29926,54578,4000,5702,9560
#> --> No gene can be mapped....
#> 
#> --- ERROR CAUGHT ---
#> <simpleError in (function (cl, name, valueClass) {    ClassDef <- getClass(cl)    slotClass <- ClassDef@slots[[name]]    if (is.null(slotClass))         stop(gettextf("%s is not a slot in class %s", sQuote(name),             dQuote(cl)), domain = NA)    if (.identC(slotClass, valueClass))         return(TRUE)    ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass,         where = .classEnv(ClassDef)))    if (isFALSE(ok))         stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE",             dQuote(valueClass), sQuote(name), dQuote(cl), slotClass),             domain = NA)    TRUE})("NULL", "organism", "character"): 'organism' is not a slot in class "NULL">

if (!is.null(gse_res)) {
  cat("\n--- SUCCESS! ---\n")
  cat("gseDO ran successfully. Result summary:\n")
  print(head(as.data.frame(gse_res)))
} else {
  cat("\n--- gseDO failed to produce a result. ---\n")
}
#> 
#> --- gseDO failed to produce a result. ---

Created on 2025-07-02 with reprex v2.1.1

Oops, here is my sessioninfo

> sessionInfo()
R version 4.4.3 (2025-02-28 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: Asia/Tokyo
tzcode source: internal

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

other attached packages:
 [1] shiny_1.11.0         lubridate_1.9.4      forcats_1.0.0       
 [4] stringr_1.5.1        dplyr_1.1.4          purrr_1.0.4         
 [7] readr_2.1.5          tidyr_1.3.1          tibble_3.3.0        
[10] ggplot2_3.5.2        tidyverse_2.0.0      org.Mm.eg.db_3.20.0 
[13] AnnotationDbi_1.68.0 IRanges_2.40.1       S4Vectors_0.44.0    
[16] Biobase_2.66.0       BiocGenerics_0.52.0  DOSE_4.0.1          

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.1        farver_2.1.2            blob_1.2.4             
 [4] R.utils_2.13.0          Biostrings_2.74.1       fastmap_1.2.0          
 [7] promises_1.3.3          reprex_2.1.1            digest_0.6.37          
[10] mime_0.13               timechange_0.3.0        lifecycle_1.0.4        
[13] processx_3.8.6          KEGGREST_1.46.0         RSQLite_2.4.1          
[16] magrittr_2.0.3          compiler_4.4.3          sass_0.4.10            
[19] rlang_1.1.6             tools_4.4.3             yaml_2.3.10            
[22] data.table_1.17.6       knitr_1.50              bit_4.6.0              
[25] plyr_1.8.9              RColorBrewer_1.1-3      BiocParallel_1.40.2    
[28] miniUI_0.1.2            withr_3.0.2             R.oo_1.27.1            
[31] grid_4.4.3              GOSemSim_2.32.0         xtable_1.8-4           
[34] colorspace_2.1-1        GO.db_3.20.0            scales_1.4.0           
[37] dichromat_2.0-0.1       cli_3.6.5               rmarkdown_2.29         
[40] crayon_1.5.3            generics_0.1.4          rstudioapi_0.17.1      
[43] httr_1.4.7              reshape2_1.4.4          tzdb_0.5.0             
[46] DBI_1.2.3               qvalue_2.38.0           cachem_1.1.0           
[49] zlibbioc_1.52.0         splines_4.4.3           parallel_4.4.3         
[52] XVector_0.46.0          yulab.utils_0.2.0       vctrs_0.6.5            
[55] Matrix_1.7-3            jsonlite_2.0.0          callr_3.7.6            
[58] hms_1.1.3               bit64_4.6.0-1           jquerylib_0.1.4        
[61] clipr_0.8.0             glue_1.8.0              ps_1.9.1               
[64] codetools_0.2-20        cowplot_1.1.3           stringi_1.8.7          
[67] gtable_0.3.6            later_1.4.2             GenomeInfoDb_1.42.3    
[70] UCSC.utils_1.2.0        pillar_1.10.2           rappdirs_0.3.3         
[73] htmltools_0.5.8.1       fgsea_1.32.4            GenomeInfoDbData_1.2.13
[76] R6_2.6.1                evaluate_1.0.4          lattice_0.22-7         
[79] R.methodsS3_1.8.2       png_0.1-8               memoise_2.0.1          
[82] bslib_0.9.0             httpuv_1.6.16           Rcpp_1.0.14            
[85] fastmatch_1.1-6         xfun_0.52               fs_1.6.6               
[88] pkgconfig_2.0.3        

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions