
Plot the distribution of pseudotime across clusters
PlotPseudotime.RdEngine-agnostic pseudotime panel: takes any numeric meta.data
column, so the same function plots a Slingshot lineage
("Slingshot_Pseudotime_1"), a Monocle3 pseudotime
("Monocle3_Pseudotime"), or any other pseudotime-like column,
without re-implementing the same density/ridge plotting code per method.
Produces a density + rug plot (plot.type = "density", default) or a
ridge plot (plot.type = "ridge") of pseudotime per group.by
level, with peak labels for the density style. split.by/row.by
facet either style into column/row panels, the same way as every other
scSidekick plotting function.
Usage
PlotPseudotime(
seurat_object,
pseudotime.by,
group.by = NULL,
split.by = NULL,
row.by = NULL,
plot.type = c("density", "ridge"),
scales = "fixed",
ncol = NULL,
colors = NULL,
output_dir = NULL,
object_name = "",
subset_name = "",
file_name = NULL,
width = NULL,
height = NULL,
timestamp = FALSE
)Arguments
- seurat_object
A Seurat object.
- pseudotime.by
Character. Numeric
meta.datacolumn holding a pseudotime value (e.g. fromRunSlingshot).- group.by
Character or
NULL. Cluster/cell-type column - colors the density curves, or is the y-axis of the ridge plot.NULL(default) uses thecluster.bystored byRunSlingshotwhen present.- split.by
Character or
NULL. Creates column facets - one panel per level.NULL(default) = no column split.- row.by
Character or
NULL. Creates row facets, the same way assplit.by. Combined withsplit.byproduces a two-way grid.NULL(default) = no row split.- plot.type
One of
"density"(default: density + rug curves pergroup.bylevel, with peak labels) or"ridge"(one ridge pergroup.bylevel via ggridges).- scales
Character. Passed to
facet_wrap()/facet_grid()whensplit.by/row.byis set. Default"fixed".- ncol
Integer or
NULL. Facet columns when onlysplit.byis set.NULLauto-picks.- colors
Named color vector for
group.by.NULLauto-resolves fromPrepObjectorNour_pal.- output_dir
Character or
NULL. Directory to save a PDF.NULL(default) walks up to theoutput_dirstored byPrepObject(respectingAutoSavePlots); passNAto suppress entirely.- object_name, subset_name
Character. Output file-name prefixes.
- file_name
Character or
NULL. Base name (no extension) for the saved PDF.NULLauto-deduces frompseudotime.by,group.by,split.by, androw.by.- width, height
Numeric or
NULL. Saved PDF dimensions in inches.NULL(default) auto-sizes from the facet grid.- timestamp
Logical. When
TRUE, append a_YYYYMMDD-HHMMSSstamp to the saved file name so repeated runs are versioned instead of overwriting the previous PDF. DefaultFALSE.