"plot"(x, pdb = NULL, weights=NULL, vertex.size=NULL, layout=NULL, col=NULL, full=FALSE, scale=TRUE, color.edge = FALSE, interactive=FALSE, ...)
Plot a protein dynamic network as obtained from the cna function.
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:
V(x$network)$name
. Use NA to omit.vertex.label.cex
etc. E(x$network)$color
. mark.col
etc.Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.
Be sure to check the correspondence of your pdb object with your network object x, as few internal checks are currently performed by the layout.cna function.
# PDB server connection required - testing excluded require(igraph)Loading required package: igraph Loading required package: methods Attaching package: ‘igraph’ The following object is masked from ‘package:bio3d’: gnm The following objects are masked from ‘package:stats’: decompose, spectrum The following objects are masked from ‘package:testthat’: %>%, compare The following object is masked from ‘package:base’: union##-- Build a CNA object pdb <- read.pdb("4Q21")Note: Accessing on-line PDB filemodes <- nma(pdb)Building Hessian... Done in 0.069 seconds. Diagonalizing Hessian... Done in 0.284 seconds.cij <- dccm(modes)|======================================================================| 100%net <- cna(cij, cutoff.cij=0.2) # Plot coarse grain network based on dynamically coupled communities xy <- plot.cna(net)Obtaining estimated layout with fruchterman.reingold#plot.dccm(cij, margin.segments=net$communities$membership) # Chose a different PDB informed layout for plot plot.cna(net, pdb)Obtaining layout from PDB structure# 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)Obtaining layout from PDB structure# Alter plot settings plot.cna(net, pdb, full=TRUE, vertex.size=3, weights=1, vertex.label=NA)Obtaining layout from PDB structure