Given a tbl_kgx graph, send it to Cytoscape for visualization. Node labels
are mapped to node name
(if available, otherwise they default to node id
),
node color is mapped to pcategory
, edge color is mapped to predicate
,
node hover-over text is set to description
(if available, otherwise node id
),
and edge hover-over text is set to predicate
. Nodes are layed out
using the Kamada-Kawai method. These properties and more may be customized in
the Cytoscape application. This function requires that Cytoscape is installed
and running independently of the R session.
# S3 method for class 'tbl_kgx'
cytoscape(g, ...)
A tbl_kgx()
graph to visualize.
Other parameters (unused).
NULL, invisibly
if (FALSE) {
engine <- file_engine(system.file("extdata", "eds_marfan_kg.tar.gz", package = "monarchr"))
g <- engine |>
fetch_nodes(query_ids = "MONDO:0020066") |>
expand(predicates = "biolink:subclass_of", direction = "in", transitive = TRUE) |>
expand(categories = c("biolink:PhenotypicFeature", "biolink:Gene"))
# Cytoscape must be installed and running
cytoscape(g)
}