vitessce / vitessceR

R API and htmlwidget for Vitessce
https://r-docs.vitessce.io
Other
34 stars 9 forks source link

Seurat wrapper not working for Seurat v5 objects #81

Open FloWuenne opened 11 months ago

FloWuenne commented 11 months ago

Describe the bug I am trying to run vitessceR using Seurat v5 objects as input. I get the following error:

Warning: Overwriting previous file data/seuratdata/A/0/seurat.zarr.h5Seurat
Creating h5Seurat file for version 3.1.5.9900
Adding counts for RNA
Adding data for RNA
Adding scale.data for RNA
Adding variable features for RNA
Error in if (ncol(x = x[[]])) { : argument is of length zero

To Reproduce Analyze a seurat object using the seurat v5 installation and try to run the example Seuratwrapper code on that object.

Expected behavior The expected behaviour is to get the vitessceR dashboard for the seurat object processed as in : https://vitessce.github.io/vitessceR/articles/seuratdata.html

Screenshots If applicable, add screenshots to help explain your problem.

Environment:

FloWuenne commented 6 months ago

@keller-mark Any plans for adding support for Seurat v5 object structure?

keller-mark commented 6 months ago

Hi @FloWuenne, I definitely would like to add support for the v5 objects, just have not had a chance to look into how the objects changed from v4 to v5. I think the place that would need updating would be here where the Seurat object is converted to an AnnData object https://github.com/vitessce/vitessceAnalysisR/blob/a8511e6a87c1b0c4c33bf7482825db6292a02028/R/data_to_zarr.R#L13 It seems that the SeuratDisk package we currently use for that has not been updated to support v5 as the error you report here is also reported there in https://github.com/mojaveazure/seurat-disk/issues/166

Ideally this can be accomplished with the AnnDataR package once there is support for Seurat v5 and Zarr.

I also realize some of the documentation is out of date - We now have an AnnDataWrapper class that can be used once the data is in the AnnData format, which serves as a unified way to configure Vitessce from different types of R single cell data structures, for example here https://github.com/vitessce/vitessceR/blob/3177e1771925efbb34f243775845128c7217c431/vignettes/shiny.Rmd#L92