You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a Visium HD dataset, which is relatively large and has 85k cells. And when I wanted to see some gene expression with spatialFeaturePlot(), it immediately warned me saying
Warning message:
In asMethod(object) :
sparse->dense coercion: allocating vector of size 12.1 GiB
I dove into the source code and saw data <- as.matrix(object@data) in the first line of the function body. I have a sparse matrix presented when constructing the CellChat object, and converting the whole thing into a dense form is obviously the cause.
My personal suggestion for a better implementation would be first to check the features input and only subset the expression of specified ones, which are the only ones necessary to be converted to dense.
The text was updated successfully, but these errors were encountered:
I'm working on a Visium HD dataset, which is relatively large and has 85k cells. And when I wanted to see some gene expression with
spatialFeaturePlot()
, it immediately warned me sayingI dove into the source code and saw
data <- as.matrix(object@data)
in the first line of the function body. I have a sparse matrix presented when constructing the CellChat object, and converting the whole thing into a dense form is obviously the cause.My personal suggestion for a better implementation would be first to check the
features
input and only subset the expression of specified ones, which are the only ones necessary to be converted to dense.The text was updated successfully, but these errors were encountered: