Hi , ran into the same issue and after reinstalling muon I am still seeing the error.
Here is the error log:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[24], line 1
----> 1 mu.pp.intersect_obs(mdata)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/muon/_core/preproc.py:653, in intersect_obs(mdata)
650 common_obs = reduce(np.intersect1d, [m.obs_names for m in mdata.mod.values()])
652 for mod in mdata.mod:
--> 653 filter_obs(mdata.mod[mod], common_obs)
655 mdata.update_obs()
657 return
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/muon/_core/preproc.py:728, in filter_obs(data, var, func)
725 data._n_obs = data.obs.shape[0]
727 # Subset .obsm
--> 728 for k, v in data.obsm.items():
729 data.obsm[k] = v[obs_subset]
731 # Subset .obsp
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:423, in AlignedMappingProperty.__get__(self, obj, objtype)
421 return self # type: ignore
422 if not obj.is_view:
--> 423 return self.construct(obj, store=getattr(obj, f"_{self.name}"))
424 parent_anndata = obj._adata_ref
425 idxs = (obj._oidx, obj._vidx)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:406, in AlignedMappingProperty.construct(self, obj, store)
404 if self.axis is None:
405 return self.cls(obj, store=store)
--> 406 return self.cls(obj, axis=self.axis, store=store)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:295, in AxisArrays.__init__(self, parent, axis, store)
293 raise ValueError()
294 self._axis = axis
--> 295 super().__init__(parent, store=store)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:208, in AlignedActual.__init__(self, parent, store)
206 self._data = store
207 for k, v in self._data.items():
--> 208 self._data[k] = self._validate_value(v, k)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:277, in AxisArraysBase._validate_value(self, val, key)
275 msg = "Index.equals and pd.testing.assert_index_equal disagree"
276 raise AssertionError(msg)
--> 277 return super()._validate_value(val, key)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:96, in AlignedMappingBase._validate_value(self, val, key)
90 dims = tuple(("obs", "var")[ax] for ax in self.axes)
91 msg = (
92 f"Value passed for key {key!r} is of incorrect shape. "
93 f"Values of {self.attrname} must match dimensions {dims} of parent. "
94 f"Value had shape {actual_shape} while it should have had {right_shape}."
95 )
---> 96 raise ValueError(msg)
98 name = f"{self.attrname.title().rstrip('s')} {key!r}"
99 return coerce_array(val, name=name, allow_df=self._allow_df)
ValueError: Value passed for key 'X_pca' is of incorrect shape. Values of obsm must match dimensions ('obs',) of parent. Value had shape (8460,) while it should have had (7969,).
Even if i just try running mdata
I get the same error message but the log is different.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/IPython/core/formatters.py:770, in PlainTextFormatter.__call__(self, obj)
763 stream = StringIO()
764 printer = pretty.RepresentationPrinter(stream, self.verbose,
765 self.max_width, self.newline,
766 max_seq_length=self.max_seq_length,
767 singleton_pprinters=self.singleton_printers,
768 type_pprinters=self.type_printers,
769 deferred_pprinters=self.deferred_printers)
--> 770 printer.pretty(obj)
771 printer.flush()
772 return stream.getvalue()
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/IPython/lib/pretty.py:419, in RepresentationPrinter.pretty(self, obj)
408 return meth(obj, self, cycle)
409 if (
410 cls is not object
411 # check if cls defines __repr__
(...)
417 and callable(_safe_getattr(cls, "__repr__", None))
418 ):
--> 419 return _repr_pprint(obj, self, cycle)
421 return _default_pprint(obj, self, cycle)
422 finally:
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/IPython/lib/pretty.py:794, in _repr_pprint(obj, p, cycle)
792 """A pprint that just redirects to the normal repr function."""
793 # Find newlines and replace them with p.break_()
--> 794 output = repr(obj)
795 lines = output.splitlines()
796 with p.group():
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/mudata/_core/mudata.py:2427, in MuData.__repr__(self)
2426 def __repr__(self) -> str:
-> 2427 return self._gen_repr(self.n_obs, self.n_vars, extensive=True)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/mudata/_core/mudata.py:2419, in MuData._gen_repr(self, n_obs, n_vars, extensive, nest_level)
2408 for attr in [
2409 "obs",
2410 "var",
(...)
2416 "varp",
2417 ]:
2418 try:
-> 2419 keys = getattr(v, attr).keys()
2420 if len(keys) > 0:
2421 descr += f"\n{mod_indent} {attr}:\t{str(list(keys))[1:-1]}"
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:423, in AlignedMappingProperty.__get__(self, obj, objtype)
421 return self # type: ignore
422 if not obj.is_view:
--> 423 return self.construct(obj, store=getattr(obj, f"_{self.name}"))
424 parent_anndata = obj._adata_ref
425 idxs = (obj._oidx, obj._vidx)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:406, in AlignedMappingProperty.construct(self, obj, store)
404 if self.axis is None:
405 return self.cls(obj, store=store)
--> 406 return self.cls(obj, axis=self.axis, store=store)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:295, in AxisArrays.__init__(self, parent, axis, store)
293 raise ValueError()
294 self._axis = axis
--> 295 super().__init__(parent, store=store)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:208, in AlignedActual.__init__(self, parent, store)
206 self._data = store
207 for k, v in self._data.items():
--> 208 self._data[k] = self._validate_value(v, k)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:277, in AxisArraysBase._validate_value(self, val, key)
275 msg = "Index.equals and pd.testing.assert_index_equal disagree"
276 raise AssertionError(msg)
--> 277 return super()._validate_value(val, key)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:96, in AlignedMappingBase._validate_value(self, val, key)
90 dims = tuple(("obs", "var")[ax] for ax in self.axes)
91 msg = (
92 f"Value passed for key {key!r} is of incorrect shape. "
93 f"Values of {self.attrname} must match dimensions {dims} of parent. "
94 f"Value had shape {actual_shape} while it should have had {right_shape}."
95 )
---> 96 raise ValueError(msg)
98 name = f"{self.attrname.title().rstrip('s')} {key!r}"
99 return coerce_array(val, name=name, allow_df=self._allow_df)
ValueError: Value passed for key 'X_pca' is of incorrect shape. Values of obsm must match dimensions ('obs',) of parent. Value had shape (8460,) while it should have had (7969,).
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/IPython/core/formatters.py:406, in BaseFormatter.__call__(self, obj)
404 method = get_real_method(obj, self.print_method)
405 if method is not None:
--> 406 return method()
407 return None
408 else:
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/mudata/_core/mudata.py:2445, in MuData._repr_html_(self, expand)
2442 if OPTIONS["display_style"] == "text":
2443 from html import escape
-> 2445 return f"<pre>{escape(repr(self))}</pre>"
2447 if expand is None:
2448 expand = OPTIONS["display_html_expand"]
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/mudata/_core/mudata.py:2427, in MuData.__repr__(self)
2426 def __repr__(self) -> str:
-> 2427 return self._gen_repr(self.n_obs, self.n_vars, extensive=True)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/mudata/_core/mudata.py:2419, in MuData._gen_repr(self, n_obs, n_vars, extensive, nest_level)
2408 for attr in [
2409 "obs",
2410 "var",
(...)
2416 "varp",
2417 ]:
2418 try:
-> 2419 keys = getattr(v, attr).keys()
2420 if len(keys) > 0:
2421 descr += f"\n{mod_indent} {attr}:\t{str(list(keys))[1:-1]}"
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:423, in AlignedMappingProperty.__get__(self, obj, objtype)
421 return self # type: ignore
422 if not obj.is_view:
--> 423 return self.construct(obj, store=getattr(obj, f"_{self.name}"))
424 parent_anndata = obj._adata_ref
425 idxs = (obj._oidx, obj._vidx)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:406, in AlignedMappingProperty.construct(self, obj, store)
404 if self.axis is None:
405 return self.cls(obj, store=store)
--> 406 return self.cls(obj, axis=self.axis, store=store)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:295, in AxisArrays.__init__(self, parent, axis, store)
293 raise ValueError()
294 self._axis = axis
--> 295 super().__init__(parent, store=store)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:208, in AlignedActual.__init__(self, parent, store)
206 self._data = store
207 for k, v in self._data.items():
--> 208 self._data[k] = self._validate_value(v, k)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:277, in AxisArraysBase._validate_value(self, val, key)
275 msg = "Index.equals and pd.testing.assert_index_equal disagree"
276 raise AssertionError(msg)
--> 277 return super()._validate_value(val, key)
File ~/miniconda3/envs/single_cells/lib/python3.10/site-packages/anndata/_core/aligned_mapping.py:96, in AlignedMappingBase._validate_value(self, val, key)
90 dims = tuple(("obs", "var")[ax] for ax in self.axes)
91 msg = (
92 f"Value passed for key {key!r} is of incorrect shape. "
93 f"Values of {self.attrname} must match dimensions {dims} of parent. "
94 f"Value had shape {actual_shape} while it should have had {right_shape}."
95 )
---> 96 raise ValueError(msg)
98 name = f"{self.attrname.title().rstrip('s')} {key!r}"
99 return coerce_array(val, name=name, allow_df=self._allow_df)
ValueError: Value passed for key 'X_pca' is of incorrect shape. Values of obsm must match dimensions ('obs',) of parent. Value had shape (8460,) while it should have had (7969,).