CytoTRACEKernel(adata, backward=False, layer='Ms', aggregation='mean', use_raw=False, compute_cond_num=False, check_connectivity=False)¶
Kernel which computes directed transition probabilities based on a KNN graph and the CytoTRACE score [Cyto20].
The KNN graph contains information about the (undirected) connectivities among cells, reflecting their similarity. CytoTRACE can be used to estimate cellular plasticity and in turn, a pseudotemporal ordering of cells from more plastic to less plastic states. This kernel internally uses the
cellrank.tl.kernels.PseudotimeKernelto direct the KNN graph on the basis of the CytoTRACE-derived pseudotime.
How to aggregate expression of the top-correlating genes. Valid options are:
’mean’: arithmetic mean.
’gmean’: geometric mean.
’hmean’: harmonic mean.
import scvelo as scv import cellrank as cr adata = cr.datasets.pancreas() sc.pp.filter_genes(adata, min_cells=10) adata.raw = adata.copy() sc.pp.normalize_total(adata) sc.pp.log1p(adata) sc.pp.highly_variable_genes(adata) if 'spliced' not in adata.layers or 'unspliced' not in adata.layers: # use the following trick to get scvelo's moments function working adata.layers['spliced'] = adata.X adata.layers['unspliced'] = adata.X scv.pp.moments(adata, n_pcs=None, n_neighbors=None)
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.
Pseudotemporal ordering of cells.
Return row-normalized transition matrix.
compute_cytotrace([layer, aggregation, use_raw])
Re-implementation of the CytoTRACE algorithm [Cyto20] to estimate cellular plasticity.
compute_projection([basis, key_added, copy])
Compute a projection of the transition matrix in the embedding.
Compute transition matrix based on KNN graph and pseudotemporal ordering.
Return a copy of self.
plot_random_walks(n_sims[, max_iter, seed, …])
Plot random walks in an embedding.
Deserialize self from a file.
Serialize self to a file.
Write the transition matrix and parameters used for computation to the underlying