| Title: | Data Integration and Visualization on 'WikiPathways' Graphics |
|---|---|
| Description: | Retrieves pathway graphics from 'WikiPathways' and maps user-supplied quantitative data, such as gene expression values, onto pathway nodes. Provides a pipe-friendly grammar for building pathway visualizations with layered fills, text highlighting, condition-wise comparisons, data preparation helpers, and batch rendering utilities. |
| Authors: | Guangchuang Yu [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-6485-8781>), Yihao Chen [aut] |
| Maintainer: | Guangchuang Yu <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 0.1.7 |
| Built: | 2026-09-28 08:51:59 UTC |
| Source: | https://github.com/yulab-smu/wikiprofiler |
parse wikipathway gmt file to a gson object
read.wp(file)read.wp(file)
file |
wikipathway gmt file downloaded from 'https://wikipathways-data.wmcloud.org/current/gmt/' |
a 'gson' object
Guangchuang Yu
Generate a color array.Fill the gene then generate the legend.
wp_bgfill( p, value, high = "red", low = "blue", legend = TRUE, legend_x = 0.001, legend_y = 0.94 )wp_bgfill( p, value, high = "red", low = "blue", legend = TRUE, legend_x = 0.001, legend_y = 0.94 )
p |
p is |
value |
value is the amount of expression. |
high |
The color of highest gene. |
low |
The color of lowest gene. |
legend |
Whether you need legend. |
legend_x |
horizontal position of the legend |
legend_y |
vertical position of the legend |
A 'wpplot' object
Compute pathway-level comparison values from two symbol-keyed
numeric vectors and render them through wp_bgfill().
wp_comparefill( p, value, control, mode = c("difference", "log2_ratio"), pseudocount = 1, high = "red", low = "blue", legend = TRUE, legend_x = 0.001, legend_y = 0.94 )wp_comparefill( p, value, control, mode = c("difference", "log2_ratio"), pseudocount = 1, high = "red", low = "blue", legend = TRUE, legend_x = 0.001, legend_y = 0.94 )
p |
A |
value |
Case-condition values. |
control |
Control-condition values. |
mode |
Comparison mode: direct difference or log2 ratio. |
pseudocount |
Added before ratio calculation when |
high |
High-end color passed to |
low |
Low-end color passed to |
legend |
Whether to draw the legend. |
legend_x |
Horizontal position of the legend. |
legend_y |
Vertical position of the legend. |
A wpplot object.
Normalize a named numeric vector or a data.frame into a
symbol-keyed numeric vector that can be used by wp_bgfill().
wp_map( data, value_col = NULL, symbol_col = NULL, id_col = NULL, mapping = NULL, mapping_from = NULL, mapping_to = NULL, aggregator = c("mean", "median", "max_abs", "first", "sum"), na.rm = TRUE )wp_map( data, value_col = NULL, symbol_col = NULL, id_col = NULL, mapping = NULL, mapping_from = NULL, mapping_to = NULL, aggregator = c("mean", "median", "max_abs", "first", "sum"), na.rm = TRUE )
data |
A named numeric vector or a data.frame. |
value_col |
Value column name when |
symbol_col |
Symbol column name when |
id_col |
Identifier column name when |
mapping |
Optional ID-to-symbol mapping. It can be a named character vector or a two-column data.frame. |
mapping_from |
Source ID column in |
mapping_to |
Target symbol column in |
aggregator |
Aggregation rule used when multiple rows map to the same symbol. |
na.rm |
Whether to remove |
A named numeric vector keyed by gene symbol.
Render pathway IDs directly from a character vector, a result
table, or an enrichment-like S4 object with a result slot.
wp_render( pathway, value = NULL, control = NULL, n = NULL, id_col = "ID", name_col = NULL, dir = NULL, file_ext = "png", filename_template = "{id}", width = NULL, height = NULL, shadowtext = FALSE, bg.r = 2, bg.col = "white", mode = c("difference", "log2_ratio"), pseudocount = 1, high = "red", low = "blue", legend = TRUE, legend_x = 0.001, legend_y = 0.94 )wp_render( pathway, value = NULL, control = NULL, n = NULL, id_col = "ID", name_col = NULL, dir = NULL, file_ext = "png", filename_template = "{id}", width = NULL, height = NULL, shadowtext = FALSE, bg.r = 2, bg.col = "white", mode = c("difference", "log2_ratio"), pseudocount = 1, high = "red", low = "blue", legend = TRUE, legend_x = 0.001, legend_y = 0.94 )
pathway |
Pathway IDs, a data.frame, or an enrichment-like S4 object. |
value |
Optional symbol-keyed values for single-condition rendering. |
control |
Optional symbol-keyed control values for comparison rendering. |
n |
Maximum number of pathway IDs to render. |
id_col |
Column name that stores pathway IDs. |
name_col |
Optional column name used for output file naming when
|
dir |
Optional output directory. When provided, PNG files are written there. |
file_ext |
Output file extension(s) passed to |
filename_template |
Output filename template. Supported placeholders:
|
width |
Width passed to |
height |
Height passed to |
shadowtext |
Whether to add halo text after fill rendering. |
bg.r |
Halo width passed to |
bg.col |
Halo color passed to |
mode |
Comparison mode passed to |
pseudocount |
Pseudocount passed to |
high |
High-end color passed to fill functions. |
low |
Low-end color passed to fill functions. |
legend |
Whether to draw the legend. |
legend_x |
Horizontal position of the legend. |
legend_y |
Vertical position of the legend. |
A named list of wpplot objects.
Add use svghalo2 function to add halo.
wp_shadowtext(p, bg.r = 2, bg.col = "white")wp_shadowtext(p, bg.r = 2, bg.col = "white")
p |
An wpplot class variance. |
bg.r |
The width of halo. |
bg.col |
The color of halo. |
A 'wpplot' object
Use wikipathways ID to open a local svg file. Then extract related information from svg file and build a wpplot class variance.
wpplot(ID)wpplot(ID)
ID |
ID is wikipathways' ID. |
A 'wpplot' object
## Not run: wpplot('WP179') ## End(Not run)## Not run: wpplot('WP179') ## End(Not run)
Save the 'wpplot' object to a file.
wpsave(p, file, width = NULL, height = NULL, ...)wpsave(p, file, width = NULL, height = NULL, ...)
p |
A 'wpplot' object |
file |
the file to save the object |
width |
Width of the figure |
height |
Height of the figure |
... |
additional parameter passed to 'ggsave' |
output the file and the input 'wpplot' object (invisible)