union_render {GCModeller} R Documentation

Render KEGG Pathway Maps with Multi-Omics Highlighting

Description

Generates interactive HTML and static PNG visualizations of KEGG pathway maps with customizable highlighting for compounds, genes, and proteins. Output files are saved to the specified directory.

Usage

union_render(union.data,
    outputdir = './',
    id = 'KEGG',
    compound = 'compound',
    gene = 'gene',
    protein = 'protein',
    text.color = 'white',
    kegg.maps = NULL);

Arguments

union.data

A data frame or file path (CSV) containing KEGG pathway IDs and highlight information. Must include columns specified in `id`, `compound`, `gene`, and `protein` parameters. If a character string is provided, it is interpreted as a file path to a CSV file.

outputdir

Output directory path for rendered files (default: "./").

id

Column name in `union_data` containing KEGG pathway IDs (default: "KEGG").

compound

Column name in `union_data` containing compound highlight data (default: "compound"). See Details for formatting.

gene

Column name in `union_data` containing gene highlight data (default: "gene").

protein

Column name in `union_data` containing protein highlight data (default: "protein").

text.color

Color for node labels on pathway maps (default: "white").

kegg.maps

Directory path containing KEGG map XML files. If `NULL` (default), uses the package's internal XML resources.

Details

Highlight Data Format: The `compound`, `gene`, and `protein` columns should contain strings in one of two formats:

  1. Semicolon-separated key-value pairs: `"K00001:blue;K00002:red;C00001:green"`
  2. Semicolon-separated IDs (default color: red): `"K00001;K00002;C00001"`

These are parsed by `parse.highlight_tuples()` into named lists (e.g., `list(K00001 = "blue", K00002 = "red")`). Output Files: For each KEGG ID, two files are generated:

Error Handling: Errors during rendering are caught and printed to the console without stopping execution.

Authors

xieguigang

Value

Invisibly returns `NULL`. Primary output is generated as files in `outputdir`.

Examples

#\dontrun{

# Minimal example with default column names
data <- data.frame(
KEGG = "map00010",
compound = "C00031:green;C00022:blue",
gene = "hsa:1234;hsa:5678:yellow",
protein = "P12345"
)
union_render(data, outputdir = "~/kegg_output")
# Custom column names and text color
data <- data.frame(
PathwayID = "map00020",
Metabolites = "C00024; C00036:orange",
Genes = "hsa:9012:purple",
Proteins = "P67890:red"
)
union_render(data,
id = "PathwayID",
compound = "Metabolites",
gene = "Genes",
protein = "Proteins",
text.color = "black"
)
#}

[Package GCModeller version 1.1.0-beta Index]