I've tested the patch but I still see the same error. Strangely, the error disappears upon forcing my ADT matrix to a sparse matrix using Seurat::as.sparse. Now I can load my mudata file.
Originally posted by @mdmanurung in #2 (comment)
I have the same issue on the bonemarrow data used to illustrate the package functionality
library(SeuratData)
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
library(MuDataSeurat)
WriteH5MU(bm, "bmcite.h5mu")
test<- ReadH5MU("bmcite.h5mu")
Error in `.rowNamesDF<-`(x, value = value) :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘CD14’, ‘CD19’, ‘CD27’, ‘CD28’, ‘CD34’, ‘CD38’, ‘CD4’, ‘CD69’
also reading the same object in python fails (with or without using seurat::as.sparse on the ADT)
import muon as mu
mu.read_h5mu("bmcite.h5mu")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/fabiola.curion/Documents/devel/miniconda3/envs/R405py39/lib/python3.9/site-packages/mudata/_core/io.py", line 380, in read_h5mu
ad = _read_h5mu_mod(gmods[m], manager, backed not in (None, False))
File "/Users/fabiola.curion/Documents/devel/miniconda3/envs/R405py39/lib/python3.9/site-packages/mudata/_core/io.py", line 513, in _read_h5mu_mod
ad = AnnData(**d)
File "/Users/fabiola.curion/Documents/devel/miniconda3/envs/R405py39/lib/python3.9/site-packages/anndata/_core/anndata.py", line 291, in __init__
self._init_as_actual(
File "/Users/fabiola.curion/Documents/devel/miniconda3/envs/R405py39/lib/python3.9/site-packages/anndata/_core/anndata.py", line 521, in _init_as_actual
self._check_dimensions()
File "/Users/fabiola.curion/Documents/devel/miniconda3/envs/R405py39/lib/python3.9/site-packages/anndata/_core/anndata.py", line 1843, in _check_dimensions
raise ValueError(
ValueError: Observations annot. `obs` must have number of rows of `X` (25), but has 30672 rows.