ddiez / celltype

An R package for cell type prediction from single cell omics data
https://ddiez.github.io/celltype/
Other
2 stars 1 forks source link

Can't use predict_celltype for sce converted from Seurat #1

Open veralow1990 opened 5 years ago

veralow1990 commented 5 years ago

Hi there! I'm interested in using celltype for data generated from 10X Genomics pipelines. I used Seurat to read the 10X data and converted the Seurat object to SCE. When I tried to use predict_celltype to read the resulted SCE, there came an error saying "Error in UseMethod("predict_celltype") : no applicable method for 'predict_celltype' applied to an object of class "c('dgCMatrix', 'CsparseMatrix', 'dsparseMatrix', 'generalMatrix', 'dCsparseMatrix', 'dMatrix', 'sparseMatrix', 'compMatrix', 'Matrix', 'xMatrix', 'mMatrix', 'Mnumeric', 'replValueSp')" ". How can I fix this problem? Thank you so much! Looking forward to your reply. BW

ddiez commented 5 years ago

Yes, I've been hit by this problem before. This is caused because Seurat stores data counts as sparse matrices and some of the functions I use do not support them. A temporary solution is to do:

assays(sce) <- lapply(assays(sce), as.matrix)

where you have to substitute sce by the name of your SingleCellExperiment object.

For a more permanent solution I will try to push some fix in the near future.