cellrank.tl.kernels.ConnectivityKernel¶

class
cellrank.tl.kernels.
ConnectivityKernel
(adata, backward=False, conn_key='connectivities', compute_cond_num=False, check_connectivity=False)[source]¶ Kernel which computes transition probabilities based on similarities among cells.
As a measure of similarity, we currently support:
transcriptomic similarities, computed using e.g.
scanpy.pp.neighbors()
, see [Wolf18].spatial similarities, computed using e.g.
squidpy.gr.spatial_neighbors()
, see [Palla21].
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 velocityderived transition matrix via
cellrank.tl.kernels.VelocityKernel
.Optionally, we apply a density correction as described in [Coifman05], where we use the implementation of [Haghverdi16].
 Parameters
adata¶ (
anndata.AnnData
) – Annotated data object.conn_key¶ (
str
) – Key inanndata.AnnData.obsp
to obtain the connectivity matrix, describing cellcell similarity.compute_cond_num¶ (
bool
) – Whether to compute condition number of the transition matrix. Note that this might be costly, since it does not use sparse implementation.check_connectivity¶ (
bool
) – Check whether the underlying KNN graph is connected.
Attributes
Annotated data object.
Direction of the process.
Condition number of the transition matrix.
Get the kernels of the kernel expression, except for constants.
Parameters which are used to compute the transition matrix.
Return rownormalized transition matrix.
Methods
compute_transition_matrix
([density_normalize])Compute transition matrix based on transcriptomic similarity.
copy
()Return a copy of self.
read
(fname)Deserialize self from a file.
write
(fname[, ext])Serialize self to a file.
write_to_adata
([key])Write the transition matrix and parameters used for computation to the underlying
adata
object.