wu-yc / scMetabolism

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

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

Open luohaohao opened 2 years ago

luohaohao commented 2 years 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 2 years 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 1 year 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 5 months ago

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

GUOYF0412 commented 3 months ago

so,how to solve this problem?

clearc352 commented 2 months ago

Hello,i think that is problem from VISION package. In VISION(3.0.2)NormalizationMethods script :https://github.com/YosefLab/VISION/blob/master/R/NormalizationMethods.R line 170 change to: data <- as(as(as(data, "dMatrix"), "generalMatrix"), "unpackedMatrix")

watermelon1234567 commented 1 month ago

I tried that. It didn't work.