satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.3k stars 917 forks source link

Error with LoadVizgen in Seurat: Possible Issue with .obj File or Manual Loading Needed? #9460

Open drchubos opened 1 week ago

drchubos commented 1 week ago

Issue: Error in LoadVizgen Function with Missing HDF5 and CreateSegmentation Method

I encountered an issue while trying to load Vizgen spatial data in Seurat using the LoadVizgen function. Here is the relevant code and the errors I received:

r 複製程式碼

Load required libraries

library(Seurat) library(dplyr)

Set the working directory to the Vizgen data directory

setwd("/restricted/projectnb/rohlab/abhyudaymerscope")

Attempt to load the Vizgen spatial data

vizgen_seurat <- LoadVizgen(data.dir = "/restricted/projectnb/rohlab/abhyudaymerscope", fov = "vizgen_obj") When I ran this code, I received the following warning:

css 複製程式碼 Warning in ReadVizgen(data.dir = data.dir, ...: Cannot find hdf5r; unable to load segmentation vertices After that, I encountered an error:

typescript 複製程式碼 Error in UseMethod(generic = "CreateSegmentation", object = coords) : no applicable method for 'CreateSegmentation' applied to an object of class "NULL" The warning suggests that the hdf5r package is missing, but after installing hdf5r, I noticed the required HDF5 files are not present in the data directory.

Questions:

Could this issue be related to the .obj file output? Do I need to manually load any specific files to resolve this? Is there an alternative recommended approach for loading Vizgen data in Seurat? Thank you for your assistance!

zskylarli commented 1 day ago

Hi - do you mean that you do not have any cell segmentation files, or a cell_boundaries directory in your folder? If not, since the default argument of type is "segmentations", which requires cell segmentation vertices, you are probably running into an issue by not changing it to either 'centroids' or 'boxes' depending on what your spatial coordinates specify. You can see the documentation here: https://satijalab.org/seurat/reference/readvizgen. Let me know if you have further issues!