wu-yc / scMetabolism

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

Error: as(<matrix>, "dgeMatrix") is deprecated since Matrix 1.5-0; #14

Open luohaohao opened 1 year ago

luohaohao commented 1 year ago

scRNA_harmony <- sc.metabolism.Seurat(obj = countexp.Seurat, method = "VISION", imputation = F, ncores = 2, metabolism.type = "KEGG") Error: as(, "dgeMatrix") is deprecated since Matrix 1.5-0; do as(as(as(., "dMatrix"), "generalMatrix"), "unpackedMatrix") instead In addition: Warning message: In readSignaturesInput(signatures) : NAs introduced by coercion

use demo file, an error is reported after execution. thanks

XuenaXie commented 1 year ago

How did you solve it in the end? I also encountered this problem. thanks!

Evaluating signature scores on cells...

Error: as(, "dgeMatrix") is deprecated since Matrix 1.5-0; do as(as(as(., "dMatrix"), "generalMatrix"), "unpackedMatrix") instead

KevinZhou-hub commented 1 year ago

I got the same error, for everyone who encounters this problem afterward, the solution is pretty straightforward, just downgrade Matrix to 1.4.1 by:

install.packages("https://cran.r-project.org/src/contrib/Archive/Matrix/Matrix_1.4-1.tar.gz", repos=NULL, type="source")

However, my Seurat version is 4.1.1 and requires Matrix >= 1.5.0, so the package needs to be upgraded after I run scMetabolism... I suppose it's possible to download the source code and change as(, "dgeMatrix") to as(as(as(., "dMatrix"), "generalMatrix"), "unpackedMatrix") manually. Hope the developers can make modifications in the future version.

Chanlder66 commented 1 year ago

install.packages("Matrix"),do not install version before 1.5

paolabc commented 8 months ago

Hi there!

I am have the same issue. I would like to know if change as(, "dgeMatrix") to as(as(as(., "dMatrix") in the source code worked. I also would like to double check if it is should be changed on the matrix source code. I did not find it on scMetabolism package.

Thanks, Paola

Noralii commented 4 weeks ago

I meet the same problem Error: (converted from warning) 'as(, "dgeMatrix")' is deprecated. Use 'as(as(as(., "dMatrix"), "generalMatrix"), "unpackedMatrix")' instead.