dynamo.pd.andecestor
- dynamo.pd.andecestor(adata, init_cells, init_states=None, cores=1, t_end=50, basis='umap', n_neighbors=5, direction='forward', interpolation_num=250, last_point_only=False, metric='euclidean', metric_kwds=None, seed=19491001, **kwargs)[source]
Predict the ancestors or descendants of a group of initial cells (states) with the given vector field function.
- Parameters:
adata (
AnnData
) – AnnData object that contains the reconstructed vector field function in the uns attribute.init_cells (
List
) – Cell name or indices of the initial cell states for the historical or future cell state prediction with numerical integration. If the names in init_cells not found in the adata.obs_name, it will be treated as cell indices and must be integers.init_states (
Optional
[ndarray
]) – Initial cell states for the historical or future cell state prediction with numerical integration.basis (
str
) – The key in adata.obsm that points to the embedding data to use for predicting cell fate.cores (
int
) – Number of cores to calculate nearest neighbor graph.t_end (
int
) – The length of the time period from which to predict cell state forward or backward over time. This is used by the odeint function.n_neighbors (
int
) – Number of nearest neighbors.direction (
str
) – The direction to predict the cell fate. One of the forward, backward or both string.interpolation_num (
int
) – The number of uniformly interpolated time points.metric (
str
) – The distance metric to use for the tree. The default metric is ‘euclidean’, and with p=2 is equivalent to the standard Euclidean metric. See the documentation ofDistanceMetric
for a list of available metrics. If metric is “precomputed”, X is assumed to be a distance matrix and must be square during fit. X may be a sparse graph, in which case only “nonzero” elements may be considered neighbors.metric_kwds (
Optional
[dict
]) – Additional keyword arguments for the metric function.seed (
int
) – Random seed to ensure the reproducibility of each run.kwargs – Additional arguments that will be passed to each nearest neighbor search algorithm.
- Return type:
- Returns:
Nothing but update the adata object with a new column in .obs that stores predicted ancestors or descendants.