Skip to contents

Plot tAge transcriptomic aging-clock predictions

Usage

tAgePlot(
  object,
  score_col = NULL,
  group.by = NULL,
  split.by = NULL,
  tool_name = "tAge",
  plot_type = c("box"),
  palette = "Chinese",
  palcolor = NULL,
  alpha = 1,
  pt.size = 2.2,
  point_size = NULL,
  pt.alpha = 0.85,
  point_alpha = NULL,
  box_alpha = 0.15,
  flip = TRUE,
  title = NULL,
  subtitle = NULL,
  xlab = NULL,
  ylab = NULL,
  theme_use = "theme_scop",
  theme_args = list(),
  legend.position = "none",
  legend.direction = "vertical",
  grid_major = TRUE,
  grid_major_colour = "grey80",
  grid_major_linetype = 2,
  grid_major_linewidth = 0.3,
  aspect.ratio = NULL,
  seed = 11,
  verbose = TRUE,
  ...
)

Arguments

object

A Seurat object returned by RuntAge() or a data frame with tAge prediction columns.

score_col

Prediction column to plot. If NULL, the first column ending in "_tAge" is used.

group.by

Column used to group predictions on the y axis.

split.by

An optional column to split the plot into facets.

tool_name

Name of the Seurat tool entry containing tAge results.

plot_type

Plot type. Currently "box" draws a boxplot with jittered pseudobulk samples.

palette, palcolor

Palette forwarded to thisplot::palette_colors().

alpha

Overall point and box alpha. pt.alpha and box_alpha take precedence when set.

pt.size, pt.alpha

Jittered point size and alpha.

point_size, point_alpha

Deprecated alias(es) for pt.size/pt.alpha; supply exactly one of the two. It will be removed in scop 1.0.0.

box_alpha

Boxplot fill alpha.

flip

Whether to flip coordinates so group labels run along the y axis.

title, subtitle, xlab, ylab

Plot labels.

theme_use

Theme function name passed to the shared expression-statistics renderer. Default is "theme_scop".

theme_args

Additional arguments passed to theme_use.

legend.position, legend.direction

Legend position and direction.

grid_major

Whether to show major panel grid lines.

grid_major_colour, grid_major_linetype, grid_major_linewidth

Appearance of major panel grid lines.

aspect.ratio

Aspect ratio of the plot (y / x).

seed

RNG seed for jitter reproducibility.

verbose

Whether to print the message. Default is TRUE.

...

Arguments passed to other functions.

Value

A ggplot object.

Examples

predictions <- data.frame(
  group = rep(c("Young", "Aged"), each = 4),
  Mouse_tAge = c(3.1, 4.2, 5.0, 4.6, 18.2, 20.1, 21.3, 19.6)
)
tAgePlot(predictions, group.by = "group")
#> Coordinate system already present.
#> ℹ Adding new coordinate system, which will replace the existing one.


if (FALSE) { # \dontrun{
pancreas_sub <- RuntAge(pancreas_sub, group.by = "CellType")
tAgePlot(pancreas_sub, group.by = "CellType")
} # }