vsBoxPlot: Box plot for log_{10}(FPKM or CPM) distributions

Description Usage Arguments Value Author(s) Examples

View source: R/vsBoxPlot.R

Description

This function allows you to extract necessary results-based data from analytical objects to create a box plot comparing log10(FPKM or CPM) distributions for experimental treatments.

Usage

1
2
3
4
5
6
vsBoxPlot(data, d.factor = NULL, type = c("cuffdiff", "deseq", "edger"),
  title = TRUE, legend = TRUE, grid = TRUE, aes = c("box", "violin",
  "boxdot", "viodot", "viosumm", "notch"), fill.color = NULL,
  data.return = FALSE, xaxis.text.size = 10, yaxis.text.size = 10,
  xaxis.title.size = 12, yaxis.title.size = 12, main.title.size = 15,
  legend.text.size = 10, legend.title.size = 12)

Arguments

data

output generated from calling the main routines of either cuffdiff, DESeq2, or edgeR analyses. For cuffdiff, this will be a *_exp.diff file. For DESeq2, this will be a generated object of class DESeqDataSet. For edgeR, this will be a generated object of class DGEList.

d.factor

a specified factor; for use with DESeq2 objects only. This input equates to the first parameter for the contrast argument when invoking the results() function in DESeq2. Defaults to NULL

type

an analysis classifier to tell the function how to process the data. Must be either cuffdiff, deseq, or edger. cuffdiff must be used with cuffdiff data; deseq must be used for DESeq2 output; edgeR must be used with edgeR data. See the data parameter for further details.

title

display the main title of plot. Logical; defaults to TRUE. If set to FALSE, no title will display in plot.

legend

display legend of plot. Logical; defaults to TRUE. If set to FALSE, no legend will display in plot.

grid

display major and minor axis lines. Logical; defaults to TRUE. If set to FALSE, no axis lines will display in plot.

aes

changes overall layout of the graph. box: box plot; violin: violin plot; boxdot: box plot with dots; viodot: violin plot with dots; viosumm: violin plot with summary statistics; notch: box plots with notches. Defaults to box.

fill.color

changes the fill color for the plots. See RColorBrewer::display.brewer.all() function for further details. If NULL, colors will default to standard ggplot2 aesthetics.

data.return

returns data output of plot. Logical; defaults to FALSE. If set to TRUE, a data frame will also be called. Assign to object for reproduction and saving of data frame. See final example for further details.

xaxis.text.size

change the font size of the x-axis text. Defaults to 10.

yaxis.text.size

change the font size of the y-axis text. Defaults to 10.

xaxis.title.size

change the font size of the x-axis title text. Defaults to 12.

yaxis.title.size

change the font size of the y-axis title text. Defaults to 12.

main.title.size

change the font size of the plot title text. Defaults to 15.

legend.text.size

change the font size of the legend body text. Defaults to 10.

legend.title.size

change the font size of the legend title text. Defaults to 12.

Value

An object created by ggplot

Author(s)

Brandon Monier, brandon.monier@sdstate.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Cuffdiff example
data("df.cuff")
vsBoxPlot(
     data = df.cuff, d.factor = NULL, type = "cuffdiff", title = TRUE,
     legend = TRUE, grid = TRUE
)

# DESeq2 example
data("df.deseq")
require(DESeq2)
vsBoxPlot(
     data = df.deseq, d.factor = "condition", type = "deseq",
     title = TRUE, legend = TRUE, grid = TRUE
)

# edgeR example
data("df.edger")
require(edgeR)
vsBoxPlot(
     data = df.edger, d.factor = NULL, type = "edger", title = TRUE,
     legend = TRUE, grid = TRUE
)

# Display different colors for plot
data("df.edger")
vsBoxPlot(
     data = df.edger, d.factor = NULL, type = "edger", title = TRUE,
     legend = TRUE, grid = TRUE, fill.color = "RdGy",
     data.return = FALSE
)

# Extract data frame from visualization
data("df.edger")
require(edgeR)
tmp <- vsBoxPlot(
     data = df.edger, d.factor = NULL, type = "edger", title = TRUE,
     legend = TRUE, grid = TRUE, data.return = FALSE
)
df_box <- tmp[[1]] ## or use tmp$data
head(df_box)

# Show plot from object (see prior example for more details)
tmp[[2]] ## or use tmp$plot

vidger documentation built on Nov. 8, 2020, 5:27 p.m.