union_render {GCModeller} | R Documentation |
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.
union_render(union.data,
outputdir = './',
id = 'KEGG',
compound = 'compound',
gene = 'gene',
protein = 'protein',
text.color = 'white',
kegg.maps = NULL);
Highlight Data Format: The `compound`, `gene`, and `protein` columns should contain strings in one of two formats:
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.
Invisibly returns `NULL`. Primary output is generated as files in `outputdir`.
#\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"
)
#}