cellrank.tl.kernels.ConnectivityKernel

class cellrank.tl.kernels.ConnectivityKernel(adata, conn_key='connectivities', check_connectivity=False)[source]

Kernel which computes transition probabilities based on similarities among cells.

As a measure of similarity, we currently support:

The resulting transition matrix is symmetric and thus cannot be used to learn about the direction of the biological process. To include this direction, consider combining with a velocity-derived transition matrix via cellrank.kernels.VelocityKernel.

Optionally, we apply a density correction as described in [Coifman et al., 2005], where we use the implementation of [Haghverdi et al., 2016].

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

  • conn_key (str) – Key in anndata.AnnData.obsp where connectivity matrix describing cell-cell similarity is stored.

  • check_connectivity (bool) – Check whether the underlying kNN graph is connected.

Attributes

adata

Annotated data object.

backward

None.

kernels

Underlying base kernels.

params

Parameters which are used to compute the transition matrix.

shape

(n_cells, n_cells).

transition_matrix

Row-normalized transition matrix.

Methods

compute_transition_matrix([density_normalize])

Compute transition matrix based on transcriptomic similarity.

copy(*[, deep])

Return a copy of itself.

plot_projection([basis, key_added, ...])

Plot transition_matrix as a stream or a grid plot.

plot_random_walks([n_sims, max_iter, seed, ...])

Plot random walks in an embedding.

plot_single_flow(cluster, cluster_key, time_key)

Visualize outgoing flow from a cluster of cells [Mittnenzweig et al., 2021].

read(fname[, adata, copy])

Deserialize self from a file.

write(fname[, write_adata, ext])

Serialize self to a file.

write_to_adata([key, copy])

Write the transition matrix and parameters used for computation to the underlying adata object.