mira.time.find_terminal_cells#

mira.time.find_terminal_cells(adata, iterations=1, max_termini=15, threshold=0.001, seed=None)#

Uses transport map to identify terminal cells where differentiation progress reaches a steady state. Results are stochastic based on SVD initialization.

Parameters
adataanndata.AnnData

Adata with a transition matrix in .obsp[“transport_map”]

iterationsint > 0, default = 1

Number of iterations to try eigenvector decomposition of transport map to find terminal cells.

max_terminiint > 0, default = 15

Maximum number of terminal cells that may be identified. Each possible terminal cell increases computation time.

thresholdfloat > 0, default = 1e-3

Terminal cells are taken from eigvectors with eigenvalues equal to 1. Treshold includes eigenvectors that are greater than 1 - threshold. To loosen the definition of terminal states and identify more cells, increase threshold, e.g. 1e-2.

seedint, default = None

Seed for terminal state calling. Seed initializes SVD decomposition of transport map.

Returns
terminal_cellslist[str]

List of terminal cell names

Examples

First, use find_terminal_cells to create a list of possible terminal states taken from the transport map.

>>> terminal_cells = mira.time.find_terminal_cells(data, threshold = 1e-2)

To elimnate spurious terminal states or to subset to apriori known termini, plot them like so:

>>> ax = sc.pl.umap(data, color = 'mira_pseudotime', show = False,
...   **umap_kwargs, color_map = 'magma')
>>> sc.pl.umap(data[terminal_cells], na_color = 'black', show = False, ax = ax, 
...   size = 200, title = 'Terminal Cells')
../_images/mira.time.find_terminal_cells.png

Note

This function is part of the mira.time API and works with several others to help users understand lineage structures and dynamic processes in their data. Please refer to the pseudotime trajectory inference tutorial.