, groups='louvain', use_rna_velocity=False, model='v1.2', copy=False)

Generate cellular maps of differentiation manifolds with complex topologies [Wolf17i].

By quantifying the connectivity of partitions (groups, clusters) of the single-cell graph, partition-based graph abstraction (PAGA) generates a much simpler abstracted graph (PAGA graph) of partitions, in which edge weights represent confidence in the presence of connections. By tresholding this confidence in scanpy.api.paga(), a much simpler representation of data can be obtained.

The confidence can be interpreted as the ratio of the actual versus the expected value of connetions under the null model of randomly connecting partitions. We do not provide a p-value as this null model does not precisely capture what one would consider “connected” in real data, hence it strongly overestimates the expected value. See an extensive discussion of this in [Wolf17i].

adata : AnnData

An annotated data matrix.

groups : key for categorical in adata.obs, optional (default: ‘louvain’)

You can pass your predefined groups by choosing any categorical annotation of observations (adata.obs).

use_rna_velocity : bool (default: False)

Use RNA velocity to orient edges in the abstracted graph and estimate transitions. Requires that adata.uns contains a directed single-cell graph with key ['velocity_graph']. This feature might be subject to change in the future.

model : {{'v1.2', 'v1.0'}}, optional (default: 'v1.2')

The PAGA connectivity model.

copy : bool, optional (default: False)

Copy adata before computation and return a copy. Otherwise, perform computation inplace and return None.


  • Returns or updates adata depending on copy with
  • connectivities (np.ndarray (adata.uns[‘connectivities’])) – The full adjacency matrix of the abstracted graph, weights correspond to confidence in the connectivities of partitions.
  • connectivities_tree (sc.sparse csr matrix (adata.uns[‘connectivities_tree’])) – The adjacency matrix of the tree-like subgraph that best explains the topology.


Together with a random walk-based distance measure, this generates a partial coordinatization of data useful for exploring and explaining its variation.

See also

pl.paga(), pl.paga_path(), pl.paga_compare()