plot_saturation_curve: Plot saturation curves of genes based on reads object

View source: R/plot_saturation_curve.R

plot_saturation_curveR Documentation

Plot saturation curves of genes based on reads object

Description

Plot the saturation of gene detection based on rarefaction of the mapped read counts from a library. This function takes the output of estimate_saturation.

Usage

plot_saturation_curve(
  saturation,
  design,
  design_id_col = "libid",
  plot_points = FALSE,
  color_points_by_var = NULL,
  plot_lines = TRUE,
  color_lines_by_var = NULL,
  plot_terminal_points = TRUE,
  color_terminal_points_by_var = NULL,
  plot_smooths = FALSE,
  color_smooths_by_var = NULL,
  log_transform_depth = FALSE,
  log_transform_genes = FALSE,
  my_cols = NULL
)

Arguments

saturation

a data frame, typically the output of estimate_saturation. Should contain columns "sample" with sample identifiers, "depth" with the varied simulated sequencing depths, and "sat" with the number of genes detected at that depth.

design

an optional data frame containing annotation data for use in coloring points, lines, and/or smooths. Must include a column matching column "sample" in saturation, and any columns specified by the "color_by" arguments.

design_id_col

the number or name of the column containing identifiers that match the "sample" column in saturation. Defaults to "libid".

plot_points

logical, whether to include points in the plot.

color_points_by_var, color_lines_by_var, color_terminal_points_by_var, color_smooth_by_var

variable to use for plotting points, lines, terminal points, and/or smooths by a discrete variable. Must be either the name of a column in saturation, or a column in design.

plot_lines

logical, whether to include (unsmoothed) lines in the plot. It is not recommended to include both plot_lines and plot_smooth, as this will make plots difficult to read.

plot_terminal_points,

whether to plot the maximum-depth point for each library. This helps to visualize the actual distribution of observed counts by library.

log_transform_depth

logical, whether to plot the read counts on a log10 scale. Defaults to FALSE.

log_transform_genes

logical, whether to plot the number of genes detected on a log10 scale. Defaults to FALSE.

my_cols

character vector of color names for use in plotting. If not specified, ggthemes::colorblind_pal() is used. If the number of colors provided is less than the number of colors needed, additional colors are interpolated using colorRampPalette.

plot_smooth

logical, whether to include lowess curves in the plot. It is not recommended to include both plot_lines and plot_smooth, as this will make plots difficult to read.


mjdufort/RNAseQC documentation built on July 7, 2023, 6:46 p.m.