STitch3D icon indicating copy to clipboard operation
STitch3D copied to clipboard

Problems in loading the human heart original dataset into R

Open cristalliao opened this issue 2 years ago • 3 comments

Dear Professor,

I have encountered some problems in loading the human heart dataset into R. Could you please help me to check what the problem is?

Firstly, I read the original dataset in Python using tutorial code. I treat the "adata_st_list_raw" dataset as the original dataset for each slice 0-8. Screen Shot 2023-08-12 at 3 09 38 pm

And I find this dataset's type is a list, and each element in this list is the AnnData object Screen Shot 2023-08-12 at 3 11 00 pm

So I want to save each element in the list as an h5ad file since I want to read them in R: For example, I want to save slice0 original dataset as h5ad Screen Shot 2023-08-12 at 3 12 19 pm I use the code slice_0_raw.write_h5ad('/dski/nobackup/xiaoyinl/STitch3D_analysis_and_dataset/human_dataset_orignal/slice_0_raw.h5ad') And then in R use the code Convert("/dski/nobackup/xiaoyinl/STitch3D_analysis_and_dataset/human_dataset_orignal/slice_0_raw.h5ad", dest = "h5seurat", overwrite = F) But I encountered a very strange error in loading the h5seurat object, it said

"Validating h5Seurat file Warning: Non-unique features (rownames) present, making uniqueInitializing RNA with data Adding counts for RNA Adding scale.data for RNA Warning: Non-unique features (rownames) present, making uniqueAdding feature-level metadata for RNA Adding reduction loc_use Adding cell embeddings for loc_use Warning: Keys should be one or more alphanumeric characters followed by an underscore, setting key from loc_use_ to locuse_Warning: All keys should be one or more alphanumeric characters followed by an underscore '_', setting key to locuse_Adding miscellaneous information for loc_use Adding reduction spatial Adding cell embeddings for spatial Adding miscellaneous information for spatial Error in if (!x[[i]]$dims) { : the condition has length > 1"

The main error is "Error in if (!x[[i]]$dims) { : the condition has length > 1" Screen Shot 2023-08-12 at 3 23 38 pm

Do you encounter the same error as me? Do you have any suggestions to solve this problem? Thanks a lot!

cristalliao avatar Aug 12 '23 05:08 cristalliao

I think this error means this h5seurat is too big. Or do I have any other solutions to solve this problem? Thanks a lot!

cristalliao avatar Aug 12 '23 05:08 cristalliao

Hi Cristal,

This may be caused by some problem in the LoadH5Seurat function. You can load the data csv files (counts, locations, meta information, etc.) directly into R, or use anndata package to read h5ad files in R to run R packages.

Best, Gefei

gefeiwang avatar Aug 14 '23 11:08 gefeiwang

Dear Professor Gefei, Thanks a lot! I will try it in another way. Thanks for your help! Very appreciated!

Best regards, Cristal

cristalliao avatar Aug 14 '23 11:08 cristalliao