View source: R/plot_volcano_byvar_nvars.R
Generate a set of volcano plots of genes from a differential expression (limma) analysis, for one or more contrasts, with point color or shape determined by a variable of interest. These plots can be output to plotting windows, or to pdfs. The points can be colored on a continuous or discrete scale, based on variables at the gene level. Points can also have shape determined by gene-level variables on a discrete scale. Points can 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.
1 2 3 4 5 6 7 8 9 10 11 | plot_volcano_byvar_nvars(
topGenes.pairwise, file_prefix=NULL, plotdims=c(9,9),
fc_cut=log2(1.5), p_cut=0.01,
color_by_var=NULL, color_by_var_levels=NULL, color_var_lab=NULL,
my_cols=c("blue","red"), na_col="grey50",
pch_by_var=NULL, pch_by_var_levels=NULL, pch_var_lab=NULL,
my_pch=NULL,
x_lim="auto", y_lim="auto",
gene_labs=FALSE, x_cut=0, y_cut=0,
point_order="random",
...)
|
topGenes.pairwise |
a list of data frames, each typically containing the output of a call to |
file_prefix |
a character string. If provided, the function outputs pdfs of the plots, named "file_prefix.list_element_name.colored_by_color_by_var.shape_by_shape_by_var.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. |
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. |
color_by_var |
(optional) character string or integer identifying the column in topGenes to color points by. If not provided, points are plotted in black. |
color_by_var_levels |
(optional) character vector defining the order of elements in the variable used for coloring points; this order is used for the plot legend and to match the order of colors (if provided). If not provided, levels are taken from the factor levels (if color_by_var is a factor), or else are ordered by order of appearance in |
color_var_lab |
(optional) string to be used as the title for the color legends. |
my_cols |
(optional) vector of colors to use for plotting. If |
na_col |
color to use for NA values of |
pch_by_var |
(optional) character string or integer identifying the column in topGenes to vary point shapes by. If not provided, points are plotted as dots. |
pch_by_var_levels |
(optional) character vector defining the order of elements in the variable used for point shapes; this order is used for the plot legend and to match the order of shapes (if provided). If not provided, levels of the variable are ordered by order of appearance in topGenes. |
pch_var_lab |
(optional) string to be used as the title for the point shape legends. |
my_pch |
vector of shapes to use for plotting. Required if plotting points by shape; if not provided, all points will be plotted as dots. Must contain at least as many elements as the number of unique elements in |
x_lim, y_lim |
either "auto", NULL, or numeric vectors. If "auto", x- and y-limits are determined from the data using |
gene_labs |
logical, whether to include gene labels for genes with extreme logFC and p-value. If |
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. |
point_order |
character string, specifying how to order the points. Currently accepted values are "random", which randomizes the order of the points, and "input", which sends the points to ggplot as they are in the input data frame. Defaults to "random". |
... |
additional parameters passed to |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.