CellBender: read_10x_h5 error in scanpy 1.9.1
Hi, I’m not sure if this is related to other h5 issues (and may be a scanpy bug), but scanpy 1.9.1 throws ValueError: Illegal slicing argument for scalar dataspace
when opening *.cellbender_output_filtered.h5
files (this works fine with scanpy 1.8.2).
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 15 (8 by maintainers)
Commits related to this issue
- Handle scalar datasets too After @ivirshup's pytables PR (#2064) we started having issues with loading h5 files with scalar datasets, such as those created by CellBender (https://github.com/broadinst... — committed to scverse/scanpy by gokceneraslan 2 years ago
- Handle scalar datasets too (#2344) * Handle scalar datasets too After @ivirshup's pytables PR (#2064) we started having issues with loading h5 files with scalar datasets, such as those created by ... — committed to scverse/scanpy by gokceneraslan 2 years ago
Okay thank you @esrice , now I see. Yes there are still some extra values packed into the h5 file in the cellbender output for v0.2. I will soon update to v0.3, where the
ptrepack
solution might work. But for now, that suggestion did not make sense.The best thing to do is to use the above data loader code for the time being: the
anndata_from_h5()
function.In v0.3.0, the data loading functions will be distributed as part of cellbender, and also the format of the h5 output files will be tweaked to be compatible with the
scanpy
v1.9+ data loader.Another option is to use this function
anndata_from_h5()
as inThis loads an AnnData object that can be used in scanpy as normal. It’s just a drop-in replacement for scanpy’s data loader.
Function below:
@sjfleming you might like https://github.com/scverse/scanpy/pull/2344 😃
Sure, here is an h5 output by cellbender that is parsed fine by scanpy v8 but not v9. Github doesn’t allow h5 uploads in comments so here’s a download link:
https://oc1.rnet.missouri.edu/index.php/s/fqOxxkjaxkcizUE/download