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? 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
annotation_mapping
This happens when the method annotation_mapping is used in the MappingProblem,
MappingProblem
Here, the adata_sp has a batch value, and the annotation_mapping should be done for each batch separately. Howevr, this call would fail
adata_sp
mp.annotation_mapping( mapping_mode="max", source=0, target="ref", annotation_label="celltype", forward=False, )
and it can be fixed with
mp.adata_sc.obs["<batch_key>"] = 10
that is, passing a dummy batch key to the single cell data.
To reproduce
import anndata as ad import moscot as mt import pandas as pd from moscot import datasets from moscot.problems.space import MappingProblem adata_sc = mt.datasets.drosophila(spatial=False) adata_sp = datasets.drosophila(spatial=True) adata_sc, adata_sp adata_sp.obs["fov"] = 0 adata_sp2 = adata_sp.copy() adata_sp2.obs["fov"] = 1 adata_sp = ad.concat([adata_sp, adata_sp2]) adata_sc.obs["celltype"] = "annotation" adata_sc.obs["celltype"] = pd.Categorical(adata_sc.obs["celltype"]) adata_sp import pandas as pd adata_sp.obs["fov"] = pd.Categorical(adata_sp.obs["fov"]) mp = MappingProblem(adata_sc=adata_sc, adata_sp=adata_sp) mp = mp.prepare( sc_attr={"attr": "obsm", "key": "X_pca"}, xy_callback="local-pca", batch_key="fov" ) mp = mp.solve() mp mp.adata_sc.obs["fov"] = 10 # mp.adata_sc mp.annotation_mapping( mapping_mode="max", source=0, target="ref", annotation_label="celltype", forward=False, )
The text was updated successfully, but these errors were encountered:
cell_transition
resolved by #751
Sorry, something went wrong.
No branches or pull requests
This happens when the method
annotation_mapping
is used in theMappingProblem
,Here, the
adata_sp
has a batch value, and theannotation_mapping
should be done for each batch separately. Howevr, this call would failand it can be fixed with
that is, passing a dummy batch key to the single cell data.
To reproduce
Details
The text was updated successfully, but these errors were encountered: