Skip to contents

Use Leiden algorithm to cluster the velocities into discrete groups representing differentiation activity.

Usage

entrain_cluster_velocities(
  adata,
  velocity_cluster_key = "vcluster",
  resolution = 0.05,
  save_adata = NULL,
  plot_output_path = "velocity_clusters.png",
  vector_type = "stream",
  reduction_key = NULL,
  ...
)

Arguments

adata

An anndata file containing velocities.

velocity_cluster_key

Column name of the cluster labels in the metadata of adata_clustered. Can be calculated manually in scvelo with scvelo.tl.velocity_clusters().

resolution

Optional argument defining resolution of velocity clustering. Default 0.05.

save_adata

Optional. Filename of anndata object to write results to. If not given or NULL, anndata will not be saved. Recommended if you want to re-run or continue analysis in scanpy/scvelo.

plot_output_path

Plot file name. Default is "velocity_clusters.png".

vector_type

Vector types to plot. Only used with plot_output_path is not NULL. Either "grid" or "stream". Default "stream".

reduction_key

Dimension reduction to plot. Only use when plot_output_path is not NULL.

...

Arguments to pass to scvelo.pl.velocity_embedding_stream() or scvelo.pl.velocity_embedding_grid(), depending on vector_type

Value

Anndata object with velocity clusters denoted in adata.obs.<velocity_cluster_key>