scverse/mudata

An error occurred when running mu.pp.neighbors()

Closed this issue · 0 comments

Describe the bug
An error occurred when running mu.pp.neighbors()

To Reproduce
import anndata as ad
import muon as mu

rna = ad.read_h5ad('SNARE_mousebrain_RNA.h5ad')
atac = ad.read_h5ad('1SNARE_mousebrain_ATAC.h5ad')
mdata = mu.MuData({"rna": rna, "atac": atac})
mu.pp.intersect_obs(mdata)
mdata.shape
mu.pp.neighbors(mdata, n_neighbors=20)

however, I get the following error message:
Traceback (most recent call last):
File "D:\PYTHON\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "D:\PYCHARM\TREASMO\XUNI\lib\site-packages\muon_core\preproc.py", line 623, in neighbors
mdata.obsp[conns_key] = connectivities
File "D:\PYCHARM\TREASMO\XUNI\lib\site-packages\anndata_core\aligned_mapping.py", line 181, in setitem
value = self._validate_value(value, key)
File "D:\PYCHARM\TREASMO\XUNI\lib\site-packages\anndata_core\alig
File "D:\PYTHON\lib\functools.py", line 875, in wrapper
return dispatch(args[0].class)(*args, **kw)
File "D:\PYCHARM\TREASMO\XUNI\lib\site-packages\anndata\utils.py", line 69, in dim_len
return x.shape[axis]
AttributeError: 'tuple' object has no attribute 'shape'

Expected behaviour
can you tell me how can i solve it? Thank you!!!

System

  • Windows11
  • Python3.8
  • anndata 0.9.2 muon 0.1.6

Additional context
Because the data is too large, it is compressed in separate volumes
1SNARE_mousebrain_ATAC.h5ad
1SNARE_mousebrain_ATAC(1).zip
1SNARE_mousebrain_ATAC (2).zip
1SNARE_mousebrain_ATAC.zip

SNARE_mousebrain_RNA.h5ad'
data1.zip