Open kguion1 opened 2 years ago
I have the same problem.
I had the same problem. It seems like seurat-disk can't load multidimensional arrays, so it fails when trying to read any images saved in the object.
It fails on this line:
https://github.com/mojaveazure/seurat-disk/blob/9b89970eac2a3bd770e744f63c7763419486b14c/R/ReadH5.R#L231
because dims
is 3 dimensional for image data. A workaround is to remove the image data from the object.
Hi, thanks for a great tool! I saved my Seurat with the Saveh5Seurat function and was trying to load it in with the Loadh5Seurat and received the following error:
Error in if (!x[[i]]$dims) { : the condition has length > 1
SaveH5Seurat(spatial_6a, "data/6a/Seurat_PreProcess", overwrite = FALSE, verbose = TRUE)
Creating h5Seurat file for version 3.1.5.9900 Adding counts for spatial Adding data for spatial No variable features found for spatial No feature-level metadata found for spatial Adding counts for SCT Adding data for SCT Adding scale.data for SCT Adding variable features for SCT No feature-level metadata found for SCT Writing out SCTModel.list for SCT Adding cell embeddings for pca Adding loadings for pca No projected loadings for pca Adding standard deviations for pca No JackStraw data for pca Adding cell embeddings for umap No loadings for umap No projected loadings for umap No standard deviations for umap No JackStraw data for umap Adding image slice1test_readin <- LoadH5Seurat("data/6a/Seurat_PreProcess.h5seurat")
Validating h5Seurat file Initializing SCT with data Adding counts for SCT Adding scale.data for SCT Adding variable feature information for SCT Adding miscellaneous information for SCT Initializing spatial with data Adding counts for spatial Adding miscellaneous information for spatial Adding reduction pca Adding cell embeddings for pca Adding feature loadings for pca Adding miscellaneous information for pca Adding reduction umap Adding cell embeddings for umap Adding miscellaneous information for umap Adding graph SCT_nn Adding graph SCT_snn Adding image slice1 Error in if (!x[[i]]$dims) { : the condition has length > 1