vmd | R Documentation |
This function generates a VMD scene file and a PDB file that can be read and rendered by the VMD molecular viewer. Chose ‘color by chain’ to see corresponding regions of structure colored by community along with the community protein structure network.
vmd(...)
## S3 method for class 'cna'
vmd(x, pdb, layout = layout.cna(x, pdb, k=3),
col.sphere=NULL, col.lines = "silver", weights = NULL,
radius = table(x$communities$membership)/5, alpha = 1,
vmdfile = "network.vmd", pdbfile = "network.pdb",
full = FALSE, launch = FALSE, exefile=NULL, ...)
## S3 method for class 'ecna'
vmd(x, n=1, ...)
## S3 method for class 'cnapath'
vmd(x, pdb, out.prefix = "vmd.cnapath", spline = FALSE,
colors = c("blue", "red"), launch = FALSE, exefile=NULL, mag=1.0, ...)
## S3 method for class 'ecnapath'
vmd(x, ...)
x |
A 'cna' or 'cnapath' class object, or a list of such objects, as
obtained from functions |
n |
The index to indicate which network or path to view with |
pdb |
A 'pdb' class object such as obtained from ‘read.pdb’ function. |
layout |
A numeric matrix of Nx3 XYZ coordinate matrix, where N is the number of community spheres to be drawn. |
col.sphere |
A numeric vector containing the sphere colors. |
col.lines |
A character object specifying the color of the edges (default 'silver'). Must use VMD colors names. |
weights |
A numeric vector specifying the edge width. Default is taken from E(x$community.network)$weight. |
radius |
A numeric vector containing the sphere radii. Default is taken from the number of community members divided by 5. |
alpha |
A single element numeric vector specifying the VMD alpha transparency parameter. Default is set to 1. |
vmdfile |
A character element specifying the output VMD scene file name that will be loaded in VMD. |
pdbfile |
A character element specifying the output pdb file name to be loaded in VMD. |
full |
Logical, if TRUE the full all-atom network rather than the clustered community network will be drawn. Intra community edges are colored according to the community membership, while inter community edges are thicker and colored black. |
launch |
Logical. If TRUE, a VMD session will be started with the output of ‘vmd.cna’. |
out.prefix |
Prefix for the names of output files, ‘vmd.cnapath.vmd’ and ‘vmd.cnapath.pdb’. |
spline |
Logical, if TRUE all paths are displayed as spline curves. |
colors |
Character vector or integer scalar, define path colors. If a
character vector, passed to |
exefile |
file path to the ‘VMD’ program on your system (i.e.
how is ‘VMD’ invoked). If |
mag |
A numeric factor to scale the maximal thickness of paths. |
... |
additional arguments passed to the function
|
This function generates a scaled sphere (communities) and stick (edges) representation of the community network along with the corresponding protein structure divided into chains, one chain for each community. The sphere radii are proportional to the number of community members and the edge widths correspond to network edge weights.
Two files are generated as output. A pdb file with the residue chains assigned according to the community and a text file containing The drawing commands for the community representation.
Barry Grant
Humphrey, W., Dalke, A. and Schulten, K., “VMD - Visual Molecular Dynamics” J. Molec. Graphics 1996, 14.1, 33-38.
## Not run:
if (!requireNamespace("igraph", quietly = TRUE)) {
message('Need igraph installed to run this example')
} else {
# Load the correlation network from MD data
attach(hivp)
# Read the starting PDB file to determine atom correspondence
pdbfile <- system.file("examples/hivp.pdb", package="bio3d")
pdb <- read.pdb(pdbfile)
# View cna
vmd.cna(net, pdb, launch=FALSE)
## within VMD set 'coloring method' to 'Chain' and 'Drawing method' to Tube
##-- From NMA
pdb.gdi = read.pdb("1KJY")
pdb.gdi = trim.pdb(pdb.gdi, inds=atom.select(pdb.gdi, chain="A", elety="CA"))
modes.gdi = nma(pdb.gdi)
cij.gdi = dccm(modes.gdi)
net.gdi = cna(cij.gdi, cutoff.cij=0.35)
#vmd.cna(net.gdi, pdb.gdi, alpha = 0.7, launch=TRUE)
detach(hivp)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.