Skip to contents

Visualizes the ligands most likely to be driving the observed RNA velocities.

Usage

plot_velocity_ligands(
  adata,
  color = "dimgrey",
  alpha = 0.1,
  density = 3,
  arrow_size = 1,
  linewidth_scale = 2,
  vector_type = "stream",
  velocity_cluster_key = "vcluster",
  velocity_clusters = NULL,
  cell_palette = NULL,
  size = 100,
  velocity_cluster_palette = "gnuplot",
  label_fontsize = 15,
  top_n_ligands = 5L,
  figsize = c(10, 10),
  ve_plot_cutoff = FALSE,
  plot_output_path = "entrain_velocity_ligands.png"
)

Arguments

adata

Path to a .h5ad anndata object. Must have had entrain_velocity run on it.

color

scvelo.pl argument: Key for annotations of observations/cells or variables/genes. Use if you want dot color to denote a cell type or other annotation. Default is NULL - all cells are colored a single color denoted by argument cell_palette

alpha

Opacity of points.

density

Density of RNA velocity vectors.

arrow_size

Size of RNA velocity vector arrowhead.

linewidth_scale

Width of RNA velocity vector body.

vector_type

Whether to plot a scvelo.pl.velocity_embedding_stream() plot or a scvelo.pl.velocity_embedding_grid() plot. Default stream

velocity_cluster_key

Column name of adata.obs metadata denoting velocity clusters.

velocity_clusters

Values in adata.obs.velocity_cluster_key denoting which velocity clusters and their ligands to visualize. Defaults to NULL, in which it will plot the ligands for all positive variance explained velocity clusters

cell_palette

A matplotlib color palette for annotations denoted in argument color.

size

scvelo.pl.velocity_embedding argument: Size of points.

velocity_cluster_palette

A matplotlib color palette denoting colorscale of velocity clusters e.g., "Spectral". OR a single color in matplotlib.colors.CSS4_COLORS.keys() e.g. "black"; OR: A vector of hex codes with the same length as the number of velocity clusters being plotted e.g., c("#bfe5a0", "#9e0242", "#d8434e", "#f67b4a", "#5e4fa2").

label_fontsize

Font size of ligand labels

top_n_ligands

Number of top ligands to include in each label.

figsize

Figure size. Default is c(10,10)

ve_plot_cutoff

Whether to plot the results with VE above this limit. Default 0.0.

plot_output_path

Filename of plot to save.

Value

NULL. Saves a plot in working directory with name plot_output_path