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
plotthe 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 thanthresholdto \(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_groupsto 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 inunswhere to save the result.**kwargs (
Any) – The description is missing.
- 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}']