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

Issues with converting SPATA objects to seurat objects #128

Open
mattli7 opened this issue Jul 2, 2024 · 1 comment
Open

Issues with converting SPATA objects to seurat objects #128

mattli7 opened this issue Jul 2, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mattli7
Copy link

mattli7 commented Jul 2, 2024

Hello,

I have been trying to convert SPATA objects from the SPATA data using downloadSpataObjects function. I am able to download the data/RDS files fine. When I load them in with and try to convert them to a seurat object using the function asSeurat(), I get this error:
Error in validObject(.Object) :
invalid class “VisiumV1” object: 1: invalid object for slot "scale.factors" in class "VisiumV1": got class "NULL", should be or extend class "scalefactors"
invalid class “VisiumV1” object: 2: invalid object for slot "spot.radius" in class "VisiumV1": got class "NULL", should be or extend class "numeric"
I was wondering if anyone could help with this.

Thank you.

@simonmfr
Copy link
Collaborator

Hi @mattli7, sorry for the late reply. Please re-install SPATA2 and try again.

Alternatively, to transfer barcode metadata from SPATA2 to Seurat, an easy solution is:

meta_col <- as.data.frame(SPATA2::getMetaDf(spata_object)[c("barcodes","column_to_transfer")])
seurat_object <- Seurat::AddMetaData(seurat_object, meta_col)`

Hope that helps!

@simonmfr simonmfr self-assigned this Aug 28, 2024
@simonmfr simonmfr added the bug Something isn't working label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants