cellrank.tl.estimators.GPCCA.set_terminal_states
- GPCCA.set_terminal_states(labels, cluster_key=None, add_to_existing=False, **kwargs)
Manually define terminal states.
- Parameters
labels (
Union
[Series
,Dict
[str
,Sequence
[Any
]]]) –Defines the terminal states. Valid options are:
categorical
pandas.Series
where each category corresponds to a terminal state. NaN entries denote cells that do not belong to any terminal state, i.e. these are either initial or transient cells.dict
where keys are terminal states and values are lists of cell barcodes corresponding to annotations inadata.AnnData.obs_names
. If only 1 key is provided, values should correspond to terminal state clusters if a categoricalpandas.Series
can be found inanndata.AnnData.obs
.
cluster_key (
Optional
[str
]) – Key inanndata.AnnData.obs
in order to associate names and colors withterminal_states
. Each terminal state will be given the name and color corresponding to the cluster it mostly overlaps with.add_to_existing (
bool
) – Whether the new terminal states should be added to pre-existing ones. Cells already assigned to a terminal state will be re-assigned to the new terminal state if there’s a conflict between old and new annotations. This throws an error if no previous annotations corresponding to terminal states have been found.
- Return type
- Returns
Nothing, just updates the following fields:
terminal_states
- Categorical annotation of terminal states.terminal_states_probabilities
- Aggregated probability of cells to be in terminal states.