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.

  • 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 (numpy.ndarray or None (default: None)) – Initial cell states for the historical or future cell state prediction with numerical integration.

  • basis (str or None (default: None)) – The embedding data to use for predicting cell fate.

  • cores (int (default: 1):) – Number of cores to calculate nearest neighbor graph.

  • t_end (float (default None)) – 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 neighbos.

  • direction (string (default: both)) – The direction to predict the cell fate. One of the forward, backward`or `both string.

  • interpolation_num (int (default: 100)) – The number of uniformly interpolated time points.

  • metric (str or callable, default=’euclidean’) – The distance metric to use for the tree. The default metric is , and with p=2 is equivalent to the standard Euclidean metric. See the documentation of DistanceMetric 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 (dict, default=None) – Additional keyword arguments for the metric function.

  • seed (int (default 19491001)) – Random seed to ensure the reproducibility of each run.

  • kwargs – Additional arguments that will be passed to each nearest neighbor search algorithm.

Return type

Nothing but update the adata object with a new column in .obs that stores predicted ancestors or descendants.