aertslab / SCENIC

SCENIC is an R package to infer Gene Regulatory Networks and cell types from single-cell RNA-seq data.
http://scenic.aertslab.org
GNU General Public License v3.0
394 stars 94 forks source link

Error in running runSCENIC_3_scoreCells() and AUCell_buildRankings() functions. #434

Closed DiracZhu1998 closed 6 months ago

DiracZhu1998 commented 6 months ago

Dear SCENIC authors,

Thank you for bring us such a wonderful toolkit, it's very useful!

I am using SCENIC example mouse brain data to run standard SCENIC pipeline raised below error when executing runSCENIC_3_scoreCells(). I have checked inside the code of AUCell, the error was raised when I executed AUCell_buildRankings().

Error: Catched error in AUCell_buildRankings() or in the histogram plot: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE. Error in saveRDS(aucellRankings, file = getIntName(scenicOptions, "aucell_rankings")) : object 'aucellRankings' not found

The code to reproduce: loomPath <- system.file(package="SCENIC", "examples/mouseBrain_toy.loom") loom <- open_loom(loomPath) exprMat <- get_dgem(loom) cellInfo <- get_cell_annotation(loom) close_loom(loom) data(list="motifAnnotations_mgi_v9", package="RcisTarget") motifAnnotations_mgi <- motifAnnotations_mgi_v9 scenicOptions <- initializeScenic(org="mgi", dbDir="cisTarget_databases", nCores=10)

Co-expression network

genesKept <- geneFiltering(exprMat, scenicOptions) exprMat_filtered <- exprMat[genesKept, ] runCorrelation(exprMat_filtered, scenicOptions) exprMat_filtered_log <- log2(exprMat_filtered+1) runGenie3(exprMat_filtered_log, scenicOptions)

Build and score the GRN

exprMat_log <- log2(exprMat+1) scenicOptions@settings$dbs <- scenicOptions@settings$dbs["10kb"] scenicOptions <- runSCENIC_1_coexNetwork2modules(scenicOptions) scenicOptions <- runSCENIC_2_createRegulons(scenicOptions, coexMethod=c("top5perTarget")) scenicOptions <- runSCENIC_3_scoreCells(scenicOptions, exprMat_log) # error occurred.

Packages version: sessionInfo() R version 4.2.1 (2022-06-23) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS 14.1.2

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages: [1] doMC_1.3.8 iterators_1.0.14 Biobase_2.56.0 BiocGenerics_0.42.0 doRNG_1.8.6
[6] rngtools_1.5.2 foreach_1.5.2 ComplexHeatmap_2.12.1 data.table_1.14.10 ggplot2_3.4.4
[11] BiocParallel_1.30.4 KernSmooth_2.23-22 SCopeLoomR_0.13.0 RcisTarget_1.19.2 AUCell_1.18.1
[16] SCENIC_1.3.1

loaded via a namespace (and not attached): [1] Rtsne_0.17 colorspace_2.1-0 rjson_0.2.21
[4] ellipsis_0.3.2 circlize_0.4.15 XVector_0.36.0
[7] GenomicRanges_1.48.0 GlobalOptions_0.1.2 clue_0.3-65
[10] rstudioapi_0.15.0 DT_0.31 ggrepel_0.9.4
[13] bit64_4.0.5 AnnotationDbi_1.58.0 fansi_1.0.6
[16] codetools_0.2-19 R.methodsS3_1.8.2 sparseMatrixStats_1.8.0
[19] doParallel_1.0.17 cachem_1.0.8 knitr_1.45
[22] jsonlite_1.8.8 gridBase_0.4-7 annotate_1.74.0
[25] cluster_2.1.6 png_0.1-8 R.oo_1.25.0
[28] graph_1.74.0 shiny_1.8.0 BiocManager_1.30.22
[31] compiler_4.2.1 httr_1.4.7 assertthat_0.2.1
[34] Matrix_1.6-4 fastmap_1.1.1 lazyeval_0.2.2
[37] cli_3.6.2 later_1.3.2 htmltools_0.5.7
[40] tools_4.2.1 gtable_0.3.4 glue_1.6.2
[43] GenomeInfoDbData_1.2.8 reshape2_1.4.4 dplyr_1.1.4
[46] Rcpp_1.0.11 NMF_0.26 jquerylib_0.1.4
[49] vctrs_0.6.5 Biostrings_2.64.1 crosstalk_1.2.1
[52] DelayedMatrixStats_1.18.2 xfun_0.41 stringr_1.5.1
[55] mime_0.12 lifecycle_1.0.4 XML_3.99-0.16
[58] zoo_1.8-12 zlibbioc_1.42.0 scales_1.3.0
[61] promises_1.2.1 MatrixGenerics_1.8.1 SummarizedExperiment_1.26.1 [64] RColorBrewer_1.1-3 yaml_2.3.8 memoise_2.0.1
[67] sass_0.4.8 stringi_1.8.3 RSQLite_2.3.4
[70] S4Vectors_0.34.0 shape_1.4.6 GenomeInfoDb_1.32.4
[73] GENIE3_1.20.0 rlang_1.1.2 pkgconfig_2.0.3
[76] matrixStats_1.2.0 bitops_1.0-7 evaluate_0.23
[79] lattice_0.22-5 purrr_1.0.2 htmlwidgets_1.6.4
[82] bit_4.0.5 tidyselect_1.2.0 GSEABase_1.58.0
[85] plyr_1.8.9 magrittr_2.0.3 R6_2.5.1
[88] IRanges_2.30.1 generics_0.1.3 DelayedArray_0.22.0
[91] DBI_1.2.0 withr_2.5.2 pillar_1.9.0
[94] KEGGREST_1.36.3 RCurl_1.98-1.13 tibble_3.2.1
[97] crayon_1.5.2 hdf5r_1.3.8 utf8_1.2.4
[100] plotly_4.10.3 rmarkdown_2.25 GetoptLong_1.0.5
[103] blob_1.2.4 digest_0.6.33 xtable_1.8-4
[106] tidyr_1.3.0 httpuv_1.6.13 R.utils_2.12.3
[109] arrow_14.0.0.2 stats4_4.2.1 munsell_0.5.0
[112] registry_0.5-1 viridisLite_0.4.2 bslib_0.6.1

DiracZhu1998 commented 6 months ago

seems this problem related to the version of some packages, I could successfully run this function in linux system with different package version.

betaimmunologist commented 3 months ago

What versions were you able to run this with? I am having the same problem. I can't figure it out.

wangjk321 commented 3 weeks ago

Hi. In my case, downgrade matrixStats package from 1.3.0 to 1.1.0 solved this bug 👌。