Skip to contents

RunSlingshot

Usage

RunSlingshot(
  srt,
  group.by,
  reduction = NULL,
  dims = NULL,
  start = NULL,
  end = NULL,
  prefix = NULL,
  reverse = FALSE,
  align_start = FALSE,
  show_plot = TRUE,
  lineage_palette = "Dark2",
  seed = 11,
  ...,
  verbose = TRUE
)

Arguments

srt

A Seurat object.

group.by

Metadata column(s) used to color cells.

reduction

Reduction to plot. NULL uses DefaultReduction.

dims

The dimensions to use for the Slingshot algorithm. Default is NULL, which uses first two dimensions.

start

The starting group for the Slingshot algorithm.

end

The ending group for the Slingshot algorithm.

prefix

The prefix to add to the column names of the resulting pseudotime variable.

reverse

Whether to reverse the pseudotime variable.

align_start

Whether to align the starting pseudotime values at the maximum pseudotime.

show_plot

Whether to show the dimensionality plot.

lineage_palette

The color palette to use for the lineages in the plot.

seed

Random seed.

...

Passed to the slingshot::slingshot function.

verbose

Whether to print messages.

Examples

data(pancreas_sub)
pancreas_sub <- RunStandardWorkflow(pancreas_sub)
#>  [2026-08-30 05:37:57] Start standard processing workflow...
#>  [2026-08-30 05:37:57] Checking a list of <Seurat>...
#> ! [2026-08-30 05:37:57] Data 1/1 of the `srt_list` is "unknown"
#> Warning: Data 1/1 of the `srt_list` is "unknown"
#>  [2026-08-30 05:37:57] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on 1/1 of `srt_list`...
#>  [2026-08-30 05:37:57] Perform `FindVariableFeatures()` on 1/1 of `srt_list`...
#>  [2026-08-30 05:37:57] Use the separate HVF from `srt_list`
#>  [2026-08-30 05:37:57] Number of available HVF: 2000
#>  [2026-08-30 05:37:57] Finished check
#>  [2026-08-30 05:37:57] Perform `ScaleData()`
#>  [2026-08-30 05:37:57] Perform pca linear dimension reduction
#>  [2026-08-30 05:37:58] Use stored estimated dimensions 1:23 for Standardpca
#>  [2026-08-30 05:37:58] Perform `Seurat::FindClusters()` with `cluster_algorithm = 'louvain'` and `cluster_resolution = 0.6`
#>  [2026-08-30 05:37:58] Reorder clusters...
#>  [2026-08-30 05:37:58] Skip `log1p()` because `layer = data` is not "counts"
#>  [2026-08-30 05:37:58] Perform umap nonlinear dimension reduction
#>  [2026-08-30 05:38:07] Standard processing workflow completed
pancreas_sub <- RunSlingshot(
  pancreas_sub,
  group.by = "SubCellType",
  reduction = "UMAP"
)
#> Warning: Removed 7 rows containing missing values or values outside the scale range
#> (`geom_path()`).
#> Warning: Removed 7 rows containing missing values or values outside the scale range
#> (`geom_path()`).

pancreas_sub <- RunSlingshot(
  pancreas_sub,
  group.by = "SubCellType",
  reduction = "PCA"
)
#> Warning: Removed 4 rows containing missing values or values outside the scale range
#> (`geom_path()`).
#> Warning: Removed 4 rows containing missing values or values outside the scale range
#> (`geom_path()`).

CellDimPlot(
  pancreas_sub,
  group.by = "SubCellType",
  reduction = "UMAP",
  lineages = paste0("Lineage", 1:2),
  lineages_span = 0.1
)


# 3D lineage
pancreas_sub <- RunSlingshot(
  pancreas_sub,
  group.by = "SubCellType",
  reduction = "StandardpcaUMAP3D"
)
#> Warning: Removed 7 rows containing missing values or values outside the scale range
#> (`geom_path()`).
#> Warning: Removed 7 rows containing missing values or values outside the scale range
#> (`geom_path()`).

CellDimPlot(
  pancreas_sub,
  group.by = "SubCellType",
  reduction = "UMAP",
  lineages = paste0("Lineage", 1:2),
  lineages_span = 0.1,
  lineages_trim = c(0.05, 0.95)
)