cellrank.tl.kernels.VelocityKernel
- class cellrank.tl.kernels.VelocityKernel(adata, backward=False, xkey='Ms', vkey='velocity', **kwargs)[source]
Kernel which computes a transition matrix based on RNA velocity.
This borrows ideas from both [La Manno et al., 2018] and [Bergen et al., 2020]. In short, for each cell i, we compute transition probabilities \(p_{i, j}\) to each cell j in the neighborhood of i. The transition probabilities are computed as a multinomial logistic regression where the weights \(w_j\) (for all j) are given by the vector that connects cell i with cell j in gene expression space, and the features \(x_i\) are given by the velocity vector \(v_i\) of cell i.
- Parameters
adata (
anndata.AnnData
) – Annotated data object.backward (
bool
) – Direction of the process.xkey (
Optional
[str
]) – Key inanndata.AnnData.layers
where expected gene expression counts are stored.vkey (
Optional
[str
]) – Key inanndata.AnnData.layers
where velocities are stored.gene_subset – List of genes to be used to compute transition probabilities. If not specified, genes from
anndata.AnnData.var
['{vkey}_genes']
are used.kwargs (
Any
) – Keyword arguments for the parent class.
Attributes
Annotated data object.
Direction of the process.
Underlying base kernels.
Array of shape
(n_cells, n_cells)
containing unnormalized transition matrix.Parameters which are used to compute the transition matrix.
(n_cells, n_cells)
.Row-normalized transition matrix.
Methods
compute_transition_matrix
([model, ...])Compute transition matrix based on velocity directions on the local manifold.
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.