cospar.tl.iterative_differentiation

cospar.tl.iterative_differentiation(adata, selected_fates=None, source='transition_map', map_backward=True, map_threshold=0.1, apply_time_constaint=False)

Infer trajectory towards/from a cluster

If map_backward=True, infer the trajectory backward in time. Using inferred transition map, the inference is applied recursively. It starts with the cell states for the selected fate and uses the selected map to infer the immediate ancestor states. Then, using these putative ancestor states as the secondary input, it finds their immediate ancestors again. This goes on until all time points are exhausted.

It only works for transition map from multi-time clones.

Parameters
adata : AnnData object

Assume to contain transition maps at adata.uns.

selected_fate : str, or list

Targeted cluster of the trajectory, as consistent with adata.obs[‘state_info’] When it is a list, the listed clusters are combined into a single fate cluster.

used_Tmap : 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’]

map_backward : bool, optional (default: True)

If map_backward=True, show fate properties of initial cell states \(i\); otherwise, show progenitor properties of later cell states \(j\). This is used for building the fate map \(P_i(\mathcal{C})\). See fate_map().

map_threshold : float, optional (default: 0.1)

Relative threshold in the range [0,1] for truncating the fate map towards the cluster. Only states above the threshold will be selected.

apply_time_constaint : bool, optional (default: False)

If true, in each iteration of finding the immediate ancestor states, select cell states at the corresponding time point.

Returns

adata.obs[f’traj_{source}_{fate_name}’] (np.array) – The probability of each state to belong to a trajectory.