CellChat
CellChat copied to clipboard
Update CellChat_class.R
I got an error when trying to feed the createCellChat function a SingleCellExperiment containing dgRMatrix format in logcounts. The error occurs in trying to coerce a dgRMatrix to dgCMatrix, but it works to coerce to "CsparseMatrix", which ultimately results in a dgCMatrix.
Supposedly this issue has been resolved in zellkonverter a couple years ago, (https://github.com/theislab/zellkonverter/issues/55), but I just ran into this today with data imported with zellkonverter which was a dgRMatrix, and my packages are up to date. I then found a couple other issues with discussion of this particular conversion problem, so I would suggest making this small update so that it will seamlessly work with dgRMatrix input too! e.g., https://github.com/theislab/zellkonverter/issues/34 suggests this solution as well
According to this Seurat issue, as(., 'dgCMatrix') also got deprecated for other Matrix input types as well https://github.com/satijalab/seurat/issues/6438