View source: R/render-network.R
| render_network | R Documentation |
Builds a ggraph plot where nodes are sets (sized by inclusive cardinality) and edges are pairwise overlaps (thickness proportional to the chosen metric; blue for FDR-significant edges below 'significance_threshold', grey otherwise). Layout uses the deterministic 'stress' algorithm from graphlayouts.
render_network(
result,
edge_metric = "intersection",
seed = 42L,
significance_threshold = 0.05,
node_color_map = NULL
)
result |
A ['RegionResult-class']. |
edge_metric |
One of '"intersection"', '"jaccard"', '"fold_enrichment"' (capped at 20.0), '"overlap_coefficient"'. |
seed |
Retained for API compatibility; currently unused. The 'stress' layout algorithm is fully deterministic and does not rely on a random seed. |
significance_threshold |
FDR p_adjusted threshold below which edges are colored as significant (default 0.05). |
node_color_map |
Optional named character vector mapping letters ('"A"', '"B"', ...) to fill hex colors. Unspecified letters default to yellow ('"#FFF200"'). |
Idiomatic R port of Python 'render_network' – same parameter contract, but renders via ggraph + tidygraph instead of networkx + matplotlib.
A 'ggplot' (ggraph subclass).
ds <- methods::new("VennDataset",
set_names = c("A", "B"),
items = list(A = c("x", "y"), B = c("y", "z")),
item_order = c("x", "y", "z"),
universe_size = 10L, source_path = NULL, format = "csv")
result <- analyze(ds)
p <- render_network(result)
inherits(p, "ggplot")
result <- analyze(load_sample("dataset_real_cancer_drivers_4"))
p <- render_network(result, edge_metric = "jaccard")
ggplot2::ggsave(tempfile(fileext = ".png"), p, width = 7, height = 7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.