Plots a graph containing all states visited in stateGraph
, and optionally highlights attractors and basins of attraction. This requires the igraph package.
plotStateGraph(stateGraph, highlightAttractors = TRUE,
colorBasins = TRUE, colorSet,
drawLegend = TRUE, drawLabels = FALSE,
layout = layout.kamada.kawai,
piecewise = FALSE,
basin.lty = 2, attractor.lty = 1,
plotIt = TRUE,
colorsAlpha = c(colorBasinsNodeAlpha = .3,
colorBasinsEdgeAlpha = .3,
colorAttractorNodeAlpha = 1,
colorAttractorEdgeAlpha = 1),
...)
Returns an invisible object of class igraph
containing the state graph, including color and line attributes.
An object of class AttractorInfo
or SymbolicSimulation
, as returned by getAttractors
and simulateSymbolicModel
respectively. As the transition table information in this structure is required, getAttractors
must be called in synchronous mode and with returnTable
set to TRUE. Similarly, simulateSymbolicModel
must be called with returnGraph=TRUE
. Alternatively, stateGraph
can be an object of class TransitionTable
, which can be extracted using the functions getTransitionTable
, getBasinOfAttraction
, or getStateSummary
If this parameter is true, edges in attractors are drawn bold and with a different line type (which can be specified in attractor.lty
). Defaults to TRUE.
If set to true, each basin of attraction is drawn in a different color. Colors can be specified in colorSet
. Defaults to TRUE.
An optional vector specifying the colors to be used for the different attractor basins. If not supplied, a default color set is used.
If set to true and colorBasins
is true, a legend for the colors of the basins of attraction is drawn. Defaults to TRUE.
If set to true, the binary encodings of the states are drawn beside the vertices of the graph. As this can be confusing for large graphs, the default value is FALSE.
A layouting function that determines the placement of the nodes in the graph. Please refer to the layout
manual entry in the igraph package for further details. By default, the Fruchterman-Reingold algorithm is used.
If set to true, a piecewise layout is used, i.e. the subgraphs corresponding to different basins of attraction are separated and layouted separately.
The line type used for edges in a basin of attraction. Defaults to 2 (dashed).
If highlightAttractors
is true, this specifies the line type for edges in an attractor. Defaults to 1 (straight).
If this is true, a plot is generated. Otherwise, only an object of class igraph
is returned, but no plot is drawn.
These parameters apply alpha correction to the colors of basins and attractors in the following order: basin node, basin edge, attractor node, attractor edge. Defaults to a vector of length 4 with settings alpha = 0.3
for basins and alpha = 1
for attractors.
Further graphical parameters to be passed to plot.igraph
.
This function uses the plot.igraph
function from the igraph package. The plots are customizeable using the ...
argument. For details on possible parameters, please refer to igraph.plotting
.
getAttractors
, simulateSymbolicModel
, getTransitionTable
, getBasinOfAttraction
, getStateSummary
, plotNetworkWiring
, igraph.plotting
# load example data
data(cellcycle)
# get attractors
attractors <- getAttractors(cellcycle)
# plot state graph
if (FALSE) {
plotStateGraph(attractors, main = "Cell cycle network", layout = layout.fruchterman.reingold)
}
Run the code above in your browser using DataLab