# \donttest{
##-- Read example trajectory file
trtfile <- system.file("examples/hivp.dcd", package="bio3d")
trj <- read.dcd(trtfile)
## Read the starting PDB file to determine atom correspondence
pdbfile <- system.file("examples/hivp.pdb", package="bio3d")
pdb <- read.pdb(pdbfile)
## select residues 24 to 27 and 85 to 90 in both chains
inds <- atom.select(pdb, resno=c(24:27,85:90), elety='CA')
## lsq fit of trj on pdb
xyz <- fit.xyz(pdb$xyz, trj, fixed.inds=inds$xyz, mobile.inds=inds$xyz)
## DCCM (slow to run so restrict to Calpha)
cij <- dccm(xyz)
## Plot DCCM
plot(cij)
## Or
library(lattice)
contourplot(cij, region = TRUE, labels=FALSE, col="gray40",
at=c(-1, -0.75, -0.5, -0.25, 0.25, 0.5, 0.75, 1),
xlab="Residue No.", ylab="Residue No.",
main="DCCM: dynamic cross-correlation map")
## LMI matrix
cij <- dccm(xyz, method='lmi')
## Plot LMI matrix
#plot(cij)
col.scale <- colorRampPalette(c("gray95", "cyan"))(5)
plot(cij, at=seq(0.4,1, length=5), col.regions=col.scale)
# }
Run the code above in your browser using DataLab