cellrank.external.kernels.OTKernel¶
-
class
cellrank.external.kernels.
OTKernel
(adata, g, terminal_states=None, cluster_key=None, **kwargs)[source]¶ Stationary optimal transport kernel from [Zhang21].
This class requires the statOT package, which can be installed as pip install statot POT.
- Parameters
adata¶ (
anndata.AnnData
) – Annotated data object.terminal_states¶ (
Union
[str
,Series
,None
]) – Categoricalpandas.Series
where non-NaN values mark terminal states. If None, terminal states are assumed to be already present inadata
['terminal_states']
.g¶ (
Union
[str
,ndarray
]) – Key inanndata.AnnData.obs
containing relative growth rates for cells or the array itself.cluster_key¶ (
Optional
[str
]) – If a key to cluster labels is given, terminal_states will be associated with these for naming and colors.
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 row-normalized transition matrix.
Methods
compute_projection
([basis, key_added, copy])Compute a projection of the transition matrix in the embedding.
compute_transition_matrix
(eps, dt[, basis, …])Compute transition matrix using stationary OT [Zhang21].
copy
()Return a copy of itself.
plot_random_walks
(n_sims[, max_iter, seed, …])Plot random walks in an embedding.
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.