Skip to contents

Visualize VECTOR grid-level scores or direction arrows on the embedding used by RunVECTOR().

Usage

VECTORPlot(
  object,
  plot_type = c("grid", "raw"),
  tool_name = "VECTOR",
  score.name = "VECTOR_Score",
  group.by = NULL,
  background = c("auto", "score", "group", "none"),
  point.size = NULL,
  point.alpha = 0.7,
  grid.size = 2,
  arrow.linewidth = 0.5,
  arrow.length = grid::unit(0.035, "inches"),
  arrow.angle = 20,
  arrow.color = "grey20",
  title = NULL,
  subtitle = NULL,
  xlab = NULL,
  ylab = NULL,
  aspect.ratio = 1,
  legend.position = "right",
  legend.direction = "vertical",
  theme_use = "theme_scop",
  theme_args = list(),
  ...
)

Arguments

object

A Seurat object processed by RunVECTOR().

plot_type

Plot type. "grid" colors occupied grid centers by grid score, and "raw" draws VelocityPlot-style grid arrows.

tool_name

Name used in srt@tools.

score.name

Metadata column containing VECTOR scores.

group.by

Optional metadata column used as the background cell color for direction-field plots.

background

Background for plots. "score" uses FeatureDimPlot(), "group" uses CellDimPlot() and requires group.by, and "none" draws the flow field without cell points.

point.size

Cell point size. If NULL, uses the same default as FeatureDimPlot().

point.alpha

Cell point alpha.

grid.size

Grid-center point size.

arrow.linewidth

Direction arrow line width.

arrow.length

Arrow head length passed to grid::arrow().

arrow.angle

Arrow head angle passed to grid::arrow().

arrow.color

Direction arrow color.

title, subtitle, xlab, ylab

Plot labels. By default no title is shown.

aspect.ratio

Fixed aspect ratio.

legend.position, legend.direction

Legend position and direction.

theme_use, theme_args

Theme function and arguments.

...

Additional arguments passed to FeatureDimPlot() or CellDimPlot() when a cell background is requested.

Value

A ggplot object.

Examples

data(pancreas_sub)
pancreas_sub <- standard_scop(pancreas_sub)
#>  [2026-07-28 03:33:57] Start standard processing workflow...
#>  [2026-07-28 03:33:57] Checking a list of <Seurat>...
#> ! [2026-07-28 03:33:58] Data 1/1 of the `srt_list` is "unknown"
#>  [2026-07-28 03:33:58] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on 1/1 of `srt_list`...
#>  [2026-07-28 03:33:58] Perform `FindVariableFeatures()` on 1/1 of `srt_list`...
#>  [2026-07-28 03:33:58] Use the separate HVF from `srt_list`
#>  [2026-07-28 03:33:58] Number of available HVF: 2000
#>  [2026-07-28 03:33:58] Finished check
#>  [2026-07-28 03:33:58] Perform `ScaleData()`
#>  [2026-07-28 03:33:58] Perform pca linear dimension reduction
#>  [2026-07-28 03:33:59] Use stored estimated dimensions 1:23 for Standardpca
#>  [2026-07-28 03:33:59] Perform `Seurat::FindClusters()` with `cluster_algorithm = 'louvain'` and `cluster_resolution = 0.6`
#>  [2026-07-28 03:33:59] Reorder clusters...
#>  [2026-07-28 03:33:59] Skip `log1p()` because `layer = data` is not "counts"
#>  [2026-07-28 03:33:59] Perform umap nonlinear dimension reduction
#>  [2026-07-28 03:34:05] Standard processing workflow completed
pancreas_sub <- RunVECTOR(pancreas_sub, verbose = FALSE)
VECTORPlot(pancreas_sub, plot_type = "grid")

VECTORPlot(pancreas_sub, plot_type = "raw", group.by = "SubCellType")