CFLARE.set_terminal_states(labels, cluster_key=None, en_cutoff=None, p_thresh=None, add_to_existing=False, **kwargs)

Set the approximate recurrent classes, if they are known a priori.

  • labels (Union[Series, Dict[str, Any]]) – Either a categorical pandas.Series with index as cell names, where NaN marks marks a cell belonging to a transient state or a dict, where each key is the name of the recurrent class and values are list of cell names.

  • cluster_key (Optional[str]) – If a key to cluster labels is given, terminal_states will ge associated with these for naming and colors.

  • en_cutoff (Optional[float]) – If cluster_key is given, this parameter determines when an approximate recurrent class will be labelled as ‘Unknown’, based on the entropy of the distribution of cells over transcriptomic clusters.

  • p_thresh (Optional[float]) – If cell cycle scores were provided, a Wilcoxon rank-sum test is conducted to identify cell-cycle states. If the test returns a positive statistic and a p-value smaller than p_thresh, a warning will be issued.

  • add_to_existing (bool) – Whether to add thses categories to existing ones. Cells already belonging to recurrent classes will be updated if there’s an overlap. Throws an error if previous approximate recurrent classes have not been calculated.


Nothing, but updates the following fields:

Return type