moscot icon indicating copy to clipboard operation
moscot copied to clipboard

celltype argument expected to have the same name in `cell_transition`

Open giovp opened this issue 6 months ago • 1 comments

originally reported by @soerenab ,

The code below throws an error. Basically, it should be possible to have 2 clusters have different names, and still compute the cell_transition output.

adata = mt.datasets.bone_marrow(rna=True)
adata.obs["time"] = 1
adata2 = adata.copy()
adata2.obs["time"] = 2
adata = ad.concat([adata, adata2])
adata.obs["time"] = pd.Categorical(adata.obs["time"])
adata.obs["cluster"] = pd.Categorical(np.random.choice(["a", "b"], size=len(adata)))
adata.obs["cluste2"] = pd.Categorical(np.random.choice(["a", "b"], size=len(adata)))
tp = TemporalProblem(adata).prepare(time_key="time").solve()
tp.cell_transition(1, 2, "cluster", "cluster2", forward=False)

this is different but related to #742

giovp avatar Sep 05 '24 17:09 giovp