| Title: | Visualization of Functional Enrichment Result |
|---|---|
| Description: | The 'enrichplot' package provides visualization methods for interpreting functional enrichment results from ORA or GSEA analyses. It is designed to work with the 'clusterProfiler' ecosystem and builds on 'ggplot2' for flexible and extensible graphics. |
| Authors: | Guangchuang Yu [aut, cre] (ORCID: <https://orcid.org/0000-0002-6485-8781>) |
| Maintainer: | Guangchuang Yu <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 1.99.8 |
| Built: | 2026-10-09 16:31:18 UTC |
| Source: | https://github.com/bioc/enrichplot |
Convert compareClusterResult to data frame
## S3 method for class 'compareClusterResult' as.data.frame(x, ...)## S3 method for class 'compareClusterResult' as.data.frame(x, ...)
x |
compareClusterResult object |
... |
additional parameters |
data frame
This file contains plotting and visualization helper functions for enrichplot Automatically split barplot or dotplot into several facets
autofacet(by = "row", scales = "free", levels = NULL)autofacet(by = "row", scales = "free", levels = NULL)
by |
one of 'row' or 'column' |
scales |
whether 'fixed' or 'free' |
levels |
set facet levels |
a ggplot object
Barplot of enrichResult
## S3 method for class 'enrichResult' barplot( height, x = "Count", color = "p.adjust", showCategory = 8, font.size = 12, title = "", label_format = 30, ... )## S3 method for class 'enrichResult' barplot( height, x = "Count", color = "p.adjust", showCategory = 8, font.size = 12, title = "", label_format = 30, ... )
height |
enrichResult object |
x |
one of 'Count' and 'GeneRatio' |
color |
one of 'pvalue', 'p.adjust' and 'qvalue' |
showCategory |
number of categories to display or a vector of terms. |
font.size |
font size |
title |
plot title |
label_format |
a numeric value sets wrap length, alternatively a custom function to format axis labels. by default wraps names longer than 30 characters |
... |
additional parameters |
Barplot of enrichResult
ggplot object
## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) barplot(x) # use `showCategory` to select the displayed terms. It can be a number of a vector of terms. barplot(x, showCategory = 10) categories <- c("urinary bladder cancer", "bronchiolitis obliterans", "aortic aneurysm", "esophageal cancer") barplot(x, showCategory = categories) ## End(Not run)## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) barplot(x) # use `showCategory` to select the displayed terms. It can be a number of a vector of terms. barplot(x, showCategory = 10) categories <- c("urinary bladder cancer", "bronchiolitis obliterans", "aortic aneurysm", "esophageal cancer") barplot(x, showCategory = categories) ## End(Not run)
Create color palette for continuous data
color_palette(colors)color_palette(colors)
colors |
colors of length >=2 |
color vector
guangchuang yu
color_palette(c("red", "yellow", "green"))color_palette(c("red", "yellow", "green"))
Multi-context mechanism consensus map
consensusmap( x, fill_var = c("NES", "delta_NES"), size_var = c("rewiring_score", "leading_edge_overlap"), include_rewiring = TRUE, label = c("mechanism_class", "rewiring_score", "none"), reference = NULL, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'mnseaResult' consensusmap( x, fill_var = c("NES", "delta_NES"), size_var = c("rewiring_score", "leading_edge_overlap"), include_rewiring = TRUE, label = c("mechanism_class", "rewiring_score", "none"), reference = NULL, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'nseaResult' consensusmap( x, fill_var = c("NES", "delta_NES"), size_var = c("rewiring_score", "leading_edge_overlap"), include_rewiring = TRUE, label = c("mechanism_class", "rewiring_score", "none"), reference = NULL, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'list' consensusmap( x, fill_var = c("NES", "delta_NES"), size_var = c("rewiring_score", "leading_edge_overlap"), include_rewiring = TRUE, label = c("mechanism_class", "rewiring_score", "none"), reference = NULL, thresholds = list(rewire = 0.5, nes = 0.2), ... )consensusmap( x, fill_var = c("NES", "delta_NES"), size_var = c("rewiring_score", "leading_edge_overlap"), include_rewiring = TRUE, label = c("mechanism_class", "rewiring_score", "none"), reference = NULL, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'mnseaResult' consensusmap( x, fill_var = c("NES", "delta_NES"), size_var = c("rewiring_score", "leading_edge_overlap"), include_rewiring = TRUE, label = c("mechanism_class", "rewiring_score", "none"), reference = NULL, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'nseaResult' consensusmap( x, fill_var = c("NES", "delta_NES"), size_var = c("rewiring_score", "leading_edge_overlap"), include_rewiring = TRUE, label = c("mechanism_class", "rewiring_score", "none"), reference = NULL, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'list' consensusmap( x, fill_var = c("NES", "delta_NES"), size_var = c("rewiring_score", "leading_edge_overlap"), include_rewiring = TRUE, label = c("mechanism_class", "rewiring_score", "none"), reference = NULL, thresholds = list(rewire = 0.5, nes = 0.2), ... )
x |
A |
fill_var |
One of |
size_var |
One of |
include_rewiring |
Logical; whether to draw topology-consistency points. |
label |
One of |
reference |
An optional reference result used to compute |
thresholds |
Optional named list with |
... |
Additional parameters passed to plot methods. |
consensusmap() creates a pathway by context heatmap. Tile fill
represents enrichment strength (NES or delta_NES) and point size
represents topology consistency (rewiring_score or
leading_edge_overlap). Mechanism class is shown as tile text and point
color.
A ggplot object.
Dot plot for enrichment result
dotplot(object, ...) ## S4 method for signature 'enrichResult' dotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, ... ) ## S4 method for signature 'gseaResult' dotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, ... ) ## S4 method for signature 'mnseaResult' dotplot( object, x = "share", color = "contribution", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, layer = NULL, ... ) ## S4 method for signature 'compareClusterResult' dotplot( object, x = "Cluster", color = "p.adjust", showCategory = 5, split = NULL, font.size = 12, title = "", by = "geneRatio", size = NULL, includeAll = TRUE, label_format = 30, ... ) ## S4 method for signature 'enrichResultList' dotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, ... ) ## S4 method for signature 'gseaResultList' dotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, ... ) dotplot.enrichResult( object, x = "geneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, decreasing = TRUE ) dotplot.compareClusterResult( object, x = "Cluster", colorBy = "p.adjust", showCategory = 5, by = "geneRatio", size = "geneRatio", split = NULL, includeAll = TRUE, font.size = 12, title = "", label_format = 30, group = FALSE, shape = FALSE, facet = NULL, strip_width = 15 )dotplot(object, ...) ## S4 method for signature 'enrichResult' dotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, ... ) ## S4 method for signature 'gseaResult' dotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, ... ) ## S4 method for signature 'mnseaResult' dotplot( object, x = "share", color = "contribution", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, layer = NULL, ... ) ## S4 method for signature 'compareClusterResult' dotplot( object, x = "Cluster", color = "p.adjust", showCategory = 5, split = NULL, font.size = 12, title = "", by = "geneRatio", size = NULL, includeAll = TRUE, label_format = 30, ... ) ## S4 method for signature 'enrichResultList' dotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, ... ) ## S4 method for signature 'gseaResultList' dotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, ... ) dotplot.enrichResult( object, x = "geneRatio", color = "p.adjust", showCategory = 10, size = NULL, split = NULL, font.size = 12, title = "", orderBy = "x", label_format = 30, decreasing = TRUE ) dotplot.compareClusterResult( object, x = "Cluster", colorBy = "p.adjust", showCategory = 5, by = "geneRatio", size = "geneRatio", split = NULL, includeAll = TRUE, font.size = 12, title = "", label_format = 30, group = FALSE, shape = FALSE, facet = NULL, strip_width = 15 )
object |
compareClusterResult object |
... |
additional parameters. |
x |
variable for x-axis, one of 'GeneRatio' and 'Count' |
color |
variable used to color enriched terms, e.g. 'pvalue', 'p.adjust' or 'qvalue' |
showCategory |
number of categories to display or a vector of terms. |
size |
variable used to scale the sizes of categories,
one of "geneRatio", "Percentage" and "count". When |
split |
apply |
font.size |
font size |
title |
figure title |
orderBy |
The order of the Y-axis |
label_format |
a numeric value sets wrap length, alternatively a custom function to format axis labels. by default wraps names longer than 30 characters |
layer |
optional layer or layers to retain for |
by |
one of "geneRatio", "Percentage" and "count" |
includeAll |
logical value |
decreasing |
logical. Should the orderBy order be increasing or decreasing? |
colorBy |
variable used to color enriched terms, e.g. 'pvalue', 'p.adjust' or 'qvalue' |
group |
a logical value, whether to connect the nodes of the same group with wires. |
shape |
a logical value, whether to use nodes of different shapes to distinguish the group it belongs to |
facet |
apply |
strip_width |
width of strip text (facet label). |
plot.
Guangchuang Yu
## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) dotplot(x) # use `showCategory` to select the displayed terms. It can be a number of a vector of terms. dotplot(x, showCategory = 10) categories <- c("pre-malignant neoplasm", "intestinal disease", "breast ductal carcinoma", "non-small cell lung carcinoma") dotplot(x, showCategory = categories) # It can also graph compareClusterResult data(gcSample) library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(gcSample) xx <- compareCluster(gcSample, fun="enrichGO", OrgDb="org.Hs.eg.db") xx2 <- pairwise_termsim(xx) library(ggstar) dotplot(xx2) dotplot(xx2, shape = TRUE) dotplot(xx2, group = TRUE) dotplot(xx2, x = "GeneRatio", group = TRUE, size = "count") ## End(Not run)## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) dotplot(x) # use `showCategory` to select the displayed terms. It can be a number of a vector of terms. dotplot(x, showCategory = 10) categories <- c("pre-malignant neoplasm", "intestinal disease", "breast ductal carcinoma", "non-small cell lung carcinoma") dotplot(x, showCategory = categories) # It can also graph compareClusterResult data(gcSample) library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(gcSample) xx <- compareCluster(gcSample, fun="enrichGO", OrgDb="org.Hs.eg.db") xx2 <- pairwise_termsim(xx) library(ggstar) dotplot(xx2) dotplot(xx2, shape = TRUE) dotplot(xx2, group = TRUE) dotplot(xx2, x = "GeneRatio", group = TRUE, size = "count") ## End(Not run)
compare two clusters in the compareClusterResult object
dotplot2(object, x = "FoldEnrichment", vars = NULL, label = "auto", ...)dotplot2(object, x = "FoldEnrichment", vars = NULL, label = "auto", ...)
object |
a compareClusterResult object |
x |
selected variable to visualize in x-axis |
vars |
selected Clusters to be compared, only length of two is supported |
label |
to label the Clusters in the plot, should be a named vector |
... |
additional parameters passed to dotplot |
a ggplot object
Guangchuang Yu
Enrichment Map for enrichment result of over-representation test or gene set enrichment analysis
emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ## S4 method for signature 'enrichResult' emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ## S4 method for signature 'gseaResult' emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ## S4 method for signature 'compareClusterResult' emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ## S4 method for signature 'mnseaResult' emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) prepare_emapplot_data( x, showCategory, color, min_edge, size_edge, edge_filter = "threshold", top_k = 5, target_density = 0.1 )emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ## S4 method for signature 'enrichResult' emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ## S4 method for signature 'gseaResult' emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ## S4 method for signature 'compareClusterResult' emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ## S4 method for signature 'mnseaResult' emapplot( x, layout = igraph::layout_with_kk, coords = NULL, showCategory = 30, color = "p.adjust", size_category = 1, min_edge = 0.2, color_edge = "grey", size_edge = 0.5, group = NULL, group_legend = TRUE, node_label = "category", node_label_size = 5, pie = "equal", layer = NULL, label_format = 30, clusterFunction = stats::kmeans, nWords = 4, nCluster = NULL, show_category_size_legend = TRUE, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) prepare_emapplot_data( x, showCategory, color, min_edge, size_edge, edge_filter = "threshold", top_k = 5, target_density = 0.1 )
x |
Enrichment result. |
||||||||||||||||||||||||
layout |
igraph layout |
||||||||||||||||||||||||
coords |
optional user-supplied coordinate data.frame with |
||||||||||||||||||||||||
showCategory |
number of categories to display or a vector of terms. |
||||||||||||||||||||||||
color |
Variable used to color enriched terms, e.g. 'pvalue', 'p.adjust' or 'qvalue'. |
||||||||||||||||||||||||
size_category |
relative size of the categories |
||||||||||||||||||||||||
min_edge |
The minimum similarity threshold for whether two nodes are connected, should be between 0 and 1, default value is 0.2. |
||||||||||||||||||||||||
color_edge |
color of the network edge |
||||||||||||||||||||||||
size_edge |
relative size of edge width |
||||||||||||||||||||||||
group |
Deprecated. |
||||||||||||||||||||||||
group_legend |
logical, if TRUE, draw a legend for the groups. |
||||||||||||||||||||||||
node_label |
Select which labels to display and whether the groups are outlined. One of:
|
||||||||||||||||||||||||
node_label_size |
size of node label, default is 5. |
||||||||||||||||||||||||
pie |
one of 'equal' or 'Count' to set the slice ratio of the pies |
||||||||||||||||||||||||
layer |
optional layer or layers to retain for |
||||||||||||||||||||||||
label_format |
a numeric value sets wrap length, alternatively a custom function to format axis labels. |
||||||||||||||||||||||||
clusterFunction |
clustering method function, such as |
||||||||||||||||||||||||
nWords |
Numeric, the number of words in the cluster tags, the default value is 4. |
||||||||||||||||||||||||
nCluster |
Numeric, the number of clusters, the default value is square root of the number of nodes. |
||||||||||||||||||||||||
show_category_size_legend |
Logical, whether to draw the category-size annotation legend for compareCluster pie charts. |
||||||||||||||||||||||||
edge_filter |
Edge filtering strategy. |
||||||||||||||||||||||||
top_k |
Number of strongest neighbors per term. Only used when
|
||||||||||||||||||||||||
target_density |
Target proportion of unique term pairs. Only used when
|
||||||||||||||||||||||||
edge_diagnostic |
Logical; if |
||||||||||||||||||||||||
... |
Additional parameters |
This function visualizes gene sets as a network (i.e. enrichment map).
Mutually overlapping gene sets tend to cluster together, making it
easier for interpretation. When the similarity between terms meets
a certain threshold (default is 0.2, adjusted by parameter min_edge),
there will be edges between terms. The stronger the similarity,
the shorter and thicker the edges. The similarity between terms is
obtained by the function pairwise_termsim. Details of the similarity
calculation can be found in its documentation: pairwise_termsim().
ggplot object
Guangchuang Yu
## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) x2 <- pairwise_termsim(x) emapplot(x2) # use `layout` to change the layout of map emapplot(x2, layout = "star") # use `showCategory` to select the displayed terms. It can be a number of a vector of terms. emapplot(x2, showCategory = 10) categories <- c("pre-malignant neoplasm", "intestinal disease", "breast ductal carcinoma") emapplot(x2, showCategory = categories) # It can also graph compareClusterResult library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(gcSample) xx <- compareCluster(gcSample, fun="enrichGO", OrgDb="org.Hs.eg.db") xx2 <- pairwise_termsim(xx) emapplot(xx2) ## End(Not run)## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) x2 <- pairwise_termsim(x) emapplot(x2) # use `layout` to change the layout of map emapplot(x2, layout = "star") # use `showCategory` to select the displayed terms. It can be a number of a vector of terms. emapplot(x2, showCategory = 10) categories <- c("pre-malignant neoplasm", "intestinal disease", "breast ductal carcinoma") emapplot(x2, showCategory = categories) # It can also graph compareClusterResult library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(gcSample) xx <- compareCluster(gcSample, fun="enrichGO", OrgDb="org.Hs.eg.db") xx2 <- pairwise_termsim(xx) emapplot(xx2) ## End(Not run)
Diagnose enrichment-map edge density
emapplot_edge_density( pair_sim, min_edge = 0.2, edge_filter = "threshold", top_k = 5, target_density = 0.1, dense_threshold = 0.2 )emapplot_edge_density( pair_sim, min_edge = 0.2, edge_filter = "threshold", top_k = 5, target_density = 0.1, dense_threshold = 0.2 )
pair_sim |
A square numeric similarity matrix. |
min_edge |
minimum similarity threshold for |
edge_filter |
edge filtering strategy. |
top_k |
number of neighbors per term for |
target_density |
target proportion of unique pairs for |
dense_threshold |
density above which a higher threshold is suggested. |
A one-row data.frame with retained pair/edge counts, density, filter settings, and a suggestion when the graph is dense.
Predefined color palettes
enrichplot_point_shapeenrichplot_point_shape
mnseaResult
These helpers convert explanation-ready outputs from enrichit into stable
data structures that are easier to consume in enrichplot.
fortify_mnsea_contribution( x, level = c("pathway", "feature"), pathway_id = NULL, layer = NULL, ... ) fortify_mnsea_subnetwork( x, pathway_id = NULL, layer = NULL, include_couplings = TRUE, include_isolated = FALSE, ... )fortify_mnsea_contribution( x, level = c("pathway", "feature"), pathway_id = NULL, layer = NULL, ... ) fortify_mnsea_subnetwork( x, pathway_id = NULL, layer = NULL, include_couplings = TRUE, include_isolated = FALSE, ... )
x |
A |
level |
One of |
pathway_id |
Optional pathway ID. |
layer |
Optional layer or layers to retain. |
... |
Additional parameters reserved for future extensions. |
include_couplings |
Logical, whether to keep inter-layer coupling edges. |
include_isolated |
Logical, whether to keep nodes without retained edges. |
fortify_mnsea_contribution() returns a data.frame.
fortify_mnsea_subnetwork() returns a list containing standardized nodes
and edges tables together with the selected pathway metadata.
convert compareClusterResult to a data.frame that ready for plot
convert enrichResult object for ggplot2
## S3 method for class 'compareClusterResult' fortify( model, data, showCategory = 5, by = "geneRatio", split = NULL, includeAll = TRUE, ... ) ## S3 method for class 'enrichResult' fortify( model, data, showCategory = 5, by = "Count", order = FALSE, drop = FALSE, split = NULL, ... ) ## S3 method for class 'nseaResult' fortify( model, data, showCategory = 5, by = "Count", order = FALSE, drop = FALSE, split = NULL, ... ) ## S3 method for class 'mnseaResult' fortify( model, data, showCategory = 5, by = c("p.adjust", "NES", "contribution", "share"), order = FALSE, drop = FALSE, split = NULL, level = c("result", "pathway"), layer = NULL, ... )## S3 method for class 'compareClusterResult' fortify( model, data, showCategory = 5, by = "geneRatio", split = NULL, includeAll = TRUE, ... ) ## S3 method for class 'enrichResult' fortify( model, data, showCategory = 5, by = "Count", order = FALSE, drop = FALSE, split = NULL, ... ) ## S3 method for class 'nseaResult' fortify( model, data, showCategory = 5, by = "Count", order = FALSE, drop = FALSE, split = NULL, ... ) ## S3 method for class 'mnseaResult' fortify( model, data, showCategory = 5, by = c("p.adjust", "NES", "contribution", "share"), order = FALSE, drop = FALSE, split = NULL, level = c("result", "pathway"), layer = NULL, ... )
model |
'enrichResult' or 'compareClusterResult' object |
data |
not use here |
showCategory |
Category numbers to show |
by |
one of Count and GeneRatio |
split |
separate result by 'split' variable |
includeAll |
logical |
... |
additional parameter |
order |
logical |
drop |
logical |
level |
One of |
layer |
Optional layer or layers to retain for pathway-level output. |
data.frame
data.frame
Guangchuang Yu
label genes in running score plot
geom_gsea_gene( genes, mapping = NULL, geom = ggplot2::geom_text, ..., geneSet = NULL )geom_gsea_gene( genes, mapping = NULL, geom = ggplot2::geom_text, ..., geneSet = NULL )
genes |
selected genes to be labeled |
mapping |
aesthetic mapping, default is NULL |
geom |
geometric layer to plot the gene labels, default is geom_text |
... |
additional parameters passed to the 'geom' |
geneSet |
choose which gene set(s) to be label if the plot contains multiple gene sets |
ggplot object
Guangchuang Yu
This file contains all color-related helper functions Get default enrichplot colors
get_enrichplot_color(n = 2)get_enrichplot_color(n = 2)
n |
number of colors (2 or 3) |
color vector
plot table
ggtable(d, p = NULL)ggtable(d, p = NULL)
d |
data frame |
p |
ggplot object to extract color to color rownames(d), optional |
ggplot object
guangchuang yu
Plot induced GO DAG of significant terms
goplot( x, showCategory = 10, color = "p.adjust", layout = "sugiyama", geom = "text", ... ) ## S4 method for signature 'enrichResult' goplot( x, showCategory = 10, color = "p.adjust", layout = igraph::layout_with_sugiyama, geom = "text", ... ) ## S4 method for signature 'gseaResult' goplot( x, showCategory = 10, color = "p.adjust", layout = igraph::layout_with_sugiyama, geom = "text", ... )goplot( x, showCategory = 10, color = "p.adjust", layout = "sugiyama", geom = "text", ... ) ## S4 method for signature 'enrichResult' goplot( x, showCategory = 10, color = "p.adjust", layout = igraph::layout_with_sugiyama, geom = "text", ... ) ## S4 method for signature 'gseaResult' goplot( x, showCategory = 10, color = "p.adjust", layout = igraph::layout_with_sugiyama, geom = "text", ... )
x |
enrichment result. |
showCategory |
number of categories to display, or a vector of terms. |
color |
variable used to color enriched terms, e.g. |
layout |
layout of the map |
geom |
label geom, one of 'label' or 'text' |
... |
additional parameters. |
ggplot object
Guangchuang Yu
## Not run: library(clusterProfiler) data(geneList, package = "DOSE") de <- names(geneList)[1:100] yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01) goplot(yy) goplot(yy, showCategory = 5) ## End(Not run)## Not run: library(clusterProfiler) data(geneList, package = "DOSE") de <- names(geneList)[1:100] yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01) goplot(yy) goplot(yy, showCategory = 5) ## End(Not run)
plot logFC distribution of selected gene sets
gseadist(x, IDs, type = "density")gseadist(x, IDs, type = "density")
x |
GSEA result |
IDs |
gene set IDs |
type |
one of 'density' or 'boxplot' |
distribution plot
Guangchuang Yu
Visualize GSEA analysis results
gseaplot(x, geneSetID, by = "all", title = "", ...) ## S4 method for signature 'gseaResult' gseaplot( x, geneSetID, by = "all", title = "", color = "black", color.line = "green", color.vline = "#FA5860", ... ) ## S4 method for signature 'mnseaResult' gseaplot( x, geneSetID, by = "all", title = "", color = "black", color.line = "green", color.vline = "#FA5860", layer = NULL, ... ) gseaplot.gseaResult( x, geneSetID, by = "all", title = "", color = "black", color.line = "green", color.vline = "#FA5860", ... )gseaplot(x, geneSetID, by = "all", title = "", ...) ## S4 method for signature 'gseaResult' gseaplot( x, geneSetID, by = "all", title = "", color = "black", color.line = "green", color.vline = "#FA5860", ... ) ## S4 method for signature 'mnseaResult' gseaplot( x, geneSetID, by = "all", title = "", color = "black", color.line = "green", color.vline = "#FA5860", layer = NULL, ... ) gseaplot.gseaResult( x, geneSetID, by = "all", title = "", color = "black", color.line = "green", color.vline = "#FA5860", ... )
x |
gseaResult object |
geneSetID |
geneSet ID |
by |
one of "runningScore" or "position" |
title |
plot title |
... |
additional parameters |
color |
color of line segments |
color.line |
color of running enrichment score line |
color.vline |
color of vertical line indicating the maximum/minimal running enrichment score |
layer |
Optional |
Plotting function for gseaResult
ggplot2 object
ggplot2 object
Guangchuang Yu
library(DOSE) data(geneList) x <- gseDO(geneList) gseaplot(x, geneSetID=1)library(DOSE) data(geneList) x <- gseDO(geneList) gseaplot(x, geneSetID=1)
GSEA plot that mimic the plot generated by broad institute's GSEA software
gseaplot2( x, geneSetID, title = "", color = "green", base_size = 11, rel_heights = c(1.5, 0.5, 1), subplots = 1:3, pvalue_table = FALSE, pvalue_table_columns = c("NES", "p.adjust"), pvalue_table_rownames = "Description", ES_geom = "line", layer = NULL )gseaplot2( x, geneSetID, title = "", color = "green", base_size = 11, rel_heights = c(1.5, 0.5, 1), subplots = 1:3, pvalue_table = FALSE, pvalue_table_columns = c("NES", "p.adjust"), pvalue_table_rownames = "Description", ES_geom = "line", layer = NULL )
x |
gseaResult object |
geneSetID |
gene set ID |
title |
plot title |
color |
color of running enrichment score line |
base_size |
base font size |
rel_heights |
relative heights of subplots |
subplots |
which subplots to be displayed |
pvalue_table |
whether add pvalue table |
pvalue_table_columns |
selected columns to be plotted in the |
pvalue_table_rownames |
selected column as the rownames of the |
ES_geom |
geom for plotting running enrichment score, one of 'line' or 'dot' |
layer |
Optional |
plot
Guangchuang Yu
plot ranked list of genes with running enrichment score as bar height
gsearank(x, geneSetID, title = "", output = "plot", layer = NULL)gsearank(x, geneSetID, title = "", output = "plot", layer = NULL)
x |
gseaResult object |
geneSetID |
gene set ID |
title |
plot title |
output |
one of 'plot' or 'table' (for exporting data) |
layer |
Optional |
ggplot object
Guangchuang Yu
extract gsea result of selected geneSet
gsInfo(object, geneSetID, ...)gsInfo(object, geneSetID, ...)
object |
gseaResult object |
geneSetID |
gene set ID |
... |
additional arguments passed to methods (e.g. |
data.frame
Guangchuang Yu
Heatmap-like plot for functional classification
heatplot( x, showCategory = 30, showTop = NULL, symbol = "rect", foldChange = NULL, pvalue = NULL, label_format = 30, pathway_id = NULL, layer = NULL, value = c("score", "abs_score", "share", "contribution"), ... ) ## S4 method for signature 'enrichResult' heatplot( x, showCategory = 30, showTop = NULL, symbol = "rect", foldChange = NULL, pvalue = NULL, label_format = 30, pathway_id = NULL, layer = NULL, value = c("score", "abs_score", "share", "contribution"), ... ) ## S4 method for signature 'gseaResult' heatplot( x, showCategory = 30, showTop = NULL, symbol = "rect", foldChange = NULL, pvalue = NULL, label_format = 30, pathway_id = NULL, layer = NULL, value = c("score", "abs_score", "share", "contribution"), ... ) ## S4 method for signature 'mnseaResult' heatplot( x, showCategory = 30, showTop = NULL, symbol = "rect", foldChange = NULL, pvalue = NULL, label_format = 30, pathway_id = NULL, layer = NULL, value = c("score", "abs_score", "share", "contribution"), ... ) prepare_heatplot_data(x, showCategory, showTop, foldChange, pvalue)heatplot( x, showCategory = 30, showTop = NULL, symbol = "rect", foldChange = NULL, pvalue = NULL, label_format = 30, pathway_id = NULL, layer = NULL, value = c("score", "abs_score", "share", "contribution"), ... ) ## S4 method for signature 'enrichResult' heatplot( x, showCategory = 30, showTop = NULL, symbol = "rect", foldChange = NULL, pvalue = NULL, label_format = 30, pathway_id = NULL, layer = NULL, value = c("score", "abs_score", "share", "contribution"), ... ) ## S4 method for signature 'gseaResult' heatplot( x, showCategory = 30, showTop = NULL, symbol = "rect", foldChange = NULL, pvalue = NULL, label_format = 30, pathway_id = NULL, layer = NULL, value = c("score", "abs_score", "share", "contribution"), ... ) ## S4 method for signature 'mnseaResult' heatplot( x, showCategory = 30, showTop = NULL, symbol = "rect", foldChange = NULL, pvalue = NULL, label_format = 30, pathway_id = NULL, layer = NULL, value = c("score", "abs_score", "share", "contribution"), ... ) prepare_heatplot_data(x, showCategory, showTop, foldChange, pvalue)
x |
enrichment result. |
showCategory |
number of enriched terms to display |
showTop |
number of top genes ranked by |
symbol |
symbol of the nodes, one of "rect" (the default) or "dot" |
foldChange |
fold change. |
pvalue |
pvalue of genes |
label_format |
a numeric value sets wrap length, alternatively a custom function to format axis labels. by default wraps names longer than 30 characters |
pathway_id |
optional pathway ID for pathway-specific |
layer |
optional layer or layers to retain for |
value |
fill value for |
... |
Additional parameters |
ggplot object
Guangchuang Yu
## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) heatplot(x) ## End(Not run)## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) heatplot(x) ## End(Not run)
Horizontal plot for GSEA result
hplot(x, geneSetID, layer = NULL)hplot(x, geneSetID, layer = NULL)
x |
gseaResult object |
geneSetID |
gene set ID |
layer |
Optional |
horizontal plot
Guangchuang Yu
Import enrichr results
import_enrichr( x, db = 1, gene = NULL, universe = NULL, ontology = "UNKNOWN", organism = "UNKNOWN", keytype = "UNKNOWN", pAdjustMethod = "BH", ... )import_enrichr( x, db = 1, gene = NULL, universe = NULL, ontology = "UNKNOWN", organism = "UNKNOWN", keytype = "UNKNOWN", pAdjustMethod = "BH", ... )
x |
result table (data.frame) or the list of tables returned by
|
db |
if |
gene |
query gene vector used in the analysis |
universe |
background gene vector used in the analysis |
ontology, organism, keytype
|
metadata stored in the object slots |
pAdjustMethod |
method used to compute |
... |
additional parameters passed to
|
Converts the output of enrichR::enrichr() (a list of result
tables, one per database, or a single result table) into an
enrichResult object compatible with 'enrichplot' visualizations.
The gene vector used in the analysis should be supplied for
exact GeneRatio values; universe enables
BgRatio/RichFactor calculation.
An enrichResult object
Import fgsea results
import_fgsea( x, stats, geneSets = NULL, setType = "UNKNOWN", organism = "UNKNOWN", keytype = "UNKNOWN", exponent = 1, scoreType = "std", pAdjustMethod = "BH", ... )import_fgsea( x, stats, geneSets = NULL, setType = "UNKNOWN", organism = "UNKNOWN", keytype = "UNKNOWN", exponent = 1, scoreType = "std", pAdjustMethod = "BH", ... )
x |
result table returned by |
stats |
named numeric vector of ranked statistics, sorted in descending order (sorted automatically with a warning if not) |
geneSets |
the |
setType, organism, keytype
|
metadata stored in the object slots |
exponent, scoreType
|
parameters used to recompute missing
|
pAdjustMethod |
method used to compute |
... |
additional parameters passed to
|
Converts the result table returned by fgsea::fgsea() into a
gseaResult object. The ranked statistics vector (stats)
used as fgsea() input is required, as most GSEA visualizations
consume the ranked list. Passing the pathways list used in the
analysis enables exact running-score plots; without it, gene sets are
rebuilt from the leading edge and plots are approximate.
A gseaResult object
Import g:Profiler (gprofiler2) results
import_gprofiler2( x, gene = NULL, ontology = "UNKNOWN", organism = "UNKNOWN", keytype = "UNKNOWN", pAdjustMethod = "BH", ... )import_gprofiler2( x, gene = NULL, ontology = "UNKNOWN", organism = "UNKNOWN", keytype = "UNKNOWN", pAdjustMethod = "BH", ... )
x |
the object returned by |
gene |
query gene vector; used only when the table has no
|
ontology, organism, keytype
|
metadata stored in the object slots |
pAdjustMethod |
method used to compute |
... |
additional parameters passed to
|
Converts the result of gprofiler2::gost() (the list it returns,
or its result data.frame) into an enrichResult object.
Only the over-representation mode is mapped in this version.
An enrichResult object
Import WebGestaltR results
import_webgestalt( x, gene = NULL, universe = NULL, ontology = "UNKNOWN", organism = "UNKNOWN", keytype = "UNKNOWN", pAdjustMethod = "BH", ... )import_webgestalt( x, gene = NULL, universe = NULL, ontology = "UNKNOWN", organism = "UNKNOWN", keytype = "UNKNOWN", pAdjustMethod = "BH", ... )
x |
result table (data.frame) returned by |
gene |
query gene vector used in the analysis |
universe |
background gene vector used in the analysis |
ontology, organism, keytype
|
metadata stored in the object slots |
pAdjustMethod |
method used to compute |
... |
additional parameters passed to
|
Converts the result table returned by WebGestaltR() into an
enrichResult object. The gene vector used in the
analysis should be supplied for exact GeneRatio values.
An enrichResult object
Manhattan plot for enrichment result
manhattanplot(x, ...) ## S4 method for signature 'enrichResult' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... ) ## S4 method for signature 'gseaResult' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... ) ## S4 method for signature 'compareClusterResult' manhattanplot( x, color = "p.adjust", showCategory = 5, split = NULL, font.size = 12, title = "", size = "Count", includeAll = TRUE, label_format = 30, ... ) ## S4 method for signature 'enrichResultList' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... ) ## S4 method for signature 'gseaResultList' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... ) ## S4 method for signature 'list' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... )manhattanplot(x, ...) ## S4 method for signature 'enrichResult' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... ) ## S4 method for signature 'gseaResult' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... ) ## S4 method for signature 'compareClusterResult' manhattanplot( x, color = "p.adjust", showCategory = 5, split = NULL, font.size = 12, title = "", size = "Count", includeAll = TRUE, label_format = 30, ... ) ## S4 method for signature 'enrichResultList' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... ) ## S4 method for signature 'gseaResultList' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... ) ## S4 method for signature 'list' manhattanplot( x, color = "p.adjust", showCategory = 5, size = "Count", split = NULL, font.size = 12, title = "", label_format = 30, ... )
x |
enrichment result. |
... |
additional parameters. |
color |
variable used to color enriched terms, e.g. |
showCategory |
number of categories to display, or a vector of terms. |
size |
variable used to scale category size, one of |
split |
apply |
font.size |
font size. |
title |
figure title. |
label_format |
a numeric wrap width, or a custom function to format axis labels. |
includeAll |
logical value. |
ggplot object
Guangchuang Yu
Pathway state transition flow
mechanismflow( x, reference = NULL, flow_var = c("NES", "delta_NES", "leading_edge_size"), thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'mnseaResult' mechanismflow( x, reference = NULL, flow_var = c("NES", "delta_NES", "leading_edge_size"), thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'nseaResult' mechanismflow( x, reference = NULL, flow_var = c("NES", "delta_NES", "leading_edge_size"), thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'list' mechanismflow( x, reference = NULL, flow_var = c("NES", "delta_NES", "leading_edge_size"), thresholds = list(rewire = 0.5, nes = 0.2), ... )mechanismflow( x, reference = NULL, flow_var = c("NES", "delta_NES", "leading_edge_size"), thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'mnseaResult' mechanismflow( x, reference = NULL, flow_var = c("NES", "delta_NES", "leading_edge_size"), thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'nseaResult' mechanismflow( x, reference = NULL, flow_var = c("NES", "delta_NES", "leading_edge_size"), thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'list' mechanismflow( x, reference = NULL, flow_var = c("NES", "delta_NES", "leading_edge_size"), thresholds = list(rewire = 0.5, nes = 0.2), ... )
x |
A |
reference |
An optional reference result used to compute
|
flow_var |
One of |
thresholds |
Optional named list with |
... |
Additional parameters passed to plot methods. |
mechanismflow() draws pathway state transitions across contexts
(conditions or layers). Line width and point size encode flow
magnitude, while point shape encodes the mechanism state.
A ggplot object.
Get the similarity matrix
pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) ## S4 method for signature 'enrichResult' pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) ## S4 method for signature 'gseaResult' pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) ## S4 method for signature 'mnseaResult' pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) ## S4 method for signature 'compareClusterResult' pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) prepare_pairwise_termsim_data(x, showCategory) pairwise_termsim.enrichResult( x, method = "JC", semData = NULL, showCategory = NULL ) pairwise_termsim.compareClusterResult( x, method = "JC", semData = NULL, showCategory = NULL )pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) ## S4 method for signature 'enrichResult' pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) ## S4 method for signature 'gseaResult' pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) ## S4 method for signature 'mnseaResult' pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) ## S4 method for signature 'compareClusterResult' pairwise_termsim( x, method = "JC", semData = NULL, showCategory = NULL, layer = NULL ) prepare_pairwise_termsim_data(x, showCategory) pairwise_termsim.enrichResult( x, method = "JC", semData = NULL, showCategory = NULL ) pairwise_termsim.compareClusterResult( x, method = "JC", semData = NULL, showCategory = NULL )
x |
enrichment result. |
method |
method of calculating the similarity between nodes, one of "Resnik", "Lin", "Rel", "Jiang", "Wang", and "JC" (Jaccard similarity coefficient) methods. |
semData |
|
showCategory |
number of enriched terms to be calculated. The default value is the number of enriched terms, or 200 if the number of enriched terms exceeds 200. |
layer |
optional layer or layers to retain when computing feature
overlap for |
This function adds a similarity matrix to the termsim slot of the enrichment result.
Users can use the method parameter to select the method of calculating the similarity.
The Jaccard correlation coefficient (JC) is used by default, and it applies to all situations.
When users want to calculate the correlation between GO terms or DO terms, they can also choose
"Resnik", "Lin", "Rel" or "Jiang" (they are semantic similarity calculation methods from the 'GOSemSim' package),
and at this time, the user needs to provide the semData parameter, which can be obtained through
GOSemSim::godata().
## Not run: library(clusterProfiler) library(org.Hs.eg.db) library(enrichplot) library(GOSemSim) library(DOSE) data(geneList) gene <- names(geneList)[abs(geneList) > 2] ego <- enrichGO(gene = gene, universe = names(geneList), OrgDb = org.Hs.eg.db, ont = "BP", pAdjustMethod = "BH", pvalueCutoff = 0.01, qvalueCutoff = 0.05, readable = TRUE) d <- godata('org.Hs.eg.db', ont="BP") ego2 <- pairwise_termsim(ego, method="Wang", semData = d) emapplot(ego2) emapplot_cluster(ego2) ## End(Not run)## Not run: library(clusterProfiler) library(org.Hs.eg.db) library(enrichplot) library(GOSemSim) library(DOSE) data(geneList) gene <- names(geneList)[abs(geneList) > 2] ego <- enrichGO(gene = gene, universe = names(geneList), OrgDb = org.Hs.eg.db, ont = "BP", pAdjustMethod = "BH", pvalueCutoff = 0.01, qvalueCutoff = 0.05, readable = TRUE) d <- godata('org.Hs.eg.db', ont="BP") ego2 <- pairwise_termsim(ego, method="Wang", semData = d) emapplot(ego2) emapplot_cluster(ego2) ## End(Not run)
Phase plot for enrichment-shift versus rewiring
phaseplot( x, reference = NULL, selected_layer = NULL, reference_layer = NULL, x_axis = NULL, size_var = c("leading_edge_size", "leading_edge_overlap"), showCategory = 30, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'nseaResult' phaseplot( x, reference = NULL, selected_layer = NULL, reference_layer = NULL, x_axis = NULL, size_var = c("leading_edge_size", "leading_edge_overlap"), showCategory = 30, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'mnseaResult' phaseplot( x, reference = NULL, selected_layer = NULL, reference_layer = NULL, x_axis = NULL, size_var = c("leading_edge_size", "leading_edge_overlap"), showCategory = 30, thresholds = list(rewire = 0.5, nes = 0.2), ... )phaseplot( x, reference = NULL, selected_layer = NULL, reference_layer = NULL, x_axis = NULL, size_var = c("leading_edge_size", "leading_edge_overlap"), showCategory = 30, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'nseaResult' phaseplot( x, reference = NULL, selected_layer = NULL, reference_layer = NULL, x_axis = NULL, size_var = c("leading_edge_size", "leading_edge_overlap"), showCategory = 30, thresholds = list(rewire = 0.5, nes = 0.2), ... ) ## S4 method for signature 'mnseaResult' phaseplot( x, reference = NULL, selected_layer = NULL, reference_layer = NULL, x_axis = NULL, size_var = c("leading_edge_size", "leading_edge_overlap"), showCategory = 30, thresholds = list(rewire = 0.5, nes = 0.2), ... )
x |
A |
reference |
An optional reference result (another |
selected_layer |
Optional layer name for |
reference_layer |
Optional reference layer name for |
x_axis |
One of |
size_var |
One of |
showCategory |
Number (or vector) of pathways to display. |
thresholds |
Optional named list with |
... |
Additional parameters passed to plot methods. |
phaseplot() places each pathway on a two-dimensional plane:
enrichment strength (or shift) on the x-axis and rewiring score on
the y-axis. Point size and color encode leading-edge information and
mechanism class.
A ggplot object.
Internal plot function for plotting compareClusterResult
plotting.clusterProfile( clProf.reshape.df, x = ~Cluster, type = "dot", colorBy = "p.adjust", by = "geneRatio", title = "", font.size = 12, width = NULL )plotting.clusterProfile( clProf.reshape.df, x = ~Cluster, type = "dot", colorBy = "p.adjust", by = "geneRatio", title = "", font.size = 12, width = NULL )
clProf.reshape.df |
data frame of compareCluster result |
x |
x variable |
type |
one of dot and bar |
colorBy |
one of pvalue or p.adjust |
by |
one of percentage and count |
title |
graph title |
font.size |
graph font size |
width |
width of the plot |
ggplot object
Guangchuang Yu https://yulab-smu.top
PubMed Central Trend plot
pmcplot(query, period, proportion = TRUE, data = NULL)pmcplot(query, period, proportion = TRUE, data = NULL)
query |
query terms |
period |
period of query in the unit of year |
proportion |
If TRUE, use query_hits/all_hits, otherwise use query_hits. |
data |
Optional data.frame with |
ggplot object
Guangchuang Yu
Category-gene-network plot
prepare_cnetplot_data(x, showCategory, foldChange) ## S3 method for class 'enrichResult' cnetplot( x, layout = igraph::layout_with_kk, showCategory = 5, color_category = "#E5C494", size_category = 1, color_item = "#B3B3B3", size_item = 1, color_edge = "grey", size_edge = 0.5, categorySizeBy = ~itemNum, node_label = "all", node_label_size = NULL, foldChange = NULL, fc_threshold = NULL, hilight = "none", hilight_alpha = 0.3, ... ) ## S3 method for class 'gseaResult' cnetplot( x, layout = igraph::layout_with_kk, showCategory = 5, color_category = "#E5C494", size_category = 1, color_item = "#B3B3B3", size_item = 1, color_edge = "grey", size_edge = 0.5, categorySizeBy = ~itemNum, node_label = "all", node_label_size = NULL, foldChange = NULL, fc_threshold = NULL, hilight = "none", hilight_alpha = 0.3, ... ) prepare_mnsea_cnetplot_data( x, pathway_id, layer, include_couplings, include_isolated = FALSE ) ## S3 method for class 'mnseaResult' cnetplot( x, layout = igraph::layout_with_kk, showCategory = 5, color_category = "#E5C494", size_category = 1, color_item = "#B3B3B3", size_item = 1, color_edge = "grey", size_edge = 0.5, categorySizeBy = ~itemNum, node_label = "all", node_label_size = NULL, foldChange = NULL, fc_threshold = NULL, hilight = "none", hilight_alpha = 0.3, pathway_id = NULL, layer = NULL, include_couplings = TRUE, ... ) ## S3 method for class 'compareClusterResult' cnetplot( x, layout = igraph::layout_with_kk, showCategory = 5, color_category = "#E5C494", size_category = 1, color_item = "#B3B3B3", size_item = 1, color_edge = "grey", size_edge = 0.5, categorySizeBy = ~itemNum, node_label = "all", node_label_size = NULL, foldChange = NULL, fc_threshold = NULL, hilight = "none", hilight_alpha = 0.3, ... )prepare_cnetplot_data(x, showCategory, foldChange) ## S3 method for class 'enrichResult' cnetplot( x, layout = igraph::layout_with_kk, showCategory = 5, color_category = "#E5C494", size_category = 1, color_item = "#B3B3B3", size_item = 1, color_edge = "grey", size_edge = 0.5, categorySizeBy = ~itemNum, node_label = "all", node_label_size = NULL, foldChange = NULL, fc_threshold = NULL, hilight = "none", hilight_alpha = 0.3, ... ) ## S3 method for class 'gseaResult' cnetplot( x, layout = igraph::layout_with_kk, showCategory = 5, color_category = "#E5C494", size_category = 1, color_item = "#B3B3B3", size_item = 1, color_edge = "grey", size_edge = 0.5, categorySizeBy = ~itemNum, node_label = "all", node_label_size = NULL, foldChange = NULL, fc_threshold = NULL, hilight = "none", hilight_alpha = 0.3, ... ) prepare_mnsea_cnetplot_data( x, pathway_id, layer, include_couplings, include_isolated = FALSE ) ## S3 method for class 'mnseaResult' cnetplot( x, layout = igraph::layout_with_kk, showCategory = 5, color_category = "#E5C494", size_category = 1, color_item = "#B3B3B3", size_item = 1, color_edge = "grey", size_edge = 0.5, categorySizeBy = ~itemNum, node_label = "all", node_label_size = NULL, foldChange = NULL, fc_threshold = NULL, hilight = "none", hilight_alpha = 0.3, pathway_id = NULL, layer = NULL, include_couplings = TRUE, ... ) ## S3 method for class 'compareClusterResult' cnetplot( x, layout = igraph::layout_with_kk, showCategory = 5, color_category = "#E5C494", size_category = 1, color_item = "#B3B3B3", size_item = 1, color_edge = "grey", size_edge = 0.5, categorySizeBy = ~itemNum, node_label = "all", node_label_size = NULL, foldChange = NULL, fc_threshold = NULL, hilight = "none", hilight_alpha = 0.3, ... )
x |
input object |
showCategory |
number of categories to display or a vector of terms. |
foldChange |
numeric values to color the item (e.g., fold change of gene expression values) |
layout |
network layout |
color_category |
color of category nodes |
size_category |
relative size of the category nodes |
color_item |
color of item nodes |
size_item |
relative size of the item nodes (e.g., genes) |
color_edge |
color of edge |
size_edge |
relative size of edge |
categorySizeBy |
An expression (e.g., |
node_label |
one of 'all', 'none', 'category', 'item', 'exclusive' or 'share'. 'exclusive' labels genes that uniquely belong to categories; 'share' labels genes that are shared between categories. |
node_label_size |
size of the node label text. When |
fc_threshold |
threshold for filtering genes by absolute fold change (e.g., fc_threshold = 1 keeps only genes with |foldChange| > 1). |
hilight |
selected categories to be highlighted |
hilight_alpha |
transparency value for non-highlighted items |
... |
additional parameters. Legacy |
pathway_id |
optional pathway ID for |
layer |
optional layer or layers to retain for |
include_couplings |
logical, whether inter-layer coupling edges should
be kept in |
include_isolated |
logical, whether isolated feature nodes should be
kept in |
For mnseaResult, cnetplot() visualizes a pathway-specific
multilayer subnetwork returned by fortify_mnsea_subnetwork(). Feature nodes
are grouped by layer, a synthetic pathway node is added as the anchor, and
optional coupling edges connect features across layers.
Pathway-specific rewiring plot
rewireplot(x, ...) ## S4 method for signature 'nseaResult' rewireplot(x, ...) ## S4 method for signature 'mnseaResult' rewireplot(x, ...)rewireplot(x, ...) ## S4 method for signature 'nseaResult' rewireplot(x, ...) ## S4 method for signature 'mnseaResult' rewireplot(x, ...)
x |
A |
... |
Additional parameters passed to plot methods. |
A ggplot object.
Ridgeline plot for GSEA result
ridgeplot( x, showCategory = 30, fill = "p.adjust", core_enrichment = TRUE, label_format = 30, ... ) ## S4 method for signature 'gseaResult' ridgeplot( x, showCategory = 30, fill = "p.adjust", core_enrichment = TRUE, label_format = 30, ... ) ## S4 method for signature 'mnseaResult' ridgeplot( x, showCategory = 30, fill = "p.adjust", core_enrichment = TRUE, label_format = 30, orderBy = "NES", decreasing = FALSE, stat = "density_ridges", layer = NULL, ... ) ridgeplot.gseaResult( x, showCategory = 30, fill = "p.adjust", core_enrichment = TRUE, label_format = 30, orderBy = "NES", decreasing = FALSE, stat = "density_ridges" )ridgeplot( x, showCategory = 30, fill = "p.adjust", core_enrichment = TRUE, label_format = 30, ... ) ## S4 method for signature 'gseaResult' ridgeplot( x, showCategory = 30, fill = "p.adjust", core_enrichment = TRUE, label_format = 30, ... ) ## S4 method for signature 'mnseaResult' ridgeplot( x, showCategory = 30, fill = "p.adjust", core_enrichment = TRUE, label_format = 30, orderBy = "NES", decreasing = FALSE, stat = "density_ridges", layer = NULL, ... ) ridgeplot.gseaResult( x, showCategory = 30, fill = "p.adjust", core_enrichment = TRUE, label_format = 30, orderBy = "NES", decreasing = FALSE, stat = "density_ridges" )
x |
gseaResult object |
showCategory |
number of categories to display or a vector of terms. |
fill |
one of "pvalue", "p.adjust", "qvalue" |
core_enrichment |
whether to use only core_enriched genes |
label_format |
a numeric value setting the wrap length, alternatively a custom function to format axis labels. |
... |
additional parameters. |
orderBy |
The order of the Y-axis |
decreasing |
logical. Should the orderBy order be increasing or decreasing? |
stat |
statistic passed to |
layer |
Optional |
ggplot object
Guangchuang Yu
library(DOSE) data(geneList) x <- gseDO(geneList) ridgeplot(x)library(DOSE) data(geneList) x <- gseDO(geneList) ridgeplot(x)
Helper function to set color scale for enrichplot
set_enrichplot_color( colors = get_enrichplot_color(2), type = "color", name = NULL, .fun = NULL, reverse = TRUE, transform = "identity", ... )set_enrichplot_color( colors = get_enrichplot_color(2), type = "color", name = NULL, .fun = NULL, reverse = TRUE, transform = "identity", ... )
colors |
user provided color vector |
type |
one of 'color', 'colour' or 'fill' |
name |
name of the color legend |
.fun |
force to use user provided color scale function |
reverse |
whether reverse the color scheme |
transform |
transform the color scale |
... |
additional parameters |
a color scale
Guangchuang Yu
Similarity Space Plot for enrichment analysis
ssplot(x, ...) ## S4 method for signature 'enrichResult' ssplot( x, showCategory = 30, ..., min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE ) ## S4 method for signature 'gseaResult' ssplot( x, showCategory = 30, ..., min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE ) ## S4 method for signature 'mnseaResult' ssplot( x, showCategory = 30, ..., min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE ) ## S4 method for signature 'compareClusterResult' ssplot( x, showCategory = 30, ..., min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE ) ssplot.enrichResult( x, showCategory = 30, drfun = NULL, dr.params = list(), node_label = "group", min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ssplot.compareClusterResult( x, showCategory = 30, pie = "equal", drfun = NULL, dr.params = list(), node_label = "group", min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... )ssplot(x, ...) ## S4 method for signature 'enrichResult' ssplot( x, showCategory = 30, ..., min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE ) ## S4 method for signature 'gseaResult' ssplot( x, showCategory = 30, ..., min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE ) ## S4 method for signature 'mnseaResult' ssplot( x, showCategory = 30, ..., min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE ) ## S4 method for signature 'compareClusterResult' ssplot( x, showCategory = 30, ..., min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE ) ssplot.enrichResult( x, showCategory = 30, drfun = NULL, dr.params = list(), node_label = "group", min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... ) ssplot.compareClusterResult( x, showCategory = 30, pie = "equal", drfun = NULL, dr.params = list(), node_label = "group", min_edge = 0.2, size_edge = 0.5, edge_filter = "threshold", top_k = 5, target_density = 0.1, edge_diagnostic = FALSE, ... )
x |
Enrichment result. |
||||||||||||||||||||||||
... |
additional parameters Additional plotting parameters are inherited from |
||||||||||||||||||||||||
showCategory |
number of categories to display or a vector of terms. |
||||||||||||||||||||||||
min_edge |
The minimum similarity threshold for connecting two nodes;
should be between 0 and 1. Passed to |
||||||||||||||||||||||||
size_edge |
Relative size of the edge width. Passed to |
||||||||||||||||||||||||
edge_filter |
Edge filtering strategy: |
||||||||||||||||||||||||
top_k |
Number of strongest neighbors retained per term when
|
||||||||||||||||||||||||
target_density |
Target proportion of unique term pairs when
|
||||||||||||||||||||||||
edge_diagnostic |
Logical; if |
||||||||||||||||||||||||
drfun |
Function used for dimension reduction. The default,
|
||||||||||||||||||||||||
dr.params |
A named list of arguments passed separately to |
||||||||||||||||||||||||
node_label |
Select which labels to display and whether the groups are outlined. One of:
|
||||||||||||||||||||||||
pie |
one of 'equal' or 'Count' to set the slice ratio of the pies |
Creates 2D visualization of enrichment results using dimension reduction techniques to show relationships between terms based on similarity.
ggplot object
Guangchuang Yu
## Not run: library(clusterProfiler) library(org.Hs.eg.db) library(enrichplot) library(GOSemSim) library(DOSE) data(geneList) gene <- names(geneList)[abs(geneList) > 2] ego <- enrichGO(gene = gene, universe = names(geneList), OrgDb = org.Hs.eg.db, ont = "BP", pAdjustMethod = "BH", pvalueCutoff = 0.01, qvalueCutoff = 0.05, readable = TRUE) d <- godata('org.Hs.eg.db', ont="BP") ego2 <- pairwise_termsim(ego, method = "Wang", semData = d) ssplot(ego2) # Edge controls are forwarded to emapplot; increase min_edge for a # less dense display when showing many terms. ssplot(ego2, showCategory = 50, min_edge = 0.4, size_edge = 0.5) ## End(Not run)## Not run: library(clusterProfiler) library(org.Hs.eg.db) library(enrichplot) library(GOSemSim) library(DOSE) data(geneList) gene <- names(geneList)[abs(geneList) > 2] ego <- enrichGO(gene = gene, universe = names(geneList), OrgDb = org.Hs.eg.db, ont = "BP", pAdjustMethod = "BH", pvalueCutoff = 0.01, qvalueCutoff = 0.05, readable = TRUE) d <- godata('org.Hs.eg.db', ont="BP") ego2 <- pairwise_termsim(ego, method = "Wang", semData = d) ssplot(ego2) # Edge controls are forwarded to emapplot; increase min_edge for a # less dense display when showing many terms. ssplot(ego2, showCategory = 50, min_edge = 0.4, size_edge = 0.5) ## End(Not run)
Functional grouping tree diagram for enrichment result of over-representation test or gene set enrichment analysis.
Creates hierarchical tree visualization of enriched terms based on similarity
treeplot(x, ...) ## S4 method for signature 'enrichResult' treeplot(x, ...) ## S4 method for signature 'gseaResult' treeplot(x, ...) ## S4 method for signature 'compareClusterResult' treeplot(x, ...) treeplot_internal( x, showCategory = 30, color = "p.adjust", size_var = c("Count", "setSize"), split = NULL, nCluster = 5, cluster_method = "ward.D", label_format = 30, fontsize_tiplab = 4, fontsize_cladelab = 4, group_color = NULL, extend = 0.3, hilight = TRUE, align = "both", hexpand = 0.1, tiplab_offset = 0.2, cladelab_offset = 1 )treeplot(x, ...) ## S4 method for signature 'enrichResult' treeplot(x, ...) ## S4 method for signature 'gseaResult' treeplot(x, ...) ## S4 method for signature 'compareClusterResult' treeplot(x, ...) treeplot_internal( x, showCategory = 30, color = "p.adjust", size_var = c("Count", "setSize"), split = NULL, nCluster = 5, cluster_method = "ward.D", label_format = 30, fontsize_tiplab = 4, fontsize_cladelab = 4, group_color = NULL, extend = 0.3, hilight = TRUE, align = "both", hexpand = 0.1, tiplab_offset = 0.2, cladelab_offset = 1 )
x |
enrichment result. |
... |
additional parameters |
showCategory |
number of enriched terms to display |
color |
variable to color nodes, e.g. 'p.adjust', 'pvalue', or 'qvalue' |
size_var |
variable for node size, e.g. 'Count' (for enrichResult) or 'setSize' (for gseaResult) |
split |
optional result column used to keep split metadata available for faceting |
nCluster |
number of clusters for tree cutting |
cluster_method |
hierarchical clustering method |
label_format |
wrap length for labels or custom formatting function |
fontsize_tiplab |
font size for tip labels |
fontsize_cladelab |
font size for clade labels |
group_color |
vector of colors for groups |
extend |
extend length for clade labels |
hilight |
whether to highlight clades |
align |
alignment for highlight rectangles |
hexpand |
expand x limits by amount of xrange * hexpand |
tiplab_offset |
offset for tip labels |
cladelab_offset |
offset for clade labels |
This function visualizes gene sets as a tree. Gene sets with high similarity tend to cluster together, making it easier for interpretation.
ggplot object
ggplot2 object representing the tree plot
## Not run: library(clusterProfiler) library(org.Hs.eg.db) library(enrichplot) library(GOSemSim) library(ggplot2) library(DOSE) data(geneList) gene <- names(geneList)[abs(geneList) > 2] ego <- enrichGO(gene = gene, universe = names(geneList), OrgDb = org.Hs.eg.db, ont = "BP", pAdjustMethod = "BH", pvalueCutoff = 0.01, qvalueCutoff = 0.05, readable = TRUE) d <- godata('org.Hs.eg.db', ont="BP") ego2 <- pairwise_termsim(ego, method = "Wang", semData = d) treeplot(ego2, showCategory = 30) # use `hilight = FALSE` to remove ggtree::geom_hilight() layer. treeplot(ego2, showCategory = 30, hilight = FALSE) # use `offset` parameter to adjust the distance of bar and tree. treeplot(ego2, showCategory = 30, hilight = FALSE, offset = rel(1.5)) # use `offset_tiplab` parameter to adjust the distance of nodes and branches. treeplot(ego2, showCategory = 30, hilight = FALSE, offset_tiplab = rel(1.5)) keep <- rownames(ego2@termsim)[c(1:10, 16:20)] keep treeplot(ego2, showCategory = keep) treeplot(ego2, showCategory = 20, group_color = c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442")) # It can also graph compareClusterResult data(gcSample) xx <- compareCluster(gcSample, fun="enrichKEGG", organism="hsa", pvalueCutoff=0.05) xx <- pairwise_termsim(xx) treeplot(xx) # use `geneClusterPanel` to change the gene cluster panel. treeplot(xx, geneClusterPanel = "dotplot") treeplot(xx, geneClusterPanel = "pie") ## End(Not run)## Not run: library(clusterProfiler) library(org.Hs.eg.db) library(enrichplot) library(GOSemSim) library(ggplot2) library(DOSE) data(geneList) gene <- names(geneList)[abs(geneList) > 2] ego <- enrichGO(gene = gene, universe = names(geneList), OrgDb = org.Hs.eg.db, ont = "BP", pAdjustMethod = "BH", pvalueCutoff = 0.01, qvalueCutoff = 0.05, readable = TRUE) d <- godata('org.Hs.eg.db', ont="BP") ego2 <- pairwise_termsim(ego, method = "Wang", semData = d) treeplot(ego2, showCategory = 30) # use `hilight = FALSE` to remove ggtree::geom_hilight() layer. treeplot(ego2, showCategory = 30, hilight = FALSE) # use `offset` parameter to adjust the distance of bar and tree. treeplot(ego2, showCategory = 30, hilight = FALSE, offset = rel(1.5)) # use `offset_tiplab` parameter to adjust the distance of nodes and branches. treeplot(ego2, showCategory = 30, hilight = FALSE, offset_tiplab = rel(1.5)) keep <- rownames(ego2@termsim)[c(1:10, 16:20)] keep treeplot(ego2, showCategory = keep) treeplot(ego2, showCategory = 20, group_color = c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442")) # It can also graph compareClusterResult data(gcSample) xx <- compareCluster(gcSample, fun="enrichKEGG", organism="hsa", pvalueCutoff=0.05) xx <- pairwise_termsim(xx) treeplot(xx) # use `geneClusterPanel` to change the gene cluster panel. treeplot(xx, geneClusterPanel = "dotplot") treeplot(xx, geneClusterPanel = "pie") ## End(Not run)
upsetplot method generics
Upsetplot
upsetplot( x, n = 10, type = "boxplot", layer = NULL, value = c("score", "abs_score"), core_enrichment = FALSE, ... ) ## S4 method for signature 'enrichResult' upsetplot( x, n = 10, type = "boxplot", layer = NULL, value = c("score", "abs_score"), core_enrichment = FALSE, ... ) ## S4 method for signature 'gseaResult' upsetplot( x, n = 10, type = "boxplot", layer = NULL, value = c("score", "abs_score"), core_enrichment = FALSE, ... ) ## S4 method for signature 'mnseaResult' upsetplot( x, n = 10, type = "boxplot", layer = NULL, value = c("score", "abs_score"), core_enrichment = FALSE, ... )upsetplot( x, n = 10, type = "boxplot", layer = NULL, value = c("score", "abs_score"), core_enrichment = FALSE, ... ) ## S4 method for signature 'enrichResult' upsetplot( x, n = 10, type = "boxplot", layer = NULL, value = c("score", "abs_score"), core_enrichment = FALSE, ... ) ## S4 method for signature 'gseaResult' upsetplot( x, n = 10, type = "boxplot", layer = NULL, value = c("score", "abs_score"), core_enrichment = FALSE, ... ) ## S4 method for signature 'mnseaResult' upsetplot( x, n = 10, type = "boxplot", layer = NULL, value = c("score", "abs_score"), core_enrichment = FALSE, ... )
x |
object |
n |
number of categories to be plotted |
type |
one of 'boxplot' or 'violin' for |
layer |
Optional |
value |
score summary to display for overlapping features. |
core_enrichment |
logical. Should only core mnsea features be used? |
... |
additional parameters |
plot
Guangchuang Yu
## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) upsetplot(x, 8) ## End(Not run)## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) upsetplot(x, 8) ## End(Not run)
Volcano plot for enrichment result
volplot( x, color = "zScore", xintercept = 1, yintercept = 2, showCategory = 5, label_format = 30, ... ) ## S4 method for signature 'enrichResult' volplot( x, color = "zScore", xintercept = 1, yintercept = 2, showCategory = 5, label_format = 30, ... ) volplot.enrichResult( x, color = "zScore", xintercept = 1, yintercept = 2, showCategory = 5, label_format = 30, font.size = 12, size = 5 )volplot( x, color = "zScore", xintercept = 1, yintercept = 2, showCategory = 5, label_format = 30, ... ) ## S4 method for signature 'enrichResult' volplot( x, color = "zScore", xintercept = 1, yintercept = 2, showCategory = 5, label_format = 30, ... ) volplot.enrichResult( x, color = "zScore", xintercept = 1, yintercept = 2, showCategory = 5, label_format = 30, font.size = 12, size = 5 )
x |
enrichment result. |
color |
selected variable to color the dots |
xintercept |
value to set x-intercept |
yintercept |
value to set y-intercept |
showCategory |
number of most significant enriched terms or selected terms to display determined by the variable selected to color the dots |
label_format |
a numeric value setting the wrap length, alternatively a custom function to format axis labels. |
... |
Additional parameters |
font.size |
font size for |
size |
font size to label selected categories specified by showCategory |
ggplot object
Guangchuang Yu
## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) volplot(x) ## End(Not run)## Not run: library(DOSE) data(geneList) de <- names(geneList)[1:100] x <- enrichDO(de) volplot(x) ## End(Not run)