aertslab / SCENIC

SCENIC is an R package to infer Gene Regulatory Networks and cell types from single-cell RNA-seq data.
http://scenic.aertslab.org
GNU General Public License v3.0
395 stars 94 forks source link

runCorrelation matrix error #191

Closed AAA-3 closed 3 years ago

AAA-3 commented 3 years ago

Hello :)

I imported me seurat file into SCENIC:

#Importing data from Seurat RDS file
exprMat <- GE@assays[["RNA"]]@counts
cellInfo <- GE@meta.data[colnames(exprMat), "sample", drop=F]
cellInfo <- data.frame(cellInfo)
cbind(table(cellInfo$sample))
dir.create("int")
saveRDS(cellInfo, file="int/cellInfo.Rds")

and then ran the filtration based on the solution provided in https://github.com/aertslab/SCENIC/issues/90#issue-473703158

I am attempting to run a correlation using the runCorrelation(exprMat_filtered, scenicOptions)command but I keep getting an error claiming Error in t.default(exprMat_filtered) : argument is not a matrix. This is despite the global environment window stating that it is: Screenshot from 2021-04-27 11-44-01

I looked at the source code https://github.com/aertslab/SCENIC/blob/master/R/runCorrelation.R but am not sure how to manipulate it to proceed. Any ideas?

AAA-3 commented 3 years ago

Update: I forced the file to be read as a matrix by adding: exprMat_filtered <- as.matrix(exprMat_filtered) before the runCorrelation()command. Continuing on with the GENIE3 pipeline. Not sure what the cause of this error was but at least we have a solution for those who also run into this problem :)

zh-zhang1984 commented 2 years ago

However, sometimes the exprMat is very large and as.matrix function will report error:

> exprMat <- Matrix::as.matrix(Sepsis_seurat@assays$RNA@data)
Error in asMethod(object) : 
  Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 102