- dynamo.pd.least_action(adata, init_cells, target_cells, init_states=None, target_states=None, paired=True, min_lap_t=False, elbow_method='hessian', num_t=20, basis='pca', vf_key='VecFld', vecfld=None, adj_key='pearson_transition_matrix', n_points=25, init_paths=None, D=10, PCs=None, expr_func=<ufunc 'expm1'>, add_key=None, **kwargs)
Calculate the optimal paths between any two cell states.
AnnData) – Anndata object that has vector field function computed.
list]) – Cell name or indices of the initial cell states, that will be used to find the initial cell state when optimizing for the least action paths. If the names in init_cells not found in the adata.obs_name, it will be treated as cell indices and must be integers.
list]) – Cell name or indices of the terminal cell states , that will be used to find the target cell state when optimizing for the least action paths. If the names in init_cells not found in the adata.obs_name, it will be treated as cell indices and must be integers.
bool) – Whether the initial states and target states will be treated as pairs; if not, all combination of intial and target states will be used to find the least action paths between. When paired is used, the long list is trimmed to the same length of the shorter one.
str) – The embedding data to use for predicting the least action path. If basis is pca, the identified least action paths will be projected back to high dimensional space.
str) – A key to the vector field functions in adata.uns.
str) – The key to the adjacency matrix in adata.obsp
int) – Number of way points on the least action paths.
int) – The diffusion constant. In theory, the diffusion matrix needs to be a function of cell states but we use a constant for the purpose of simplicity.
callable) – The function that is applied before performing PCA analysis.
kwargs – Additional argument passed to least_action_path function.
A trajectory class containing the least action paths information. Meanwhile, the anndata object with be updated
with newly calculated least action paths information.