moscot.problems.time.TemporalProblem.annotation_mapping¶
- TemporalProblem.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 inobs
where the annotation is stored.forward (
bool
) – IfTrue
, transfer the annotations fromsource
totarget
.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 duringpush()
orpull()
. Larger value will require more memory. IfNone
, the entire cost matrix will be materialized.cell_transition_kwargs (
Mapping
[str
,Any
]) – Keyword arguments forcell_transition()
, used only ifmapping_mode = 'sum'
.self (TemporalMixinProtocol[K, B])
- Return type:
- Returns:
:
DataFrame
- Returns the DataFrame of transferred annotations.