Failed reading 10x h5 file - CellBender v2.1
See original GitHub issueLast week I ran CellBender v1 over a CellRanger V3 library I got, and then successfully loaded the h5 output into a Seurat object.
CreateSeuratObject(Read10X_h5("the_cell_bender_outout_filtered.h5"))
Now, when I tried using CellBender V2.1 instead of V1 over the same CellRanger library, I got the following exception:
Error in `[[.H5File`(infile, paste0(genome, "/", feature_slot)) :
An object with name matrix/gene_names does not exist in this group
Comparing the output h5 files of both versions they seem to have the same format with the difference that the V2.1 output has the "PYTABLES_FORMAT_VERSION"
. Is it flagged like that on purpose? This is the flag that causes the Seurat Read10X_h5 function to fail: (part of Read10X_h5 code)
infile <- hdf5r::H5File$new(filename = filename, mode = "r")
genomes <- names(x = infile)
output <- list()
if (!infile$attr_exists("PYTABLES_FORMAT_VERSION")) {
if (use.names) {
feature_slot <- "features/name"
}
else {
feature_slot <- "features/id"
}
}
else {
if (use.names) {
feature_slot <- "gene_names"
}
else {
feature_slot <- "genes"
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Background Removal Guidance for Single Cell Gene ...
This article assumes the raw sequence data have already been demultiplexed using either the bcl2fastq or mkfastq pipelines (i.e., you are ...
Read more >Read & Write Data Functions • scCustomize
This causes Seurat::Read10X_h5() to to fail when trying to import data ... Import 10X Genomics H5 Formatted Files single directory with file ......
Read more >Read 10X hdf5 file — Read10X_h5 • Seurat - Satija Lab
Read count matrix from 10X CellRanger hdf5 file. This can be used to read both scATAC-seq and scRNA-seq matrices. Read10X_h5(filename, use.names = TRUE, ......
Read more >791699v2.full.pdf - bioRxiv
droplet-based single-cell experiments using CellBender ... input: (1) raw HDF5 file from 10x Genomics' CellRanger v2+ count pipeline, (2) ...
Read more >Scalable single-cell RNA sequencing from full transcripts with ...
After shallow sequencing, alignment and error correction of reads, ... 3e,f), SeqAmp with 2 µM TSO and 1 µM of each PCR primer...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/satijalab/seurat/issues/3653
Okay, so the
if
statement that @GreenGilad mentioned above is indeed the problem. Since we create a file using PyTables, there will be aPYTABLES_FORMAT_VERSION
attribute.My proposal is to substitute their current
if
statement https://github.com/satijalab/seurat/blob/fe93b05745e55ec2f66e3f0b4c4196aad9f4d5a7/R/preprocessing.R#L1155with
For now, I think the code below is a potential workaround. I may try to submit a pull request to Seurat to incorporate this, as I think it makes more sense than relying on a version attribute from PyTables.
Loading a CellBender
remove-background
output file in a legacy CellRanger v2 format:Loading a CellBender
remove-background
output file in the newer CellRanger v3+ format: (I had to subset to “Gene Expression” to successfully useCreateSeuratObject
)