cmap(...)"cmap"(...)"cmap"(xyz, grpby = NULL, dcut = 4, scut = 3, pcut=1, binary=TRUE, mask.lower = TRUE, collapse=TRUE, gc.first=FALSE, ncore=1, nseg.scale=1, ...)"cmap"(pdb, inds = NULL, verbose = FALSE, ...)
xyz
that should be considered as a group
(e.g. atoms from a particular residue). binary=FALSE
. ncore > 1
and xyz
has many rows, with a bit sacrifice on speed. ncore>1
requires package parallel installed. fit.xyz
. "pdb"
, obtained from
read.pdb
. atom.select
. Construct a Contact Map for Given Protein Structure(s).
A contact map is a simplified distance matrix. See the distance matrix
function dm
for further details.
Function "cmap.pdb"
is a wrapper for "cmap.xyz"
which selects all notwater atoms and calculates the contact
matrix grouped by residue number.
Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.
##- Read PDB file pdb <- read.pdb( system.file("examples/hivp.pdb", package="bio3d") ) ## Atom Selection indices inds <- atom.select(pdb, "calpha") ## Reference contact map ref.cont <- cmap( pdb$xyz[inds$xyz], dcut=6, scut=3 ) plot.cmap(ref.cont) ##- Read Traj file trj <- read.dcd( system.file("examples/hivp.dcd", package="bio3d") )NATOM = 198 NFRAME= 117 ISTART= 0 last = 117 nstep = 117 nfile = 117 NSAVE = 1 NDEGF = 0 version 24 Reading (x100) |======================================================================| 100%## For each frame of trajectory sum.cont <- NULL for(i in 1:nrow(trj)) { ## Contact map for frame 'i' cont <- cmap(trj[i,inds$xyz], dcut=6, scut=3) ## Product with reference prod.cont <- ref.cont * cont sum.cont <- c(sum.cont, sum(prod.cont,na.rm=TRUE)) } plot(sum.cont, typ="l")