scvelo.tl.terminal_states

scvelo.tl.terminal_states(data, vkey='velocity', groupby=None, groups=None, self_transitions=False, eps=0.001, copy=False, **kwargs)

Computes terminal states (root and end points).

The end points and root cells are obtained as stationary states of the velocity-inferred transition matrix and its transposed, respectively, which is given by left eigenvectors corresponding to an eigenvalue of 1, i.e.

\[μ^{\textrm{end}}=μ^{\textrm{end}} \pi, \quad μ^{\textrm{root}}=μ^{\textrm{root}} \pi^{\small \textrm{T}}.\]
scv.tl.terminal_states(adata)
scv.pl.scatter(adata, color=[ 'root_cells', 'end_points'])
https://user-images.githubusercontent.com/31883718/69496183-bcfdf300-0ecf-11ea-9aae-685300a0b1ba.png
Parameters:
data : AnnData

Annotated data matrix.

vkey : str (default: ‘velocity’)

Name of velocity estimates to be used.

groupby : str, list or np.ndarray (default: None)

Key of observations grouping to consider.

groups : str, list or np.ndarray (default: None)

Groups selected to find terminal states on. Must be an element of adata.obs[groupby].

self_transitions : bool (default: False)

Allow transitions from one node to itself.

eps : float (default: 1e-3)

Tolerance for eigenvalue selection.

copy : bool (default: False)

Return a copy instead of writing to data.

**kwargs

Passed to scvelo.tl.transition_matrix(), e.g. basis, weight_diffusion, scale_diffusion.

Returns:

  • Returns or updates data with the attributes
  • root_cells (.obs) – sparse matrix with transition probabilities.
  • end_points (.obs) – sparse matrix with transition probabilities.