Learn R Programming

BoolNet (version 1.44)

plotStateGraph: Visualize state transitions and attractor basins

Description

Plots a graph containing all states visited in attractorInfo, and optionally highlights attractors and basins of attraction. This requires the igraph package.

Usage

plotStateGraph(attractorInfo, highlightAttractors = TRUE, 
               colorBasins = TRUE, colorSet, 
               drawLegend = TRUE, drawLabels = FALSE, 
               layout = layout.fruchterman.reingold,
               piecewise = FALSE,  
               basin.lty = 2, attractor.lty = 1, 
               plotIt = TRUE, ...)

Arguments

attractorInfo
An object of class AttractorInfo, as returned by getAttractors. As the transition table information in this structure is required, getAttractor
highlightAttractors
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.
colorBasins
If set to true, each basin of attraction is drawn in a different color. Colors can be specified in colorSet. Defaults to TRUE.
colorSet
An optional vector specifying the colors to be used for the different attractor basins. If not supplied, a default color set is used.
drawLegend
If set to true and colorBasins is true, a legend for the colors of the basins of attraction is drawn. Defaults to TRUE.
drawLabels
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.
layout
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-R
piecewise
If set to true, a piecewise layout is used, i.e. the subgraphs corresponding to different basins of attraction are separated and layouted separately.
basin.lty
The line type used for edges in a basin of attraction. Defaults to 2 (dashed).
attractor.lty
If highlightAttractors is true, this specifies the line type for edges in an attractor. Defaults to 1 (straight).
plotIt
If this is true, a plot is generated. Otherwise, only an object of class igraph is returned, but no plot is drawn.
...
Further graphical parameters to be passed to plot.igraph.

Value

  • Returns an invisible object of class igraph containing the state graph, including color and line attributes.

Details

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.

See Also

getAttractors, plotNetworkWiring, igraph.plotting

Examples

Run this code
library(BoolNet)

# load example data
data(cellcycle)

# get attractors
attractors <- getAttractors(cellcycle)

# plot state graph
plotStateGraph(attractors, main="Cell cycle network")

Run the code above in your browser using DataLab