View source: R/plot-subgraph.R
| plot_subgraph | R Documentation |
Quickly extract the network induced by one pathway and optionally draw it with igraph. Pathway members are retained even when they are isolated in the selected scope, and the extracted igraph object is returned invisibly.
plot_subgraph(
net,
fgs,
scope = c("within-pathway", "boundary-expanded"),
attributes = NULL,
plot = TRUE,
main = NULL,
case_sensitive = FALSE,
...
)
net |
An undirected igraph network, a legacy network with a named
adjacency list in |
fgs |
A character vector containing one pathway, or a one-element named gene-set list. A named list supplies the default plot title. |
scope |
Graph scope. |
attributes |
Optional node display attributes. Supply a named vector to
color-code nodes, a named list with |
plot |
Draw the extracted graph. |
main |
Plot title. By default, use the pathway name when |
case_sensitive |
Use case-sensitive identifier matching. |
... |
Additional arguments passed to igraph's plot method. Explicit
|
By default, pathway members are orange and boundary nodes are blue.
The returned graph has a logical pathway_member vertex attribute,
display color (and, when supplied, size) vertex attributes, and retains
source edge weights. Partial pathway and attribute mapping is allowed, but
at least one pathway member must map to the network.
Invisibly, a simple undirected igraph graph for the selected scope.
spectral_eigenpairs(), as_igraph_network()
net <- list(
links = list(A = "B", B = c("A", "C"), C = "B"),
Ntotal = 2)
graph <- plot_subgraph(net, list(signaling = c("A", "B")),
scope = "boundary-expanded", plot = FALSE,
attributes = list(color = c(A = "activated", B = "repressed"),
size = c(A = 20, B = 12)))
igraph::vertex_attr(graph, "pathway_member")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.