Skip to contents

This function generates a Relative Log Expression (RLE) plot for visualizing the distribution of expression data after normalization or log transformation.

Usage

plot_rle(
  data,
  barcodes = NULL,
  label_column = NULL,
  labels = NULL,
  log = TRUE,
  batch = NULL,
  normalisation = NULL,
  spikes = NULL
)

Arguments

data

A tidyseurat object merged with metadata. Must contain columns "Well_ID", "Row", "Column".

barcodes

A vector of sample barcodes corresponding to Cells(seurat_object).

label_column

A metadata column name to group the barcodes.

labels

A vector of labels of the same length as 'barcodes" to group the barcodes.

log

A logical value indicating whether data should be log-transformed. Defaults to TRUE.

batch

Either empty, a single value, or a vector corresponding to the number of samples.

normalisation

One of "raw", "logNorm", "cpm", "clr", "SCT", "DESeq2", "edgeR", "RUVg", "RUVs", "RUVr", "limma_voom", "zinb". If empty, defaults to raw.

spikes

List of genes to use as spike controls in RUVg

Value

A ggplot object representing the RLE plot.

Details

The function performs the following steps:

  • Ensures integrity of input data

  • Log-transforms the data

  • Computes the RLE by subtracting the row medians from each value.

  • Creates a boxplot using ggplot2 to visualize the distribution of RLE values.

Examples

data("mini_mac")
p <- plot_rle(mini_mac, label_column = "Row")
#> tidyseurat says: Key columns are missing. A data frame is returned for independent data analysis.