Closed rargelaguet closed 4 years ago
In case it is relevant, I get the following error when loading the data with Read10X
:
# Error in as(object = list_of_data[[j]], Class = "dgCMatrix"): no method or default for coercing "ngTMatrix" to "dgCMatrix"
# inputdata <- Read10X(paste0(io$basedir,"/data"), gene.column = 1)
so I have to load it manually:
m <- Matrix::readMM(io$matrix)
barcodes <- fread(io$barcodes, header=F)[[1]]
features <- fread(io$features, header=F)[[1]]
Hi Ricard, this might have something to do with the format of the matrix. What if you convert to a dgCMatrix before creating the object? eg:
library(Matrix)
m <- readMM(io$matrix)
barcodes <- fread(io$barcodes, header=F)[[1]]
features <- fread(io$features, header=F)[[1]]
colnames(m) <- barcodes
rownames(m) <- features
m <- as(object = m, Class = "dgCMatrix")
The format of the sparse matrix was indeed the problem, thanks!
ngTMatrix is a sparse logical matrix, not numeric. To convert it to dgCMatrix I did m <- m*1
, as m <- as(object = m, Class = "dgCMatrix")
does not work. I will close the issue.
Hi Tim, I am trying to run
CreateChromatinAssay
on an ATAC matrix of dimensions (305187,23838), which should be at most 305187 238388 / 1e9= 58GB in a non-sparse matrix format. I am however running out of memory despite requesting 100GB. Is this expected or am I doing something wrong? Thanks!Here is the formatted code:
and the sessionInfo():