plotCyclone: Plot G2M against G1 scores from 'cyclone' results

View source: R/func_sc.R

plotCycloneR Documentation

Plot G2M against G1 scores from cyclone results

Description

This function produces a scatter plot to show the predicted G1 and G2M scores and cell cycle phases of single cells after performing classification using cyclone() from the scran package.

Usage

plotCyclone(
  x,
  phase_color = NULL,
  point_size = 2,
  point_alpha = 0.8,
  text_size = 6,
  xlab = "G1 score",
  ylab = "G2/M score",
  title = NULL,
  theme_size = 18
)

Arguments

x

A list returned by cyclone() containing phases, scores and normalized.scores slots.

phase_color

A character vector of color codes indicating the colour of the cell cycle phases. Default is NULL, and use choosePalette() to select a palette.

point_size

A numeric scalar indicating the size of the points. Default is 2.

point_alpha

A numeric scalar (between 0 and 1) indicating the transparency. Default is 0.8.

text_size

A numeric scalar indicating the size of cell cycle phase labels. Default is 6.

xlab

The title of the x-axis. Default is "G1 score".

ylab

The title of the y-axis. Default is "G2/M score".

title

Plot title. Default is NULL.

theme_size

A numeric scalar indicating the base font size. Default is 18.

Value

A ggplot object

Author(s)

I-Hsuan Lin

See Also

scran::cyclone()

Examples

library(SingleCellExperiment)

# Load demo dataset
data(phases_assignments)

# Create plot, minimal input
plotCyclone(phases_assignments)

# Assign colours
my.cols <- c("red", "blue", "black")
plotCyclone(phases_assignments, phase_color = my.cols)

# Assign named colours
my.cols <- setNames(c("red", "blue", "black"), c("G1", "S", "G2M"))
plotCyclone(phases_assignments, phase_color = my.cols)

ycl6/scRUtils documentation built on Feb. 18, 2025, 6:14 a.m.