-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
celltype argument expected to have the same name in cell_transition
#743
Comments
|
I was able to run the codes with some minor adjustments. For example in @giovp 's case there was a typo and this runs: import moscot as mt
import anndata as ad
import pandas as pd
from moscot.problems.time import TemporalProblem
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["cluster2"] = pd.Categorical(np.random.choice(["a", "b"], size=len(adata))) # FIXED THE TYPO HERE
tp = TemporalProblem(adata).prepare(time_key="time").solve()
tp.cell_transition(1, 2, "cluster", "cluster2", forward=False) in @MUCDK 's case the source and target was mixed so this works: import pandas as pd
adata_sc.obs["test_col_1"] = pd.Categorical(np.random.choice(["a", "b"], size=len(adata_sc)))
adata_sp.obs["test_col_2"] = pd.Categorical(np.random.choice(["a", "b"], size=len(adata_sp)))
mp = MappingProblem(adata_sc, adata_sp)
mp = mp.prepare(
sc_attr={"attr": "obsm", "key": "X_pca"}, xy_callback="local-pca"
).solve(epsilon=10.0)
mp.cell_transition("src", "tgt", "test_col_2", "test_col_1") # here since test_col_1 was expected to be in src ie spatial data there was an error but this code now runs Update: Sorry last code block indeed fails I fixed my error in this PR: #751 |
Merged
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.this is different but related to #742
The text was updated successfully, but these errors were encountered: