wu-yc / scMetabolism

Quantifying metabolism activity at the single-cell resolution
BSD 3-Clause "New" or "Revised" License
95 stars 37 forks source link

sc.metabolism.Seurat/sc.metabolism returns error #17

Closed goterm closed 1 year ago

goterm commented 1 year ago

Hi,

I have been using scMetabolism for a while and today I got this error:

metabolic_seurat_kegg <- sc.metabolism.Seurat(obj = object, method = "VISION", imputation = F, ncores = 4, metabolism.type = "KEGG")

... ... Computing differential signature tests...

|=============================================================================| 100%, Elapsed 00:00 | | 0%, ETA NA Error in [<-.data.frame(*tmp*, , 2, value = 0) : replacement has 1 row, data has 0 In addition: Warning message: In readSignaturesInput(signatures) : NAs introduced by coercion

I have tried multiple datasets and could not figure out what is happening. It is also independent of seurat (tried with metabolism.matrix<-sc.metabolism(countexp = countexp, method = "VISION", imputation = F, ncores = 2, metabolism.type = "KEGG") and got the same error

any input would be appreciated! thanks

swmuyu commented 1 year ago

Hi,

I have been using scMetabolism for a while and today I got this error:

metabolic_seurat_kegg <- sc.metabolism.Seurat(obj = object, method = "VISION", imputation = F, ncores = 4, metabolism.type = "KEGG")

... ... Computing differential signature tests...

|=============================================================================| 100%, Elapsed 00:00 | | 0%, ETA NA Error in [<-.data.frame(*tmp*, , 2, value = 0) : replacement has 1 row, data has 0 In addition: Warning message: In readSignaturesInput(signatures) : NAs introduced by coercion

I have tried multiple datasets and could not figure out what is happening. It is also independent of seurat (tried with metabolism.matrix<-sc.metabolism(countexp = countexp, method = "VISION", imputation = F, ncores = 2, metabolism.type = "KEGG") and got the same error

any input would be appreciated! thanks

I also have the same error reported, did you solve it please?

xzhouaw commented 1 year ago

I also had the same error. Does anyone find how to fix it ?

wu-yc commented 1 year ago

Would you kindly upload your input data or send it to wuyc@mail.com @xzhouaw @swmuyu @goterm

swmuyu commented 1 year ago

Would you kindly upload your input data or send it to wuyc@mail.com @xzhouaw @swmuyu @goterm

I also get this error when using pbmc_demo.rda for analysis. Here is the installed version information:

r$> sessionInfo('scMetabolism') R version 4.2.2 (2022-10-31) Platform: x86_64-conda-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux 8.6 (Ootpa)

Matrix products: default BLAS/LAPACK: /work/yuzh/miniconda3/lib/libmkl_rt.so.2

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

attached base packages: character(0)

other attached packages: [1] scMetabolism_0.2.1

loaded via a namespace (and not attached): [1] Seurat_4.2.1 Rtsne_0.16 colorspace_2.0-3 deldir_1.0-6 ellipsis_0.3.2 ggridges_0.5.4 mclust_6.0.0 spatstat.data_3.0-0 leiden_0.4.3
[10] listenv_0.8.0 stats_4.2.2 ggrepel_0.9.2 fansi_1.0.3 codetools_0.2-18 splines_4.2.2 logging_0.10-108 polyclip_1.10-4 jsonlite_1.8.3
[19] ica_1.0-3 base_4.2.2 cluster_2.1.4 png_0.1-7 uwot_0.1.14 wordspace_0.2-8 shiny_1.7.3 sctransform_0.3.5 spatstat.sparse_3.0-0 [28] plumber_1.2.1 compiler_4.2.2 httr_1.4.4 SeuratObject_4.1.3 Matrix_1.5-3 fastmap_1.1.0 lazyeval_0.2.2 cli_3.4.1 later_1.3.0
[37] htmltools_0.5.3 tools_4.2.2 rsvd_1.0.5 igraph_1.3.5 gtable_0.3.1 glue_1.6.2 RANN_2.6.1 reshape2_1.4.4 dplyr_1.0.10
[46] grDevices_4.2.2 fastmatch_1.1-3 Rcpp_1.0.9 scattermore_0.8 vctrs_0.5.1 ape_5.6-2 spatstat.explore_3.0-5 nlme_3.1-160 progressr_0.11.0
[55] lmtest_0.9-40 spatstat.random_3.0-1 stringr_1.4.1 webutils_1.1 globals_0.16.1 mime_0.12 miniUI_0.1.1.1 lifecycle_1.0.3 irlba_2.3.5.1
[64] VISION_3.0.0 phangorn_2.10.0 goftest_1.2-3 future_1.29.0 MASS_7.3-58.1 zoo_1.8-11 scales_1.2.1 loe_1.1 graphics_4.2.2
[73] promises_1.2.0.1 spatstat.utils_3.0-1 parallel_4.2.2 swagger_3.33.1 RColorBrewer_1.1-3 utils_4.2.2 reticulate_1.26 pbapply_1.6-0 gridExtra_2.3
[82] ggplot2_3.4.0 datasets_4.2.2 fastICA_1.2-3 stringi_1.7.8 permute_0.9-7 rlang_1.0.6 pkgconfig_2.0.3 matrixStats_0.62.0 lattice_0.20-45
[91] ROCR_1.0-11 purrr_0.3.5 tensor_1.5 patchwork_1.1.2 htmlwidgets_1.5.4 cowplot_1.1.1 tidyselect_1.2.0 parallelly_1.32.1 RcppAnnoy_0.0.20
[100] plyr_1.8.8 magrittr_2.0.3 R6_2.5.1 generics_0.1.3 mgcv_1.8-41 pillar_1.8.1 withr_2.5.0 fitdistrplus_1.1-8 survival_3.4-0
[109] abind_1.4-5 sp_1.5-1 tibble_3.1.8 future.apply_1.10.0 KernSmooth_2.23-20 utf8_1.2.2 spatstat.geom_3.0-3 plotly_4.10.1 grid_4.2.2
[118] data.table_1.14.6 vegan_2.6-4 methods_4.2.2 sparsesvd_0.2-1 digest_0.6.30 pbmcapply_1.5.1 xtable_1.8-4 tidyr_1.2.1 httpuv_1.6.6
[127] munsell_0.5.0 viridisLite_0.4.1 iotools_0.3-2 quadprog_1.5-8

swmuyu commented 1 year ago

Would you kindly upload your input data or send it to wuyc@mail.com @xzhouaw @swmuyu @goterm

I presume it might be the installer version, because I use pbmc_demo.rda data for analysis and the server reports the same error. Can you provide me with your installation version (sessionInfo('scMetabolism'))?

pennell01 commented 1 year ago

I managed to run this algorithm last month, but I had the same error today. I had tried the demo data which I downloaded a month ago for analysis, but it didn't work either and reported the same error.I tried restarting R and run again and it didn't work.

wu-yc commented 1 year ago

Thank you all the guys.

I am still working on it. Please give me one second

Counts-Xin commented 1 year ago

Thank you all the guys.

I am still working on it. Please give me one second

have you solved ?

horizon-mm commented 1 year ago

Hi all,

I have the same issue with the demo data and demo code here.

Look like sc.metabolism.Seurat() in the demo only works when method = "AUCell", as I get the following errors with the other two options "ssgsea" and "gsva":

Error in sc.metabolism.Seurat(obj = countexp.Seurat, method = "ssgsea", : object 'signature_exp' not found

Error in sc.metabolism.Seurat(obj = countexp.Seurat, method = "gsva", : object 'signature_exp' not found

Highly suspicious that the those package (e.g. "VISION" or "GSVA") has been updated such that the dependent sc.metabolism.Seurat() has to be modified accordingly.

wu-yc commented 1 year ago

Hi guys, please change the method to method = "AUCell"

veeramv commented 1 year ago

HI wu-yc, could you please help me on this error!

countexp.Seurat<-sc.metabolism.Seurat(obj = obj.list$pbs_con, method = "AUCell", imputation = F, ncores = 6, metabolism.type = "KEGG") Your choice is: KEGG Start quantify the metabolism activity... Quantiles for the number of genes detected by cell: (Non-detected genes are shuffled at the end of the ranking. Keep it in mind when choosing the threshold for calculating the AUC). min 1% 5% 10% 50% 100% 501.0 563.0 817.0 1185.2 2912.0 8912.0 Using 6 cores. Error in .AUCell_calcAUC(geneSets = geneSets, rankings = rankings, nCores = nCores, : Fewer than 20% of the genes in the gene sets are included in the rankings.Check wether the gene IDs in the 'rankings' and 'geneSets' match. In addition: Warning message: In asMethod(object) : sparse->dense coercion: allocating vector of size 1.8 GiB

AnwarKhan345 commented 1 year ago

Hi @wu-yc @xzhouaw @swmuyu @horizon-mm,

I am having the same error. Any progress? Here is my code:

calculate gene set expression of metabolism pathways

countexp.Seurat<-sc.metabolism.Seurat(obj = seurat.subset, method = "VISION", imputation = F, ncores = 1, metabolism.type = "KEGG") Error: in [<-.data.frame(*tmp*, , 2, value = 0) : replacement has 1 row, data has 0

Thank you :)

wu-yc commented 1 year ago

Hey guys, please install the VISION v2.1.0 devtools::install_github("YosefLab/VISION@v2.1.0") .

Tutorial of this package has been updated.

goterm commented 1 year ago

Hi Yingcheng,

I just tried after _devtools::installgithub("YosefLab/VISION@v2.1.0") and got the same error: Error in [<-.data.frame(*tmp*, , 2, value = 0) : replacement has 1 row, data has 0 In addition: Warning message: In readSignaturesInput(signatures) : NAs introduced by coercion

However, it worke after reinstalling VISION with _devtools::installgithub("YosefLab/VISION"). thank you!