diff --git a/src/moscot/problems/cross_modality/_mixins.py b/src/moscot/problems/cross_modality/_mixins.py index b428324f6..893b71abc 100644 --- a/src/moscot/problems/cross_modality/_mixins.py +++ b/src/moscot/problems/cross_modality/_mixins.py @@ -194,22 +194,20 @@ def annotation_mapping( # type: ignore[misc] forward: bool, source: str = "src", target: str = "tgt", - scale_by_marginals: bool = True, - other_adata: Optional[str] = None, cell_transition_kwargs: Mapping[str, Any] = types.MappingProxyType({}), ) -> pd.DataFrame: """Transfer annotations between distributions. - This function transfers annotation labels (e.g. cell types) between groups of cells. + This function transfers annotations (e.g. cell type labels) between distributions of cells. Parameters ---------- mapping_mode How to decide which label to transfer. Valid options are: - - ``'max'`` - pick the label of the annotated cell with the highest mapping weight. - - ``'sum'`` - compute :meth:`cell_transition` of annotation labels to target cells and - pick the label with the highest transition weight. + - ``'max'`` - pick the label of the annotated cell with the highest matching probability. + - ``'sum'`` - aggregate the annotated cells by label then + pick the label with the highest total matching probability. annotation_label Key in :attr:`~anndata.AnnData.obs` where the annotation is stored. forward @@ -218,10 +216,6 @@ def annotation_mapping( # type: ignore[misc] Key identifying the source distribution. target Key identifying the target distribution. - scale_by_marginals - Whether to scale by the source :term:`marginals`. - other_adata - The second :class:`anndata.AnnData` if present. cell_transition_kwargs Keyword arguments for :meth:`cell_transition`, used only if ``mapping_mode = 'sum'``. @@ -236,8 +230,7 @@ def annotation_mapping( # type: ignore[misc] target=target, key=self.batch_key, forward=forward, - other_adata=self.adata_tgt if other_adata is None else other_adata, - scale_by_marginals=scale_by_marginals, + other_adata=self.adata_tgt, cell_transition_kwargs=cell_transition_kwargs, ) diff --git a/src/moscot/problems/space/_mixins.py b/src/moscot/problems/space/_mixins.py index 651e5b733..5328d2c5a 100644 --- a/src/moscot/problems/space/_mixins.py +++ b/src/moscot/problems/space/_mixins.py @@ -291,21 +291,20 @@ def annotation_mapping( # type: ignore[misc] forward: bool, source: str = "src", target: str = "tgt", - scale_by_marginals: bool = True, cell_transition_kwargs: Mapping[str, Any] = types.MappingProxyType({}), ) -> pd.DataFrame: """Transfer annotations between distributions. - This function transfers annotation labels (e.g. cell types) between groups of cells. + This function transfers annotations (e.g. cell type labels) between distributions of cells. Parameters ---------- mapping_mode How to decide which label to transfer. Valid options are: - - ``'max'`` - pick the label of the annotated cell with the highest mapping weight. - - ``'sum'`` - compute :meth:`cell_transition` of annotation labels to target cells and - pick the label with the highest transition weight. + - ``'max'`` - pick the label of the annotated cell with the highest matching probability. + - ``'sum'`` - aggregate the annotated cells by label then + pick the label with the highest total matching probability. annotation_label Key in :attr:`~anndata.AnnData.obs` where the annotation is stored. forward @@ -314,8 +313,6 @@ def annotation_mapping( # type: ignore[misc] Key identifying the source distribution. target Key identifying the target distribution. - scale_by_marginals - Whether to scale by the source :term:`marginals`. cell_transition_kwargs Keyword arguments for :meth:`cell_transition`, used only if ``mapping_mode = 'sum'``. @@ -330,7 +327,6 @@ def annotation_mapping( # type: ignore[misc] target=target, key=self.batch_key, forward=forward, - scale_by_marginals=scale_by_marginals, cell_transition_kwargs=cell_transition_kwargs, ) @@ -630,21 +626,20 @@ def annotation_mapping( # type: ignore[misc] source: K, target: Union[K, str] = "tgt", forward: bool = False, - scale_by_marginals: bool = True, cell_transition_kwargs: Mapping[str, Any] = types.MappingProxyType({}), ) -> pd.DataFrame: """Transfer annotations between distributions. - This function transfers annotation labels (e.g. cell types) between groups of cells. + This function transfers annotations (e.g. cell type labels) between distributions of cells. Parameters ---------- mapping_mode How to decide which label to transfer. Valid options are: - - ``'max'`` - pick the label of the annotated cell with the highest mapping weight. - - ``'sum'`` - compute :meth:`cell_transition` of annotation labels to target cells and - pick the label with the highest transition weight. + - ``'max'`` - pick the label of the annotated cell with the highest matching probability. + - ``'sum'`` - aggregate the annotated cells by label then + pick the label with the highest total matching probability. annotation_label Key in :attr:`~anndata.AnnData.obs` where the annotation is stored. forward @@ -653,8 +648,6 @@ def annotation_mapping( # type: ignore[misc] Key identifying the source distribution. target Key identifying the target distribution. - scale_by_marginals - Whether to scale by the source :term:`marginals`. cell_transition_kwargs Keyword arguments for :meth:`cell_transition`, used only if ``mapping_mode = 'sum'``. @@ -670,7 +663,6 @@ def annotation_mapping( # type: ignore[misc] forward=forward, key=self.batch_key, other_adata=self.adata_sc, - scale_by_marginals=scale_by_marginals, cell_transition_kwargs=cell_transition_kwargs, ) diff --git a/src/moscot/problems/time/_mixins.py b/src/moscot/problems/time/_mixins.py index b45c732d6..5752a87da 100644 --- a/src/moscot/problems/time/_mixins.py +++ b/src/moscot/problems/time/_mixins.py @@ -247,21 +247,20 @@ def annotation_mapping( forward: bool, source: K, target: K, - scale_by_marginals: bool = True, cell_transition_kwargs: Mapping[str, Any] = types.MappingProxyType({}), ) -> pd.DataFrame: """Transfer annotations between distributions. - This function transfers annotation labels (e.g. cell types) between groups of cells. + This function transfers annotations (e.g. cell type labels) between distributions of cells. Parameters ---------- mapping_mode How to decide which label to transfer. Valid options are: - - ``'max'`` - pick the label of the annotated cell with the highest mapping weight. - - ``'sum'`` - compute :meth:`cell_transition` of annotation labels to target cells and - pick the label with the highest transition weight. + - ``'max'`` - pick the label of the annotated cell with the highest matching probability. + - ``'sum'`` - aggregate the annotated cells by label then + pick the label with the highest total matching probability. annotation_label Key in :attr:`~anndata.AnnData.obs` where the annotation is stored. forward @@ -270,8 +269,6 @@ def annotation_mapping( Key identifying the source distribution. target Key identifying the target distribution. - scale_by_marginals - Whether to scale by the source :term:`marginals`. cell_transition_kwargs Keyword arguments for :meth:`cell_transition`, used only if ``mapping_mode = 'sum'``. @@ -287,7 +284,6 @@ def annotation_mapping( key=self._temporal_key, forward=forward, other_adata=None, - scale_by_marginals=scale_by_marginals, cell_transition_kwargs=cell_transition_kwargs, )