Import CellRank as:

import cellrank as cr

Once velocities and the velocity graph have been computed using either scvelo or velocyto, CellRank offers two modes to interact with its core functionality:

Additionally, there is a set of plotting functions which can be used downstream of either analysis mode.

The utilities are mainly for fitting continuous models to gene expression data and are utilized in some of the plotting functions, like cellrank.pl.gene_trends().


This module offers a high-level API to compute cell fates and driver genes.

tl.transition_matrix(adata[, backward, …])

Compute a transition matrix based on a combination of RNA Velocity and transcriptomic or spatial similarity.

tl.initial_states(adata[, estimator, mode, …])

Find initial states of a dynamic process of single cells based on RNA velocity [Manno18].

tl.terminal_states(adata[, estimator, mode, …])

Find terminal states of a dynamic process of single cells based on RNA velocity [Manno18].

tl.lineages(adata[, backward, copy, …])

Compute probabilistic lineage assignment using RNA velocity.

tl.lineage_drivers(adata[, backward, …])

Compute driver genes per lineage.


Kernels are part of the low-level API and are used to estimate cell-to-cell transitions.

tl.kernels.VelocityKernel(adata[, backward, …])

Kernel which computes a transition matrix based on RNA velocity.

tl.kernels.ConnectivityKernel(adata[, …])

Kernel which computes transition probabilities based on similarities among cells.

tl.kernels.PseudotimeKernel(adata[, …])

Kernel which computes directed transition probabilities based on a KNN graph and pseudotime.

tl.kernels.CytoTRACEKernel(adata[, …])

Kernel which computes directed transition probabilities based on a KNN graph and the CytoTRACE score [Cyto20].


Kernel which contains a precomputed transition matrix.


Estimators predict cell fates using the transitions derived from Kernels.

tl.estimators.GPCCA(obj[, inplace, …])

Generalized Perron Cluster Cluster Analysis [GPCCA18] as implemented in pyGPCCA.

tl.estimators.CFLARE(obj[, inplace, …])

Compute the initial/terminal states of a Markov chain via spectral heuristics.


pl.initial_states(adata[, discrete, states, …])

Plot initial states uncovered by cellrank.tl.initial_states.

pl.terminal_states(adata[, discrete, …])

Plot terminal states uncovered by cellrank.tl.terminal_states.

pl.lineages(adata[, lineages, backward, …])

Plot lineages that were uncovered using cellrank.tl.lineages().

pl.lineage_drivers(adata, lineage[, …])

Plot lineage drivers that were uncovered using cellrank.tl.lineage_drivers().

pl.circular_projection(adata, keys[, …])

Plot absorption probabilities on a circular embedding as done in [Velten17].

pl.gene_trends(adata, model, genes[, …])

Plot gene expression trends along lineages.

pl.heatmap(adata, model, genes[, lineages, …])

Plot a heatmap of smoothed gene expression along specified lineages.

pl.cluster_lineage(adata, model, genes, lineage)

Cluster gene expression trends within a lineage and plot the clusters.

pl.cluster_fates(adata[, mode, backward, …])

Plot aggregate lineage probabilities at a cluster level.

pl.graph(data[, graph_key, ixs, layout, …])

Plot a graph, visualizing incoming and outgoing edges or self-transitions.


ul.models.GAM(adata[, n_knots, …])

Fit Generalized Additive Models (GAMs) using pygam.

ul.models.GAMR(adata[, n_knots, …])

Wrapper around R’s mgcv package for fitting Generalized Additive Models (GAMs).

ul.models.SKLearnModel(adata, model[, …])

Wrapper around sklearn.base.BaseEstimator.

ul.models.FittedModel(x_test, y_test[, …])

Class representing an already fitted model.

ul.models.FailedModel(model[, exc])

Model representing a failure of the original model.


read(path[, key, read_callback])

Read file and return anndata.AnnData object.



Development of the murine pancreas at E15.5 from [Panc19].


Regeneration of murine lung epithelial cells at 13 time points from [Lung20].

datasets.reprogramming([subset, path])

Reprogramming of mouse embryonic fibroblasts to induced endoderm progenitors at 8 time points from [Morris18].


Zebrafish embryogenesis assayed using drop-seq, restricted to the axial mesoderm lineage from [Farrel18].


Development of the murine pancreas at E15.5 from [Panc19], preprocessed according to the basic tutorial.