plotdetailed: plotdetailed, layout.ellipsis

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

plotdetailed uses igraph to plot a graph containing activations and inhibitions. Input is an adjacency matrix with activation edge represented by a 1, inhibition by a 2.

Usage

1
2
3
4
5
6
7
plotdetailed(phi, weights = NULL, main = "", stimuli = NULL,
  node.color = "grey", node.size1 = 30, node.size2 = 7, edge.width = 1, 
  edge.arrowsize = 0.5, layout = layout.circle, pdf = NULL, pointsize = 12, 
  edge.width.inhib = 1.5, plot.legend = TRUE,
  label.cex = 1, vlabel.cex = 0.6, tk = FALSE, fontsize=20, rescale=TRUE)

layout.ellipsis(ig, a=1, b=1.5)

Arguments

phi

Adjacency matrix. The network to be plotted.

weights

Optional matrix of edge weights.

main

Optional character string containing main title for the plot.

stimuli

List of input stimuli. Are marked as red filled nodes in the plot.

fontsize

Deprecated. Still there for compatibility issues with plotdetailed_Rgraphviz. Use cex.label to control edge label size.

node.color

Define coloring of nodes.

node.size1

Width of a rectangular node.

node.size2

Height of a rectangular node.

edge.width

Width of edges.

edge.arrowsize

Size of edge ends.

layout

Graph layout algorithm or matrix with node coordinates.

pdf

Pdf output file name.

pointsize

Pointsize argument used in pdf device.

edge.width.inhib

Width of inhibitory edges.

plot.legend

Define if legend should be drawn or not.

label.cex

Edge label size factor.

vlabel.cex

Node label size factor.

tk

Use tk-plotting engine or not.

rescale

Rescaling coordinates or not.

ig

Igraph object.

a

Semi major axis of ellipse.

b

Semi minor axis of ellipse.

Details

Plot a graph encoded in adjacency matrix phi using the igraph library. Activation edges are drawn as solid lines, inhibition edges as dashed lines. Stimuli nodes can be colored red using the stimuli argument.

The stimuli list describes the input stimuli or inhibitions. Each of these external treatment nodes are drawn as red nodes in the graph. The format of the list should be:\ Example: Assume two treatments EGF and X, a data matrix data:

EGF_1 EGF_1 EGF_2 EGF_2 EGF&X_1 EGF&X_2 EGF&X_2 EGF&X_2
EGF 0 0 0 0 0 0 0 0
X 0 0 0 0 0 0 0 0
AKT 1.45 1.8 0.99 1.6 1.78 1.8 1.56 1.58

The stimuli list should be in the format: stimuli <- list(c(EGF=1),c(EGF=1,X=2)), i.e. each element in the list corresponds to a treatment. Each treatment is a named numeric vector describing the row indices of the treatments in the data matrices.

layout.ellipsis is another graph layout making elliptical graphs possible. Can be used as layout argument for plotting. Use rescale=FALSE if using layout.ellipsis.

Value

A list object holding the igraph object ig and the layout coordinates layout:

ig

Igraph object created from the adjacency matrix.

layout

Matrix with two columns, holding the x and y coordinates of the elements in the graph.

Author(s)

Christian Bender

References

none

See Also

plotdetailed_Rgraphviz

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
library(ddepn)
mat <- matrix(sample(c(0,1,2),25,replace=TRUE), nrow=5,ncol=5, 
		dimnames=list(LETTERS[1:5],LETTERS[1:5]))
diag(mat) <- 0
weights <- matrix(sample(c(1:25),25,replace=TRUE), nrow=5,ncol=5, 
	dimnames=list(LETTERS[1:5],LETTERS[1:5]))
stimuli <- list(list(A=1))
plotdetailed(mat,weights,"Some random graph",stimuli,layout=layout.graphopt)
layoutmat <- cbind(c(1,2,3,4,5), c(5,4,3,2,1))
plotdetailed(mat,weights,"Some random graph",stimuli,layout=layoutmat)

## End(Not run)

ddepn documentation built on May 2, 2019, 4:42 p.m.