Learn R Programming

bio3d (version 2.2-4)

view.cna: View CNA Protein Structure Network Community Output in VMD

Description

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.

Usage

view.cna(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", launch = FALSE)

Arguments

x
A 'cna' class object such as obtained from ‘cna’ function/
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.
launch
Logical. If TRUE, a VMD session will be started with the output of ‘view.cna’.

Value

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.

Details

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.

References

Humphrey, W., Dalke, A. and Schulten, K., ``VMD - Visual Molecular Dynamics'' J. Molec. Graphics 1996, 14.1, 33-38.

Examples

Run this code
## Not run: 
# 
# # 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 
# view.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)
# #view.cna(net.gdi, pdb.gdi, alpha = 0.7, launch=TRUE)
# 
# detach(hivp)
# 
# ## End(Not run)

Run the code above in your browser using DataLab