- dynamo.tl.score_cells(adata, genes=None, layer=None, basis=None, n_neighbors=30, beta=0.1, iteration=5, metric='euclidean', metric_kwds=None, cores=1, seed=19491001, return_score=True, **kwargs)
Score cells based on a set of genes.
AnnData) – an AnnData object that contains the reconstructed vector field function in the uns attribute.
str]]) – the gene names whose gene expression will be used for predicting cell fate. By default (when genes is set to None), the genes used for velocity embedding (var.use_for_transition) will be used for vector field reconstruction. Note that the genes to be used need to have velocity calculated and corresponds to those used in the dyn.tl.VectorField function. Defaults to None.
str]) – which layer of the data will be used for predicting cell fate with the reconstructed vector field function. The layer once provided, will override the basis argument and then predicting cell fate in high dimensional space. Defaults to None.
str]) – the embedding data to use for predicting cell fate. If basis is either umap or pca, the reconstructed trajectory will be projected back to high dimensional space via the inverse_transform function. Defaults to None.
int) – number of nearest neighbors. Defaults to 30.
float) – the weight that will apply to the current query cell. Defaults to 0.1.
int) – number of smooth iterations. Defaults to 5.
Callable]) – 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
DistanceMetricfor 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. Defaults to “euclidean”.
int) – the number of parallel jobs to run for neighbors search. None means 1 unless in a joblib.parallel_backend context. -1 means using all processors. Defaults to 1.
int) – random seed to ensure the reproducibility of each run. Defaults to 19491001.
bool) – whether to return the score. If False, save the smoothed score to cell_scores column in the .obs attribute and also to the dictionary corresponding to the score_cells key in the .uns attribute. Defaults to True.
- Return type:
The calculated cell scores if return score is true, otherwise the scores would be updated as annotations of the AnnData object inplace.