moscot.problems.spatiotemporal.SpatioTemporalProblem.cell_transition¶
- SpatioTemporalProblem.cell_transition(source, target, source_groups, target_groups, forward=False, aggregation_mode='annotation', batch_size=None, normalize=True, key_added='cell_transition')¶
Aggregate the transport matrix.
See also
See Cell transitions on how to compute and
plotthe cell transitions.
- Parameters:
source (
TypeVar(K, bound=Hashable)) – Key identifying the source distribution.target (
TypeVar(K, bound=Hashable)) – Key identifying the target distribution.source_groups (
Union[str,Mapping[str,Sequence[Any]],None]) –Source groups used for aggregation. Valid options are:
target_groups (
Union[str,Mapping[str,Sequence[Any]],None]) –Target groups used for aggregation. Valid options are:
forward (
bool) – IfTrue, compute the transitions from thesource_groupsto thetarget_groups.aggregation_mode (
Literal['annotation','cell']) –How to aggregate the cell-level transport maps. Valid options are:
'annotation'- group the transitions by thesource_groupsand thetarget_groups.'cell'- do not group by thesource_groupsor thetarget_groups, depending on theforward.
batch_size (
Optional[int]) – Number of rows/columns of the cost matrix to materialize duringpush()orpull(). Larger value will require more memory.normalize (
bool) – IfTrue, normalize the transition matrix. Ifforward = True, the transition matrix will be row-stochastic, otherwise column-stochastic.key_added (
Optional[str]) – Key inunswhere to save the result.
- Return type:
- Returns:
: Depending on the
key_added:None- returns the transition matrix.str- returns nothing and saves the transition matrix touns['moscot_results']['cell_transition']['{key_added}']