plot_volcano_nvars: Generate a set of volcano plots of genes from a differential...

Description Usage Arguments Details

View source: R/plot_volcano_nvars.R

Description

Generate a set of volcano plots of genes from a differential expression (limma) analysis, for one or more contrasts. These plots can be output to plotting windows, or to pdfs. The points can be colored based on fold-change and p-value thresholds. Points can also be labeled with gene names, and the points to be labeled can be set based on an ellipse oriented to the x- and y-axes.

Usage

1
2
3
4
5
6
7
plot_volcano_nvars(
     topGenes.pairwise, my_cols=c("darkcyan", "darkorange"),
     file_prefix=NULL, plotdims=c(9,9),
     color_by_threshold=TRUE, fc_cut=log2(1.5), p_cut=0.01,
     x_lim="auto", y_lim="auto",
     gene_labs=FALSE, x_cut=0, y_cut=0,
     ...)

Arguments

topGenes.pairwise

a list of data frames, each typically containing the output of a call to topTable for a single contrast. Each list element should be named with an identifier for the contrast, and must contain genes, log2 fold-change, and adjusted p-values. Can optionally include a "threshold" column, which should be boolean indicating genes passing significance thresholds.

my_cols

a vector of colors for plotting points. First element provides the color for points not exceeding significance thresholds; second element provides the color for points exceeding significance thresholds.

file_prefix

a character string. If provided, the function outputs pdfs of the plots, named "file_prefix.list_element_name.pdf".

plotdims

a numeric vector, the size (in inches) of the plotting object. Either the size of the pdf, or the size of the plotting window.

color_by_threshold

logical, whether to color points based on exceeding a threshold for logFC and p-value. Used only if fc_cut and p_cut are not NULL.

fc_cut

numeric, the (absolute value) log2 fold-change threshold for determining significance of genes. This value is also plotted as vertical dotted lines. Setting to NULL removes the lines.

p_cut

numeric, the p-value threshold for determining significance of genes. This value is also plotted as a horizontal dotted line. Setting to NULL removes the lines.

x_lim, y_lim

either "auto", NULL, or numeric vectors. If "auto", x- and y-limits are determined from the data using get_xy_lims. If NULL, default plot limits are used. If provided as numeric vectors, the lower and upper limits of the plotting space along the x- and y-axes. Passed to ggplot2::xlim.

gene_labs

logical, whether to include gene labels for genes with extreme logFC and p-value. If TRUE, genes with values outside the labeling ellipse will be labeled.

x_cut, y_cut

numeric, the radii of the labeling ellipse along the x- and y-axes. Genes with values outside the ellipse are labeled with gene names. Default to 0, which results in all genes being labeled.

...

additional parameters passed to pdf.

Details

A separate plot is generated for each element of topGenes.pairwise.


BenaroyaResearch/limmaTools documentation built on Dec. 17, 2021, 10:49 a.m.