Makes boxplot of log2-transformed counts for each target. Option to show target distributions relative to the LOD (LOD is subtracted from each data point, so LOD becomes the zero) and color boxplots by target detectability.

targetBoxplot(
  data_matrix,
  title = NULL,
  sortBy = "median",
  subtractLOD = FALSE,
  blanks = NULL,
  targetNoOutlierDetection = NULL,
  horizontal = FALSE,
  log2transform = TRUE,
  replace_zero_LOD = FALSE,
  axis_lab_normalized = TRUE,
  excludeTargets = NULL,
  excludeSamples = NULL,
  colors = NULL,
  detectHighColor = "pink",
  detectLowColor = "blue",
  showLegend = TRUE,
  cex.targets = 0.4,
  axis_limits = NULL,
  match_matrix = NULL,
  targets = NULL
)

Arguments

data_matrix

The Data matrix output from readNULISAseq.R or normalized data from normalization functions (targets in columns and samples in rows).

title

Title of the plot.

sortBy

Order by which to sort the boxplots. Options are `'median'` for target medians, `'detect'` for detectability (must provide LODs). If `subtractLOD = FALSE`, will only sort by medians.

subtractLOD

Should the target boxplot values be relative to LOD? Default is `FALSE`. If `TRUE`, will color boxplots by detectability.

blanks

A vector of column names that represent the negative controls. Required when `subtractLOD = TRUE`. This is passed to the `lod()` function.

targetNoOutlierDetection

Targets for which NC outlier detection should not be performed. Typically these are targets with no NC reads above 100. This is passed to the `lod()` function.

horizontal

Should the boxplots be horizontal (target names along the y-axis)? Default is `FALSE` (target names along x-axis).

log2transform

If TRUE (default), each value `x` will be transformed by `log2(x + 1)`. LOD values will also be transformed when `subtractLOD = TRUE`.

replace_zero_LOD

If TRUE (default is FALSE), will replace LODs of zero on the unlogged scale with zeros on the log scale. Probably only makes sense to use this option when using unnormalized data, because in this case LODs of zero become negative and when subtracted will cause shift upwards for the set of targets with LOD = 0. This option is only used when log2transform is TRUE.

axis_lab_normalized

If TRUE (default), will use "normalized count" for axis label. If FALSE, will use "count" for axis label.

excludeTargets

Vector of names of any targets to exclude from the plots (such as internal controls).

excludeSamples

Vector of names of samples to exclude from plots. These correspond to the column names.

colors

Optional vector of colors that will be used to color the boxplots. Colors should be in the same order as the targets (rows) in the input data (after excluding any targets in `excludeTargets`). If provided, will override `detectHighColor` and `detectLowColor` when `subtractLOD = TRUE`. When `subtractLOD = FALSE`, default is `'grey'`

detectHighColor

The color that represents 100 gradient color scale used when `subtractLOD = TRUE`. Default is `'pink'`.

detectLowColor

The color that represents 0 gradient color scale used when `subtractLOD = TRUE`. Default is `'blue'`.

showLegend

Should a legend appear in the plot? Only used when `subtractLOD = TRUE`.

cex.targets

Character expansion factor for target labels.

match_matrix

Matrix of indices provided by calcSampleTargetNAs. Lists samples/targets that should not be reported

targets

Data frame containing target information including Curve_Quant attribute. If provided, target names with Curve_Quant == "R" will be prefixed with "* ".

Value

Draws boxplots of target expression.