R: Visualize state transitions and attractor basins

plotStateGraph {BoolNet} | R Documentation

## Visualize state transitions and attractor basins

### Description

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

### Usage

    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),
                   ...)

### Arguments

`stateGraph` | 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`
`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-Reingold algorithm is used.
`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.
`colorsAlpha` | 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`.

### 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`.

### Value

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

### See Also

`getAttractors`, `simulateSymbolicModel`, `getTransitionTable`, `getBasinOfAttraction`, `getStateSummary`, `plotNetworkWiring`, `igraph.plotting`

### Examples

    # load example data
    data(cellcycle)

    # get attractors
    attractors <- getAttractors(cellcycle)

    # plot state graph
    ## Not run:
    plotStateGraph(attractors, main = "Cell cycle network", layout = layout.fruchterman.reingold)

    ## End(Not run)

[Package BoolNet version 2.1.4 Index]