Plot CytoTRACE 2 Results
Usage
CytoTRACEPlot(
srt,
reduction = NULL,
group.by = NULL,
combine = TRUE,
nrow = NULL,
ncol = NULL,
byrow = TRUE,
pt.size = NULL,
pt.alpha = 1,
palette = "Chinese",
palcolor = NULL,
theme_use = "theme_scop",
theme_args = list(),
verbose = TRUE,
...
)Arguments
- srt
A
Seuratobject.- reduction
Reduction to plot.
NULLuses DefaultReduction.- group.by
Metadata column(s) used to color cells.
- combine, nrow, ncol, byrow
Combine plots with patchwork.
combine = FALSEreturns a list of ggplots.- pt.size, pt.alpha
Point size and transparency.
pt.size = NULLscales withsqrt(n)(minimum0.3). Rasterized points keep at least a two-pixel radius atraster.dpi = c(512, 512)and scale withraster.dpi.- palette, palcolor
Palette name (thisplot::show_palettes) or custom colors.
- theme_use, theme_args
Theme name or function, plus extra theme arguments.
- verbose
Whether to print the message. Default is
TRUE.- ...
Passed to CellDimPlot and FeatureDimPlot.
Value
If combine = TRUE, returns a patchwork object combining all plots.
If combine = FALSE, returns a named list of ggplot objects:
Score: UMAP plot colored by score computed by CytoTRACE2;Potency: UMAP plot colored by potency category computed by CytoTRACE2;Relative: UMAP plot colored by relative score computed by CytoTRACE2;Phenotype: UMAP plot colored by phenotype (ifgroup.byis provided);Boxplot: Boxplot of score computed by CytoTRACE2 corresponding to phenotype (ifgroup.byis provided).
Examples
data(pancreas_sub)
pancreas_sub <- RunStandardWorkflow(pancreas_sub)
#> ℹ [2026-08-30 04:09:16] Start standard processing workflow...
#> ℹ [2026-08-30 04:09:16] Checking a list of <Seurat>...
#> ! [2026-08-30 04:09:16] Data 1/1 of the `srt_list` is "unknown"
#> Warning: Data 1/1 of the `srt_list` is "unknown"
#> ℹ [2026-08-30 04:09:16] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on 1/1 of `srt_list`...
#> ℹ [2026-08-30 04:09:16] Perform `FindVariableFeatures()` on 1/1 of `srt_list`...
#> ℹ [2026-08-30 04:09:16] Use the separate HVF from `srt_list`
#> ℹ [2026-08-30 04:09:16] Number of available HVF: 2000
#> ℹ [2026-08-30 04:09:16] Finished check
#> ℹ [2026-08-30 04:09:16] Perform `ScaleData()`
#> ℹ [2026-08-30 04:09:16] Perform pca linear dimension reduction
#> ℹ [2026-08-30 04:09:17] Use stored estimated dimensions 1:23 for Standardpca
#> ℹ [2026-08-30 04:09:17] Perform `Seurat::FindClusters()` with `cluster_algorithm = 'louvain'` and `cluster_resolution = 0.6`
#> ℹ [2026-08-30 04:09:17] Reorder clusters...
#> ℹ [2026-08-30 04:09:17] Skip `log1p()` because `layer = data` is not "counts"
#> ℹ [2026-08-30 04:09:17] Perform umap nonlinear dimension reduction
#> ✔ [2026-08-30 04:09:24] Standard processing workflow completed
pancreas_sub <- RunCytoTRACE(
pancreas_sub,
species = "Mus_musculus",
backend = "cpp"
)
#> ◌ [2026-08-30 04:09:24] Running CytoTRACE2
#> ℹ [2026-08-30 04:09:24] Extracting expression matrix from `assay = RNA, layer = counts`
#> ◌ [2026-08-30 04:09:24] Running CytoTRACE2 with `backend = cpp`
#> ℹ [2026-08-30 04:09:25] Preparing CytoTRACE2 database
#> ℹ [2026-08-30 04:09:25] Downloading CytoTRACE2 model data from datasets GitHub repository...
#> ℹ [2026-08-30 04:09:25] Downloading model_parameters.rds ...
#> ℹ [2026-08-30 04:09:26] Downloading features_model_training_17.csv ...
#> ℹ [2026-08-30 04:09:26] Downloading mt_dict_human_to_mouse.csv ...
#> ℹ [2026-08-30 04:09:27] Downloading mt_human_alias.csv ...
#> ℹ [2026-08-30 04:09:27] Downloading mt_mouse_alias.csv ...
#> ✔ [2026-08-30 04:09:27] CytoTRACE2 data cached at /home/runner/.local/share/R/scop/CytoTRACE2
#> ℹ [2026-08-30 04:09:27] Species: "Homo_sapiens"
#> ℹ [2026-08-30 04:09:27] Species: "Mus_musculus"
#> ℹ [2026-08-30 04:09:27] Loading model from /home/runner/.local/share/R/scop/CytoTRACE2
#> ℹ [2026-08-30 04:09:29] Dataset contains 15998 genes and 1000 cells.
#> ℹ [2026-08-30 04:09:30] Running on 1 subsample
#> ℹ [2026-08-30 04:09:30] Using 1 core
#> ℹ [2026-08-30 04:09:30] 12486 input genes mapped to model genes.
#> ℹ [2026-08-30 04:09:30] Building results
#> ✔ [2026-08-30 04:09:59] CytoTRACE2 computed successfully
CytoTRACEPlot(
pancreas_sub,
group.by = "CellType",
xlab = "UMAP_1",
ylab = "UMAP_2"
)
plots <- CytoTRACEPlot(
pancreas_sub,
group.by = "CellType",
combine = FALSE
)
plots$Boxplot