Open rpadmanabhan opened 5 months ago
Although I'm not one of the original developers, I resolved this issue as follows - if you want to import the "leiden" column for example:
reader = scarf.H5adReader("/path/to/original/h5ad/file", cell_ids_key = "index", feature_ids_key = "gene_ids", feature_name_key = "gene_names")
writer = scarf.H5adToZarr(reader, zarr_loc = "path/to/zarr/file", assay_name = "RNA")
writer.dump()
ds = scarf.DataStore("path/to/zarr/file", nthreads = nthreads)
adata = sc.read_h5ad("path/to/original/h5ad/file")
leiden = adata.obs["leiden"]
ds.cells.insert(column_name = "leiden", values = leiden)
You can create a for loop if you want to import all the columns under obs
Describe the bug
When trying to convert an h5ad file to zarr format using scarf I find that categorical keys are ignored.
To Reproduce
Expected behavior Should import all fields under
obs
Scarf and Python version Scarf: 0.28.9 and Python 3.10.12