Learn R Programming

inDAGO (version 1.0.0)

boxplotExp: boxplotExp

Description

Generate a boxplot of log-CPM expression values per sample, colored by group.

Usage

boxplotExp(x, y, palette, main, selectOrder)

Value

A ggplot object showing per-sample boxplots of log-CPM values.

Arguments

x

A DGEList object from "edgeR".

y

Numeric matrix of log-CPM values (genes × samples), e.g., from edgeR::cpm().

palette

Character. Name of a discrete palette from the paletteer package.

main

Character. Title for the boxplot.

selectOrder

Character. Either "Groups" (order samples by group) or "Samples" (order by sample name).

Details

This function orders samples by group or sample name, and produces a ggplot2 boxplot with a horizontal line at the overall median.

  1. Extract sample metadata (Samples, Groups) from "x$samples".

  2. Order columns of y by group or sample name per "selectOrder".

  3. Melt the ordered matrix to long format and join with metadata.

  4. Plot boxplots with no outliers, colored by group, and include a dashed line at the overall median.