mira.time.get_transport_map#

mira.time.get_transport_map(adata, start_cell=None, diffmap_distances_key='X_diffmap_distances', diffmap_coordinates_key='X_diffmap', ka=5, n_jobs=1)#

Calculate pseudotime and stochastic forward markov model of differentiation. Each cell is assigned a pseudotime based on its progress through a differentiation. Each cell is also given transition probabilities to other cells within the KNN graph. Transitions prioritize forward progress to more differentiated states.

Parameters
adataanndata.AnnData

Adata with connected components labeled in .obs[“mira_connected_components”]

kaint > 5, default = 5

Kernel width. The standard deviation of the adaptive gaussian kernel used to convert distances to affinities is taken to be the distance between the current cell and the cell’s *ka*th nearest neighbor.

n_jobsint > 0, default = 1

Number of cores to use for pseudotime calculation.

start_cellint or barcode

Cell representing start state of differentiation.

diffmap_distances_keystr, default = “X_diffmap_distances”

Key in .obsp to find distance matrix between cells. By default, uses distance between cells in diffusion space. Providing “distances” will directly use Joint KNN graph without diffusion smoothing.

diffmap_coordinates_keystr, default = “X_diffmap”

Key in .obsm which holds the coordinates of cells used to calculate the distances in diffmap_distances_key.

Returns
adataanndata.AnnData
.obs[“mira_pseudotime”]np.ndarray[float] of shape (n_cells,)

Pseudotime of cells

.obsp[“transport_map”]scipy.spmatrix[float] of shape (n_cells, n_cells)

Sparse matrix of transition probabilities between cells.

.uns[“start_cell”]str

name/id of start cell

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.