Description Usage Arguments Value Author(s) Examples
View source: R/visualizeBiopax.R
This function colors nodes of a graph, usually this is used to color subgraphs or add a color hue correlating with the expression level or fold change to the molecules.
1 | colorGraphNodes(graph1, nodes, values, colors = c("greenred", "yellowred"))
|
graph1 |
graphNEL |
nodes |
vector of node names specifiying which nodes to color. must be same length as parameter foldChanges |
values |
vector of values indicating fold changes, gene expression values or similar. colors are mapped linearly over the range of these values |
colors |
string. either "greenred" or "yellowred", specifying which color gradient to use. |
Returns a graph with specified nodes colored according to the foldChanges
Frank Kramer
1 2 3 4 5 6 7 8 9 10 11 12 13 | # load data and retrieve wnt pathway
data(biopaxexample)
pwid1 = "pid_p_100002_wntpathway"
mygraph1 = pathway2RegulatoryGraph(biopax, pwid1)
mygraph1 = layoutRegulatoryGraph(mygraph1)
# retrieve all nodes
nodes = nodes(mygraph1)
# random expression data for your nodes
values = rnorm(length(nodes), mean=6, sd=2)
# color nodes of the graph
mygraph1 = colorGraphNodes(mygraph1, nodes, values, colors="greenred")
# plot the now colored graph
plotRegulatoryGraph(mygraph1, layoutGraph=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.