mbqnBoxplot: Combined box plot and line plot

View source: R/mbqnBoxplot.R

mbqnBoxplotR Documentation

Combined box plot and line plot

Description

Create a box-and-whisker plot of a data matrix and plot selected features and/or additional user-defined data on top of it.

Usage

mbqnBoxplot(mtx, irow = NULL, vals = NULL, add.leg = TRUE, ...)

Arguments

mtx

a matrix or data frame.

irow

index or vector of row indices of matrix features to plot on top of the boxplot.

vals

numeric, array, matrix, or data frame of features with length ncol(mtx) to plot on top of the boxplot.

add.leg

add legend to plot.

...

additional arguments passed to the plot functions, e.g. xlab, ylab, main, ylim, type, las.

Details

This function calls graphics::boxplot. Groups are represent by matrix columns. Selected rows/features or user-defined arrays are plot on top of the box plot. Missing values are ignored.

Value

Figure.

Author(s)

Ariane Schad

References

Brombacher, E., Schad, A., Kreutz, C. (2020). Tail-Robust Quantile Normalization. BioRxiv.

Examples

## Create boxplot of quantile normalized data matrix and plot
## feature from median balanced quantile normalization on top of it.
X <- matrix(c(5,2,3,NA,4,1,4,2,3,4,6,NA,1,3,1),ncol=3) # Create data matrix
# Quantile normalization
qn.dat <- mbqn(x=X,FUN = NULL ,na.rm = TRUE)
# Median balanced quantile normalization
mbqn.dat <- mbqn(x=X,FUN = median ,na.rm = TRUE)
## Create boxplot:
plot.new()
mbqnBoxplot(qn.dat,irow = 1, vals = mbqn.dat[1,], type = "b")

arianeschad/mbqn documentation built on March 29, 2022, 6:56 p.m.