cellrank.tl.kernels.PseudotimeKernel

class cellrank.tl.kernels.PseudotimeKernel(adata, backward=False, time_key='dpt_pseudotime', **kwargs)[source]

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

The KNN graph contains information about the (undirected) connectivities among cells, reflecting their similarity. Pseudotime can be used to either remove edges that point against the direction of increasing pseudotime [Setty et al., 2019] or to downweight them [Stassen et al., 2021].

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

  • backward (bool) – Direction of the process.

  • time_key (str) – Key in anndata.AnnData.obs where the pseudotime is stored.

  • kwargs (Any) – Keyword arguments for the parent class.

Attributes

adata

Annotated data object.

backward

Direction of the process.

kernels

Underlying base kernels.

params

Parameters which are used to compute the transition matrix.

pseudotime

Pseudotemporal ordering of cells.

shape

(n_cells, n_cells).

transition_matrix

Row-normalized transition matrix.

Methods

compute_transition_matrix([...])

Compute transition matrix based on KNN graph and pseudotemporal ordering.

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.