carmonalab / GeneNMF

Methods to discover gene programs on single-cell data
84 stars 3 forks source link

Error in `fn()`: ! Cannot add new cells with [[<- #14

Open boluofen opened 1 month ago

boluofen commented 1 month ago

Hello, my code run into this issue, can you give me some advice to solve this? geneNMF.programs<-multiNMF(sce,assay="RNA",slot="data",

mass-a commented 1 month ago

Hi, can you add more info? does this happen on the test dataset, or on your own data? what is your sessioninfo()? Also, you may check if it is related to https://github.com/satijalab/seurat/issues/8407

boluofen commented 1 month ago

It is my own data , a 10814 cells seurat sessionInfo() R version 4.3.1 (2023-06-16) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 20.04.6 LTS

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

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

time zone: Asia/Shanghai tzcode source: system (glibc)

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

other attached packages: [1] fgsea_1.26.0 msigdbr_7.5.1 GeneNMF_0.6.0 tidydr_0.0.5
[5] edgeR_3.42.4 limma_3.56.2 DESeq2_1.40.2 SummarizedExperiment_1.30.2 [9] MatrixGenerics_1.12.3 matrixStats_1.4.1 GenomicRanges_1.52.1 GenomeInfoDb_1.36.4
[13] future_1.34.0 COSG_0.9.0 org.Hs.eg.db_3.17.0 AnnotationDbi_1.62.2
[17] IRanges_2.34.1 S4Vectors_0.38.2 Biobase_2.60.0 BiocGenerics_0.46.0
[21] lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1 purrr_1.0.2
[25] readr_2.1.5 tibble_3.2.1 ggplot2_3.5.1 tidyverse_2.0.0
[29] tidyr_1.3.1 dplyr_1.1.4 Seurat_5.1.0 SeuratObject_5.0.2
[33] sp_2.1-4 nichenetr_2.2.0

loaded via a namespace (and not attached): [1] urlchecker_1.0.1 nnet_7.3-19 goftest_1.2-3 Biostrings_2.68.1
[5] vctrs_0.6.5 spatstat.random_3.3-2 digest_0.6.37 png_0.1-8
[9] shape_1.4.6.1 proxy_0.4-27 ggrepel_0.9.6 deldir_2.0-4
[13] parallelly_1.38.0 RcppML_0.3.7 MASS_7.3-60.0.1 reshape2_1.4.4
[17] httpuv_1.6.15 foreach_1.5.2 withr_3.0.1 xfun_0.48
[21] ggfun_0.1.5 ggpubr_0.6.0 ellipsis_0.3.2 survival_3.7-0
[25] memoise_2.0.1 profvis_0.3.8 zoo_1.8-12 GlobalOptions_0.1.2
[29] pbapply_1.7-2 Genshinpalette_0.0.1.9000 Formula_1.2-5 KEGGREST_1.40.1
[33] promises_1.3.0 httr_1.4.7 rstatix_0.7.2 globals_0.16.3
[37] fitdistrplus_1.2-1 ps_1.8.0 rstudioapi_0.16.0 GOplot_1.0.2
[41] miniUI_0.1.1.1 generics_0.1.3 processx_3.8.4 base64enc_0.1-3
[45] babelgene_22.9 curl_5.2.3 zlibbioc_1.46.0 polyclip_1.10-7
[49] randomForest_4.7-1.2 GenomeInfoDbData_1.2.10 xtable_1.8-4 desc_1.4.3
[53] doParallel_1.0.17 evaluate_1.0.1 S4Arrays_1.2.0 hms_1.1.3
[57] irlba_2.3.5.1 colorspace_2.1-1 visNetwork_2.1.2 ROCR_1.0-11
[61] reticulate_1.39.0 spatstat.data_3.1-2 magrittr_2.0.3 lmtest_0.9-40
[65] later_1.3.2 viridis_0.6.5 lattice_0.22-6 spatstat.geom_3.3-3
[69] future.apply_1.11.2 scattermore_1.2 shadowtext_0.1.4 cowplot_1.1.3
[73] RcppAnnoy_0.0.22 class_7.3-22 Hmisc_5.1-3 pillar_1.9.0
[77] nlme_3.1-165 iterators_1.0.14 caTools_1.18.3 compiler_4.3.1
[81] RSpectra_0.16-2 stringi_1.8.4 gower_1.0.1 tensor_1.5
[85] devtools_2.4.5 plyr_1.8.9 crayon_1.5.3 abind_1.4-8
[89] ggdendro_0.2.0 locfit_1.5-9.10 bit_4.5.0 fastmatch_1.1-4
[93] codetools_0.2-20 recipes_1.1.0 e1071_1.7-16 GetoptLong_1.0.5
[97] plotly_4.10.4 mime_0.12 splines_4.3.1 circlize_0.4.16
[101] Rcpp_1.0.13 fastDummies_1.7.4 knitr_1.48 blob_1.2.4
[105] utf8_1.2.4 clue_0.3-65 fs_1.6.4 listenv_0.9.1
[109] checkmate_2.3.2 pkgbuild_1.4.4 ggsignif_0.6.4 Matrix_1.6-5
[113] callr_3.7.6 tzdb_0.4.0 tweenr_2.0.3 pkgconfig_2.0.3
[117] pheatmap_1.0.12 tools_4.3.1 cachem_1.1.0 RSQLite_2.3.7
[121] viridisLite_0.4.2 DBI_1.2.3 fastmap_1.2.0 rmarkdown_2.28
[125] scales_1.3.0 grid_4.3.1 usethis_3.0.0 ica_1.0-3
[129] broom_1.0.7 patchwork_1.3.0 dotCall64_1.2 carData_3.0-5
[133] RANN_2.6.2 rpart_4.1.23 farver_2.1.2 DiagrammeR_1.0.11
[137] foreign_0.8-87 cli_3.6.3 leiden_0.4.3.1 lifecycle_1.0.4
[141] caret_6.0-94 uwot_0.2.2 lava_1.8.0 sessioninfo_1.2.2
[145] backports_1.5.0 BiocParallel_1.34.2 timechange_0.3.0 gtable_0.3.5
[149] rjson_0.2.23 ggridges_0.5.6 progressr_0.14.0 parallel_4.3.1
[153] pROC_1.18.5 SnowballC_0.7.1 jsonlite_1.8.9 RcppHNSW_0.6.0
[157] bitops_1.0-9 bit64_4.5.2 Rtsne_0.17 spatstat.utils_3.1-0
[161] spatstat.univar_3.0-1 timeDate_4041.110 lazyeval_0.2.2 shiny_1.9.1
[165] htmltools_0.5.8.1 sctransform_0.4.1 glue_1.8.0 spam_2.11-0
[169] XVector_0.40.0 RCurl_1.98-1.16 gridExtra_2.3 igraph_2.0.3
[173] R6_2.5.1 fdrtool_1.2.18 labeling_0.4.3 cluster_2.1.6
[177] pkgload_1.4.0 ipred_0.9-15 DelayedArray_0.26.7 tidyselect_1.2.1
[181] htmlTable_2.4.3 ggforce_0.4.2 car_3.1-3 ModelMetrics_1.2.2.2
[185] munsell_0.5.1 KernSmooth_2.23-24 data.table_1.16.0 htmlwidgets_1.6.4
[189] ComplexHeatmap_2.16.0 RColorBrewer_1.1-3 rlang_1.1.4 spatstat.sparse_3.1-0
[193] lsa_0.73.3 spatstat.explore_3.3-2 remotes_2.5.0 ggnewscale_0.5.0
[197] fansi_1.0.6 hardhat_1.4.0 prodlim_2024.06.25
Thanks

mass-a commented 1 month ago

It's difficult to guess the exact source of the error without a reproducible example, but I expect it could be related to the Seurat issue linked above, and stemming from subsetting a Seurat object with multiple layers. If your object has multiple layers, I would suggest to avoid using them (run JoinLayers() before any analysis), or even convert the assays from Assay5 to the Assay type, as detailed here.