cospar.pl.fate_map

cospar.pl.fate_map(adata, selected_fates=None, source='transition_map', selected_times=None, background=True, show_histogram=False, plot_target_state=False, auto_color_scale=True, color_bar=True, target_transparency=0.2, figure_index='', mask=None, color_map=<matplotlib.colors.LinearSegmentedColormap object>, **kwargs)

Plot transition probability to given fate/ancestor clusters.

The results should be pre-computed from cospar.tl.fate_map().

Parameters
adata : AnnData object

Assume to contain transition maps at adata.uns.

selected_fates : list

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

source : str

The transition map to be used for plotting: {‘transition_map’, ‘intraclone_transition_map’,…}. 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.

background : bool, optional (default: True)

If true, plot all cell states (t1+t2) in grey as the background.

show_histogram : bool, optional (default: False)

If true, show the distribution of inferred fate probability.

plot_target_state

If True, plot target states.

color_bar : bool, optional (default: True)

plot the color bar if True.

auto_color_scale

True: automatically rescale the color range to match the value range.

target_transparency : float, optional (default: 0.2)

It controls the transparency of the plotted target cell states, for visual effect. Range: [0,1].

figure_index : str, optional (default: ‘’)

String index for annotate filename for saved figures. Used to distinuigh plots from different conditions.

mask : np.array, optional (default: None)

A boolean array for available cell states. It should has the length as adata.shape[0]. Especially useful to constrain the states to show fate bias.

color_map

The color map (a matplotlib.pyplot.cm object) to visualize the result.