cospar.tl.fate_hierarchy

cospar.tl.fate_hierarchy(adata, selected_fates=None, source='X_clone', selected_times=None, method='SW', normalize=True, ignore_cell_number=False)

Build fate hierarchy or lineage trees

Parameters
adata : AnnData object

Assume to contain transition maps at adata.uns.

selected_fates : list, optional (default: all fates)

List of cluster ids consistent with adata.obs[‘state_info’]. It allows a nested list, where we merge clusters within each sub-list into a mega-fate cluster.

source : str, optional (default: ‘transition_map’)

Choices: {‘X_clone’, ‘transition_map’, ‘intraclone_transition_map’,…}. If set to be ‘clone’, use only the clonal information. If set to be any of the precomputed transition map, use the transition map to compute the fate coupling. The actual available map depends on adata itself, which can be accessed at adata.uns[‘available_map’]

selected_times : list, optional (default: all)

A list of time points to further restrict the cell states to plot. The default choice is not to constrain the cell states to show.

method : str, optional (default: ‘SW’)

Method to normalize the coupling matrix: {‘SW’, ‘Weinreb’}.

normalize : bool

We normalize the count matrix first within each cluster, then, within each clone separately for each time point. This was set to be off in the original CoSpar publication.

ignore_cell_number : bool

Ignore the cell number of a clone within a cluster. i.e., binarize a clone’s contribution towards a cluster. This only works when ‘source=X_clone’ This biases towards large clusters, which will host many clones (most of them just a few cells)

Returns

Results stored at adata.uns[f”fate_hierarchy_{source}”]