xGraphMLR Documentation

Function to generate a graphml file from a graph object of class "igraph"

Description

xGraphML is supposed to generate a graphml file from a graph object of class "igraph".

Usage

xGraphML(g, node.label = NULL, label.wrap.width = NULL,
node.tooltip = NULL, node.link = NULL, node.color = NULL,
colormap = "wyr", ncolors = 64, zlim = NULL, node.size = NULL,
filename = "xGraphML")

Arguments

g

an object of class "igraph"

node.label

either a vector labelling nodes or a character specifying which node attribute used for the labelling. If NULL (by default), no node labelling. If provided as a vector, a node with 'NA' will be not labelled

label.wrap.width

a positive integer specifying wrap width of name

node.tooltip

either a vector used for node tooltips or a character specifying which node attribute used for the tooltips. If NULL (by default), node attribute 'name' will be used node lab

node.link

a string specifying hyperlink address. By default, it is NULL meaning no hyperlink

node.color

a character specifying which node attribute used for node coloring. If NULL (by default), it is '#BFFFBF'

colormap

short name for the colormap. It can be one of "jet" (jet colormap), "bwr" (blue-white-red colormap), "gbr" (green-black-red colormap), "wyr" (white-yellow-red colormap), "br" (black-red colormap), "yr" (yellow-red colormap), "wb" (white-black colormap), "rainbow" (rainbow colormap, that is, red-yellow-green-cyan-blue-magenta), and "ggplot2" (emulating ggplot2 default color palette). Alternatively, any hyphen-separated HTML color names, e.g. "lightyellow-orange" (by default), "blue-black-yellow", "royalblue-white-sandybrown", "darkgreen-white-darkviolet". A list of standard color names can be found in http://html-color-codes.info/color-names

ncolors

the number of colors specified over the colormap

zlim

the minimum and maximum z/patttern values for which colors should be plotted, defaulting to the range of the finite values of z. Each of the given colors will be used to color an equispaced interval of this range. The midpoints of the intervals cover the range, so that values just outside the range will be plotted

node.size

either a vector specifying node size or a character specifying which node attribute used for the node size. If NULL (by default), it will be 30

filename

the without-extension part of the name of the output file. By default, it is 'xGraphML'

Value

invisible

Note

none

See Also

xGraphML

Examples

## Not run: 
# Load the library
library(XGR)
RData.location <- "http://galahad.well.ox.ac.uk/bigdata_dev/"

# load REACTOME
# 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)

# 4) visualise the graph with vertices being color-coded by the pattern
pattern <- runif(vcount(ig))
names(pattern) <- V(ig)$name
xGraphML(g=ig, colormap="wyr")

## End(Not run)