pygot.tools.traj.fit_velocity_model_without_time

pygot.tools.traj.fit_velocity_model_without_time#

pygot.tools.traj.fit_velocity_model_without_time(adata, embedding_key, precomputed_pseudotime=None, kernel='dpt', connect_anchor=True, split_m=30, single_branch_detect=True, cytotrace=True, cell_type_key=None, plot=False, basis='umap', device=None, **kwargs)[source]#

Estimates velocities and fit trajectories in latent space WITHOUT time label.

Arguments:#

adata: AnnData

Annotated data matrix.

embedding_key: `str’

Name of latent space to fit, in adata.obsm

precomputed_pseudotime: str (default: None)

Name of precomputed pseudotime (in adata.obs), if offers, skip the searching of source cell and use precomputed time as time label to train model

kernel: ‘dpt’ or ‘palantir’ or ‘euclidean’ (default: ‘dpt’)

Pseudotime method, ‘dpt’ is recommended

connect_anchor: bool (default: False)

Use extrema in diffusion map space to connect the whole graph

split_m: int (default: 30)

Number of split. This number should NOT be too small

single_branch_detect: bool (default: True)

Auto detect single branch so that auto determine use ct_root or ot_ct_root as source cell

cytotrace: bool (default: True)

Use cytotrace to help. Note cytorace is implemented by Cellrank2

cell_type_key: str (default: None)

Cell cluster name, in adata.obs.

plot: bool (default: False)

Plot the intermediate process

basis: str (default: ‘umap’)

Visualization space

device: device

torch device

kwargs:

parameter of pygot.tl.traj.fit_velocity_model

returns:
  • model (:class`~ODEwrapper`) – velocity model

  • ot_root (.uns) (int) – best source cell index using transport cost only

  • ot_ct_root (.uns) (int) – best source cell index using both transport cost and cytotrace

  • root_score (.obs) (np.ndarray) – source cell score (higher score higher probability to be source)

  • ot_root_score (.obs) (np.ndarray) – source cell score + alpha * cytotrace score (higher score higher probability to be source)

  • expectation (.obs) (np.ndarray) – updated time