FelixTheStudent / cellpypes

Cell type pipes for R
GNU General Public License v3.0
51 stars 3 forks source link

pype_from_seurat only works on simple cases #17

Closed FelixTheStudent closed 2 years ago

FelixTheStudent commented 2 years ago

pype_from_seurat gave the following error:

Error in methods::as(seurat@graphs[[graph_choice]], "dgCMatrix") : no method or default for coercing “NULL” to “dgCMatrix”​

The solution was to use the explicit object creation strategy outlined in the tutorial, like this:

obj <- list(
    raw      = SeuratObject::GetAssayData(midgut.combined, "counts"),
    neighbors= as(midgut.combined@graphs[["integrated_nn"]], "dgCMatrix")>.1,
    embed    = FetchData(midgut.combined, c("UMAP_1", "UMAP_2")),
    totalUMI = midgut.combined$nCount_RNA
)
FelixTheStudent commented 2 years ago

Fixed with commit 2cd1259354a0dc314e3089ab4f318fe6fb3cea64. If you have cellpypes 0.1.14 or newer, this error should not occur. If it does, reopen this issue or create a new one!