Skip to content

Commit 13eb3e2

Browse files
committed
Set var index names in from_h5ad_to_h5mu
1 parent db4e12e commit 13eb3e2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/convert/from_h5ad_to_h5mu/script.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@
2929
}
3030

3131
logger.info("Converting to mudata")
32+
var_index_names = {key: adata.var.index.name for key, adata in data.items()}
3233
mudata = mu.MuData(data)
3334

3435
try:
3536
mudata.var_names_make_unique()
3637
except (TypeError, ValueError):
3738
pass
3839

40+
# Set var index names to avoid https://github.com/scverse/mudata/issues/146
41+
for key, name in var_index_names.items():
42+
mudata.mod[key].var.index.name = name
43+
3944
logger.info("Writing to %s.", par["output"])
4045
mudata.write_h5mu(par["output"], compression=par["output_compression"])
4146

0 commit comments

Comments
 (0)