ggm.make.graph {GeneNet}R Documentation

Graphical Gaussian Models: Plotting the Network

Description

ggm.make.dot converts an edge list as obtained by ggm.test.edges into a "dot" file that can directly be used for plotting the network with graphviz.

network.make.dot is just an alias to ggm.make.dot.

ggm.make.graph converts an edge list as obtained by ggm.test.edges into a graph object.

show.edge.weights summarizes a graph object by prints a vector of weights for all edges contained in a graph. This function is convenient to gain a first impression of the graph (in particular if the "Rgraphviz" library is not installed).

Usage

ggm.make.dot(filename, edge.list, node.labels, main=NULL, show.edge.labels=FALSE)
network.make.dot(filename, edge.list, node.labels, main=NULL, show.edge.labels=FALSE)
ggm.make.graph(edge.list, node.labels, drop.singles=FALSE)
show.edge.weights(gr)

Arguments

filename name of file containg the "dot" commands for graphviz
edge.list a data frame, as obtained by ggm.test.edges, listing all edges to be included in the graph
node.labels a vector with labels for each node (will be converted to type character)
main title included in plot
show.edge.labels plot correlation values as edge labels (default: FALSE)
drop.singles remove unconnected nodes
gr a graph object
... options passed to plot functions

Details

For network plotting the software "graphviz" is employed (http://www.graphviz.org).

For the functions ggm.plot.graph and ggm.make.graph the "graph" and "Rgraphviz" infrastructure from the Bioconductor project (http://www.bioconductor.org) is required.

Value

ggm.make.dot produces a "dot" network description file that can directly be fed into graphviz in order to produce a plot of a network.
ggm.make.graph returns a graph object, suitable for plotting with functions from the "Rgraphviz" library.
show.edge.weights returns a vector of weights for all edges contained in a graph.

Author(s)

Juliane Sch"afer, Rainer Opgen-Rhein, and Korbinian Strimmer (http://strimmerlab.org).

See Also

ggm.test.edges, plot.graph.

Examples

# load GeneNet library
library("GeneNet")
 
# generate random network with 20 nodes and 10 percent edges (=19 edges)
true.pcor <- ggm.simulate.pcor(20, 0.1)

# convert to edge list 
test.results <- ggm.list.edges(true.pcor)[1:19,]

########  use graphviz directly to produce a plot ##########

# uncomment for actual use!

# nlab <- LETTERS[1:20]
# ggm.make.dot(filename="test.dot", test.results, nlab, main = "A graph") 
# system("fdp -T svg -o test.svg test.dot") # SVG format

########  use Rgraphviz produce a plot ##########

# uncomment for actual use!

# nlab <- LETTERS[1:20]
# gr <- ggm.make.graph( test.results, nlab) 
# gr 
# show.edge.weights(gr) 
# gr2 <- ggm.make.graph( test.results, nlab, drop.singles=TRUE) 
# gr2 

# plot network
# NOTE: this requires the installation of the "Rgraphviz" library
# library("Rgraphviz")
# plot(gr)

[Package GeneNet version 1.2.3 Index]