Summary

Guide on how to plot directed graphs from igraph objects to display activating and repressive states.

Package

graphsim 1.0.0

1 Directed graph plots

1.1 Motivations

Here we demonstrate the plotting functions that come built-in with graphsim, an alternative to the plot.igraph provided by the igraph package. Here we provide additional functionality for plotting directed graphs. This draws upon many functions provided by igraph, including layout settings (Csardi and Nepusz 2006).

In particular, graph and network representations in biology often require displaying edge properties (Barabási and Oltvai 2004). Here we have the “state” parameter which can be used to differentiate these, and allow us to represent activating and inhibiting or repressing relationships differently. We use different arrowheads as per convention in molecular biology.

1.2 Getting started

To generate these plots, the following packages must be imported.

2 Toy example

Here we demonstrate the plot functions on a small toy graph.

2.2 Plotting

We next demonstrate the plotting function for directed graph objects. plot_directed with default settings uses the layout.fruchterman.reingold as does built-in plotting function igraph::plot.igraph. This function provides additional functionality to displaying directed graphs in particular.

Here you can see that the plotting function displays a graph in a similar layout to plot.igraph with different aesthetic parameters. We suggest that you choose the function that suits your needs and datasets. We demonstrate the features available for plot_directed below.

2.2.1 Custom aesthetics

We support various aesthetic parameters to control the colour and relative size of nodes and edges.

plot_directed supports customised layouts:

In addition, custom colouts are supported:

2.2.1.1 Vectorisation of aesthetics

Colours may also be entered as a vector for each node in V(graph):

This functionality allows highlighting of particular groups based on known properties of the graph. For examples V(graph)$type for bipartite graphs or partitions from Louvain (igraph::cluster_louvain) or Leiden (leiden::leiden) clustering algorithms.

2.2.2 Arrow customisation

The state parameter controls whether the links are “activating” or “inhibiting”. These can denote activation and repression: foe example, positive and negative regulation of genes or kinase and phosphatase activity of proteins. These may be specified globally as either a character string or numeric:

Activating links are displated with any of the following:

  • “activating”
  • 1
  • 0

Note that activating states can also be specified as follows:

Inhibiting links are displated with any of the following:

  • “inhibiting”
  • -1
  • 2

Note that inhibiting states can also be specified as follows:

3 Empirical examples

Here we demonstrate using the plotting package to display real biological pathways from the “Reactome” database (Croft et al. 2014). We can import these from the data directory included with this package. These graphs are given for examples and convenience. Any empirical data that consists of a list of directed edges can be imported as an igraph object and handled similarly. Below are some demonstrations.