# NOT RUN {
##- 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)
# }
# NOT RUN {
##- Read Traj file
trj <- read.dcd( system.file("examples/hivp.dcd", package="bio3d") )
## 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")
# }
Run the code above in your browser using DataLab