Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert the sce to seurat object #5

Open
Ahmedalaraby20 opened this issue Jun 30, 2022 · 3 comments
Open

Cannot convert the sce to seurat object #5

Ahmedalaraby20 opened this issue Jun 30, 2022 · 3 comments

Comments

@Ahmedalaraby20
Copy link

Hey guys,
Congratulation on such amazing work,
I am just having some issues converting the sce to Seurat object

allseurat <- as.Seurat(All)

Error in UseMethod(generic = "as.sparse", object = x) : 
  no applicable method for 'as.sparse' applied to an object of class "c('DelayedMatrix', 'DelayedArray', 'DelayedUnaryIsoOp', 'DelayedUnaryOp', 'DelayedOp', 'Array', 'RectangularData')"

Would appreciate if you could help with that :D
Thanks a lot

@federicomarini
Copy link
Collaborator

Hi Ahmed,
From the error message you are posting, this is because the casting function to Seurat is not able to handle the conversion of the assays slots, which are (cleverly as it frees up memory while you have loaded the objects) stored with the DelayedArray backend.
If your machine supports that, I think you could enforce the conversion to a "classical" in-memory matrix, just be ready to use up a substantial amount of RAM.
Feel free to follow up on this on the Bioc slack (https://bioc-community.herokuapp.com/), there might be cleverer ways to do this - can just be that I am not fully aware of the palette of methods to handle this.
Federico

@massonix
Copy link
Owner

Hi Ahmed,

This is indeed an issue on Seurat's side, as described in this issue. Following their advice, you could run this before conversion:

counts(sce) <- as(counts(sce, withDimnames = FALSE), "dgCMatrix")

Ramon

@Ahmedalaraby20
Copy link
Author

Thanks alot guys,
I switched to Scanpy :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants