moscot.problems.time.LineageProblem.annotation_mapping#

LineageProblem.annotation_mapping(mapping_mode, annotation_label, forward, source, target, batch_size=None, cell_transition_kwargs=mappingproxy({}), **kwargs)#

Transfer annotations between distributions.

This function transfers annotations (e.g. cell type labels) between distributions of cells.

Parameters:
  • mapping_mode (Literal['sum', 'max']) –

    How to decide which label to transfer. Valid options are:

    • '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 (str) – Key in obs where the annotation is stored.

  • forward (bool) – If True, transfer the annotations from source to target.

  • source (TypeVar(K, bound= Hashable)) – Key identifying the source distribution.

  • target (TypeVar(K, bound= Hashable)) – Key identifying the target distribution.

  • batch_size (Optional[int]) – Number of rows/columns of the cost matrix to materialize during push() or pull(). Larger value will require more memory. If None, the entire cost matrix will be materialized.

  • cell_transition_kwargs (Mapping[str, Any]) – Keyword arguments for cell_transition(), used only if mapping_mode = 'sum'.

  • self (TemporalMixinProtocol[K, B]) –

  • kwargs (Mapping[str, Any]) –

Return type:

DataFrame

Returns:

: DataFrame - Returns the DataFrame of transferred annotations.