## Fetch stucture
pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )
## Calculate (vibrational) normal modes
modes <- nma(pdb)
## Calculate deformation energies
def.energies <- deformation.nma(modes)
## Fluctuations of first non-trivial mode
def.energies <- deformation.nma(modes, mode.inds=seq(7, 16))
write.pdb(pdb=NULL, xyz=modes$xyz,
b=def.energies$ei[,1])
Run the code above in your browser using DataLab