Learn R Programming

bio3d (version 2.1-2)

plot.cna: Protein Structure Network Plots in 2D and 3D.

Description

Plot a protein dynamic network as obtained from the cna function.

Usage

## S3 method for class 'cna':
plot(x, pdb = NULL, weights=NULL, vertex.size=NULL,
            layout=NULL, col=NULL, full=FALSE, scale=TRUE, color.edge = FALSE, ...)

Arguments

x
A protein network graph object as obtained from the cna function.
pdb
A PDB structure object obtained from read.pdb. If supplied this will be used to guide the network plot layout, see layout.cna for details.
weights
A numeric vector containing the edge weights for the network.
vertex.size
A numeric vector of node/community sizes. If NULL the size will be taken from the input network graph object x. Typically for full=TRUE nodes will be of an equal size and for full=FALSE comm
layout
Either a function or a numeric matrix. It specifies how the vertices will be placed on the plot. See layout.cna.
col
A vector of colors used for node/vertex rendering. If NULL these values are taken from the input network V(x$community.network)$color.
full
Logical, if TRUE the full all-atom network rather than the clustered community network will be plotted.
scale
Logical, if TRUE weights are scaled with respect to the network.
color.edge
Logical, if TRUE edges are colored with respect to their weights.
...
Additional graphical parameters for plot.igraph.

Value

  • Produces a network plot on the active graphics device. Also returns the plot layout coordinates silently, which can be passed to the identify.cna function.

Details

This function calls plot.igraph from the igraph package to plot cna networks the way we like them.

The plot layout is user settable, we like the options of: layout.cna, layout.fruchterman.reingold, layout.mds or layout.svd. Note that first of these uses PDB structure information to produce a more meaningful layout.

Extensive plot modifications are possible by setting additional graphical parameters (...). These options are detailed in igraph.plotting. Common parameters to alter include:

[object Object],[object Object],[object Object],[object Object]

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.

See Also

plot.igraph, plot.communities, igraph.plotting

Examples

Run this code
require(igraph)

##-- Build a CNA object
pdb <- read.pdb("4Q21")
modes <- nma(pdb)
cij <- dccm(modes)
net <- cna(cij, cutoff.cij=0.2)

# Plot coarse grain network based on dynamically coupled communities
xy <- plot.cna(net)
#plot.dccm2(cij, margin.segments=net$communities$membership)

# Chose a different PDB informed layout for plot
plot.cna(net, pdb)

# Play with plot layout and colors...
plot.cna(net, layout=layout.mds(net$community.network), col=c("blue","green") )

# Plot full residue network colored by communities - will be slow due to number of edges!!
plot.cna(net, pdb, full=TRUE)

# Alter plot settings
plot.cna(net, pdb, full=TRUE, vertex.size=3, weights=1, vertex.label=NA)

Run the code above in your browser using DataLab