plotEnrichR | R Documentation |
This function takes a list of list of DataFrames containing Enrichr results
returned by runEnrichR()
and create barplots from a selected gene-set
library.
plotEnrichR(
object,
db,
showTerms = 20,
numChar = 50,
y = "Count",
order_by = "P.value",
theme_size = 16,
prefix = NULL,
dir_path = NULL,
...
)
object |
A named list of list of DataFrames storing outputs returned
by |
db |
A string indicating the name of one gene-set library to plot. |
showTerms |
An integer scalar indicating the number of terms to show. Default is 20. |
numChar |
An integer scalar indicating the number characters to keep in the terms' descriptions. Default is 50. |
y |
A string indicating the variable that should be mapped to the
y-axis. It can be |
order_by |
A string indicating how to order the Enrichr terms before
selecting the first |
theme_size |
A numeric scalar indicating the base font size. Default is 16. |
prefix |
A string indicating the prefix of output file. When
|
dir_path |
The directory path for exported PDF. The files are exported
to the current working directory when |
... |
Other arguments passed on to |
The function prints barplots from each group of comparison using
grid::grid.draw()
one after another, therefore the plotting feature is
suitable only in Jupyter Notebook or R Markdown. Otherwise, disable plotting
by specifying the prefix
argument to save barplots to PDF files.
None
I-Hsuan Lin
runEnrichR()
, ggplot2::ggsave()
## Not run:
# Load demo dataset
data(res_deseq2)
# We construct a list of 3 DataFrames using the same DESeq2 output (`res_deseq2`)
# to mimic having a list containing results from multiple sets of comparisons.
res.de <- list(A_B = res_deseq2, A_C = res_deseq2, B_C = res_deseq2)
# Select gene-set libraries
dbs <- c("GO_Molecular_Function_2018", "GO_Biological_Process_2018")
# Run enrichR using the D. melanogaster specific modEnrichr site, and
# specify the gene symbols are stored in the 'external_gene_name' column
res.ora <- runEnrichR(res.de,
dbs = dbs, site = "FlyEnrichr",
column_by = "external_gene_name"
)
# Print plots on to standard output
plotEnrichR(res.ora, db = "GO_Biological_Process_2018", theme_size = 14)
# Save plots to PDF files in the per-session temporary directory
plotEnrichR(res.ora,
db = "GO_Biological_Process_2018", prefix = "Enrichr",
dir_path = tempdir(), width = 12, height = 5
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.