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

How to read HumanFetalBrainPool.h5 into Seurat #12

Closed
vertesy opened this issue Mar 7, 2024 · 2 comments
Closed

How to read HumanFetalBrainPool.h5 into Seurat #12

vertesy opened this issue Mar 7, 2024 · 2 comments

Comments

@vertesy
Copy link

vertesy commented Mar 7, 2024

Hey,

thank you for sharing this great resource. I am not familiar with the h5 and format nor the cytograph-shoji pipeline.

I would like to read HumanFetalBrainPool.h5 (or the other provided fully processed files with meta data) into Seurat. similar to as described here.

I tried multiple suggestions found on the web or in #2, but did not manage to get a Seurat object. I stumbled on too many suggestions: sceasy, schard, rhdf5, HDF5Array, SeuratDisk, Seurat's Read10X_h5, with most of the suggestions just saying "use this". However, it seems specific details are crucial.

Most approaches failed with an error about "X not found in the h5 file", I assume because h5 is a generic format, and the loader should know exactly what and how is stored inside.

If someone could help out which exact packages and it would be great! Thank you!

@yojetsharma
Copy link

yojetsharma commented Mar 10, 2024

install.packages("BiocManager")
BiocManager::install("rhdf5")
h5_file <- H5Fopen("HumanFetalBrainPool.h5", flags = "H5F_ACC_RDONLY")
#Check all the things that are there in the file by running
h5_file$CellClass #(CellClass, for example, is the metadata for annotation)
h5ls("HumanFetalBrainPool.h5") 
metadata <- h5read(h5_file, "shoji/CellClass")
counts<-h5read(h5_file, "shoji/Expression)
seurat_obj<-CreateSeuratObject(counts, metadata)
h5close(h5_file)

@vertesy
Copy link
Author

vertesy commented Mar 12, 2024

Thank you very much!

@vertesy vertesy closed this as completed Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants