moscot.problems.spatiotemporal.SpatioTemporalProblem.sankey¶
- SpatioTemporalProblem.sankey(source, target, source_groups, target_groups, threshold=None, normalize=False, forward=True, restrict_to_existing=True, order_annotations=None, key_added='sankey', **kwargs)¶
Compute a Sankey diagram between cells across time points.
See also
See Sankey diagram on how to compute and
plot
the Sankey diagram.
- 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:
threshold (
Optional
[float
]) – Set cell transitions lower thanthreshold
to \(0\).normalize (
bool
) – IfTrue
, normalize the transition matrix. Ifforward = True
, the transition matrix will be row-stochastic, otherwise column-stochastic.forward (
bool
) – IfTrue
, compute the transitions from thesource_groups
to thetarget_groups
.restrict_to_existing (
bool
) – TODO(MUCDK)order_annotations (
Optional
[Sequence
[str
]]) – Order of annotations from top to bottom. IfNone
, use the order defined by the categories.key_added (
Optional
[str
]) – Key inuns
where to save the result.kwargs (
Any
) – Keyword arguments forcell_transition()
.self (TemporalMixinProtocol[K, B])
- Return type:
- Returns:
: Depending on the
key_added
:None
- returns the cell transitions.str
- returns nothing and saves the data for the diagram touns['moscot_results']['sankey']['{key_added}']