We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Describe the bug Running muon.pp.intersect_obs on a MuData object that contains an AnnData object with X=None, it fails
muon.pp.intersect_obs
X=None
To Reproduce
from anndata import AnnData import muon as mu from mudata import MuData import numpy as np import pandas as pd md = MuData({ "a": AnnData(None, obs=pd.DataFrame(index=["1", "2", "3"])), "b": AnnData(np.ones((2,2)), obs=pd.DataFrame(index=["2", "3"])) }) mu.pp.intersect_obs(md)
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/anaconda3/envs/scirpy_dev/lib/python3.9/site-packages/muon/_core/preproc.py in filter_obs(data, var, func) 713 try: --> 714 data._X = data.X[obs_subset, :] 715 except TypeError: TypeError: 'NoneType' object is not subscriptable During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) ~/tmp/ipykernel_979716/2023157240.py in <cell line: 1>() ----> 1 mu.pp.intersect_obs(md) ~/anaconda3/envs/scirpy_dev/lib/python3.9/site-packages/muon/_core/preproc.py in intersect_obs(mdata) 627 628 for mod in mdata.mod: --> 629 filter_obs(mdata.mod[mod], common_obs) 630 631 mdata.update_obs() ~/anaconda3/envs/scirpy_dev/lib/python3.9/site-packages/muon/_core/preproc.py in filter_obs(data, var, func) 714 data._X = data.X[obs_subset, :] 715 except TypeError: --> 716 data._X = data.X[np.where(obs_subset)[0], :] 717 # For some h5py versions, indexing arrays must have integer dtypes 718 # https://github.com/h5py/h5py/issues/1847
Expected behaviour Ignore X, intersect obs/obsm/... as usual
X
obs
obsm
System mudata master anndata master
Additional context AnnData objects generated by scirpy do not have a matrix in X, it only uses obs and obsm.
The text was updated successfully, but these errors were encountered:
580531c
No branches or pull requests
Describe the bug
Running
muon.pp.intersect_obs
on a MuData object that contains an AnnData object withX=None
, it failsTo Reproduce
Expected behaviour
Ignore
X
, intersectobs
/obsm
/... as usualSystem
mudata master
anndata master
Additional context
AnnData objects generated by scirpy do not have a matrix in X, it only uses
obs
andobsm
.The text was updated successfully, but these errors were encountered: