plotBox | R Documentation |
Produces a box-and-whisker plot with a SummarizedExperiment or matrix-like object where rows represent features and columns represent samples.
plotBox(x, i, group, log2 = FALSE, violin = FALSE, ylab = "Intensity")
x |
A matrix-like object or SummarizedExperiment object. |
i |
A string or integer value specifying which assay values to use
when |
group |
A discrete variable to visualize the grouping structure. |
log2 |
A logical specifying whether feature intensities needs to be log2-transformed before visualization. |
violin |
A logical specifying whether a violin plot is shown instead of a boxplot. |
ylab |
A string specifying the title of y-axis. |
A ggplot object.
data(faahko_se)
## Sample group
g <- colData(faahko_se)$sample_group
## SummarizedExperiment object
plotBox(faahko_se, i = "knn", group = g, log2 = TRUE) # before normalization
## Matrix
m <- assay(faahko_se, "knn_vsn")
plotBox(m, group = g) # after normalization
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.