ggplot2_dotplot: Plot number of DE genes

View source: R/plot_dotplot.R

ggplot2_dotplotR Documentation

Plot number of DE genes

Description

ggplot2_dotplot function plots the number of differentially expressed (DE) genes in each test.

Usage

ggplot2_dotplot(deg = NULL, path = ".", save_plot = TRUE)

Arguments

deg

The list of DE genes generated by one of ERSSA::DE_*.R scripts.

path

Path to which the plot will be saved. Default to current working directory.

save_plot

Boolean. Whether to save plot to drive. Default to TRUE.

Details

The number of DE genes are plotted as dots grouped by the associated replicate level. At each replicate level, a boxplot is drawn to mainly show the first and third quartiles as well as the median. Additionally, A red line is drawn representing the mean at each replicate level. A horizontal dashed blue line represents the number of DE genes found with all samples.

Value

A list is returned containing:

  • gg_object the ggplot2 object, which can then be further customized.

  • deg_dataframe the tidy table version of DEG numbers for plotting.

  • full_num_DEG The number of DE genes with all samples included.

Author(s)

Zixuan Shao, Zixuanshao.zach@gmail.com

References

H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2009.

Examples

# load edgeR deg object generated by erssa_edger using example dataset
# example dataset containing 1000 genes, 4 replicates and 5 comb. per rep.
# level
data(deg.partial, package = "ERSSA")

gg_dot = ggplot2_dotplot(deg.partial)


zshao1/ERSSA documentation built on July 19, 2023, 9:20 p.m.