Mudata object can't be updated after slicing the mod's anndata and then slicing the mudata.
To Reproduce
import scanpy as sc
import muon as mu
import pandas as pd
ad_1 = sc.AnnData(pd.DataFrame([list(range(5))] * 3))
ad_2 = sc.AnnData(pd.DataFrame([list(range(6))] * 5))
md = mu.MuData({'a':ad_1, 'b': ad_2})
print(md)
#MuData object with n_obs × n_vars = 5 × 11
# 2 modalities
# a: 3 x 5
# b: 5 x 6
md.mod['a'] = md.mod['a'][:, :2]
md.update()
md = md[:2]
md.update()
# ValueError: Value passed for key 'a' is of incorrect shape. Values of varm must match dimensions (1,) of parent. Value had shape (2,) while it should have had (8,).
Describe the bug
Mudata object can't be updated after slicing the mod's anndata and then slicing the mudata. To Reproduce