cellrank.tl.lineages

cellrank.tl.lineages(adata, backward=False, copy=False, return_estimator=False, **kwargs)[source]

Compute probabilistic lineage assignment using RNA velocity.

For each cell i in \({1, ..., N}\) and initial or terminal state j in \({1, ..., M}\), the probability is computed that cell i is either going to terminal state j (backward=False) or is coming from initial state j (backward=True).

This function computes the absorption probabilities of a Markov chain towards the initial or terminaltates uncovered by cellrank.tl.initial_states() or cellrank.tl.terminal_states() using a highly efficient implementation that scales to large cell numbers.

It’s also possible to calculate mean and variance of the time until absorption for all or just a subset of the initial or terminal states. This can be seen as a pseudotemporal measure, either towards any terminal population of the state change trajectory, or towards specific ones.

Parameters
  • adata (anndata.AnnData) – Annotated data object.

  • backward (bool) – Direction of the process.

  • copy (bool) – Whether to update the existing adata object or to return a copy.

  • return_estimator (bool) – Whether to return the estimator. Only available when copy = False.

  • kwargs (Any) – Keyword arguments for cellrank.tl.estimators.BaseEstimator.compute_absorption_probabilities().

Return type

Optional[AnnData]

Returns

Depending on copy and return_estimator, either updates the existing adata object, returns its copy or returns the estimator.