# NOT RUN {
# Load the library
library(XGR)
RData.location <- "http://galahad.well.ox.ac.uk/bigdata/"
# 1) load REACTOME
# 1a) restricted to Immune System ('R-HSA-168256') or Signal Transduction ('R-HSA-162582')
g <- xRDataLoader(RData.customised='ig.REACTOME',
RData.location=RData.location)
neighs.out <- igraph::neighborhood(g, order=vcount(g),
nodes="R-HSA-168256", mode="out")
nodeInduced <- V(g)[unique(unlist(neighs.out))]$name
ig <- igraph::induced.subgraph(g, vids=nodeInduced)
# visualise the graph with vertices being color-coded by the pattern
V(ig)$pattern <- runif(vcount(ig))
xGraphML(g=ig, node.label="name", node.color="pattern", colormap="wyr",
node.size=10, node.label.size=6)
# 1b) restricted to Signal Transduction ('R-HSA-162582')
g <- xRDataLoader(RData.customised='ig.REACTOME',
RData.location=RData.location)
neighs.out <- igraph::neighborhood(g, order=vcount(g),
nodes="R-HSA-162582", mode="out")
nodeInduced <- V(g)[unique(unlist(neighs.out))]$name
ig <- igraph::induced.subgraph(g, vids=nodeInduced)
# visualise the graph with vertices being color-coded by the pattern
V(ig)$pattern <- runif(vcount(ig))
xGraphML(g=ig, node.label="name", node.color="pattern", colormap="wyr",
node.size=8, node.label.size=4)
###########################
# visualise gene network
glayout <- igraph::layout_with_kk(ig)
V(ig)$xcoord <- glayout[,1]
V(ig)$ycoord <- glayout[,2]
V(ig)$node.link <-
paste0("http://www.genecards.org/cgi-bin/carddisp.pl?gene=",
V(ig)$name)
xGraphML(g=ig, node.label="name", node.tooltip="description",
node.xcoord="xcoord", node.ycoord="ycoord", node.color="pattern",
colormap="grey-orange-darkred", node.link="node.link", nlegend=11,
node.size=30, node.coord.scale=300)
# }
Run the code above in your browser using DataLab