-
Notifications
You must be signed in to change notification settings - Fork 910
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
problem reading h5 file #732
Comments
Hi Emily, It looks like that file isn't consistent with 10X's documentation on how the H5 output file should be structured and therefore the library(hdf5r)
infile <- H5File$new("GSM2561498.h5") Alternatively, you could try |
Hi Andrew, Thank you so much for the reply. Clearly, I am not very familiar with the h5 format. I was able to read in the file with the command you suggested above, but it is unclear to me where to go from here to create the Seurat object, or if that is even possible? I would very much like to continue using Seurat if possible, since I would like to use the RunMultiCCA as well as additional packages that require a Seurat object, but using infile as the raw.data for CreateSeuratObject yields the following error: > library(hdf5r)
> infile <- H5File$new("GSM2561498.h5")
> library(Seurat)
> ley.ctrl <- CreateSeuratObject(raw.data = infile, project = "Ley.Ctrl", min.cells = 3, min.genes = 200)
Error in object.raw.data > is.expr :
comparison (6) is possible only for atomic and list types Thank you so much for your help! |
Hi Emily, You need to convert the data in the H5 file into a matrix before passing that to You can read a little more about how to use hdf5 files in R here. For specific details on that particular dataset, I would recommend emailing the contact on the GEO page as that gets a bit beyond the scope of Seurat. |
Thanks so much for all your help, Andrew. I will follow up with the the authors if I can't get it to work on my own. Thanks again, |
Hi, andrewwbutler.
|
Hi Emily, I got the same error while trying to read molecule_info.h5 files instead of gene barcodes matrices. You can re-generate gene-barcode matrices with the |
I just faced the same issue and came up with this solution. Maybe this will help anybody even though the same function in Seurat v3 works fine for me. h5_data <- hdf5r::H5File$new('filtered_feature_bc_matrix.h5', mode = 'r')
feature_matrix <- Matrix::sparseMatrix(
i = h5_data[['matrix/indices']][],
p = h5_data[['matrix/indptr']][],
x = h5_data[['matrix/data']][],
dimnames = list(
h5_data[['matrix/features/name']][],
h5_data[['matrix/barcodes']][]
),
dims = h5_data[['matrix/shape']][],
index1 = FALSE
) |
I got the same error from some old data. This is a totally different data format, I don't think romanhaa's comment solved this. Here is what I got by "h5dump -n molecule_info.h5" . 10x has this document page:
I am not sure this is the best solution, but this works
|
Hi Emily,Have you solved your problem? Have you been able to convert h5 files into Seurat objects? I have the same problem as you,I hope you could give me some advice. |
Hi there, tmp and mtx worked for me but when I try the third line starting with dimnames(mtx) I get this error: Any idea how to fix? Thanks!! |
Hi there,
I'm trying to read an h5 file from a published data set (available on GEO accession GSM2561498), using the Read10X_h5 function, but keep getting the following error.
Any insight into what might be going on would be hugely helpful!
Thanks so much,
Emily
The text was updated successfully, but these errors were encountered: