# NOT RUN {
## Fetch stucture
pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )
## Calculate normal modes
modes <- nma(pdb)
## Print modes
print(modes)
## Plot modes
plot(modes)
## Visualize modes
#m7 <- mktrj.nma(modes, mode=7, file="mode_7.pdb")
# }
# NOT RUN {
## Use Anisotropic Network Model
modes <- nma(pdb, ff="anm", mass=FALSE, temp=NULL, cutoff=15)
## Use SSE information and SS-bonds
sse <- dssp(pdb, resno=FALSE, full=TRUE)
ss.bonds <- matrix(c(76,94, 64,80, 30,115, 6,127),
ncol=2, byrow=TRUE)
## User defined energy function
## Note: Must take a vector of distances
"my.ff" <- function(r) {
ifelse( r>15, 0, 1 )
}
## Modes with a user defined energy function
modes <- nma(pdb, pfc.fun=my.ff)
## A more manual approach
sele <- atom.select(pdb, chain='A', elety='CA')
xyz <- pdb$xyz[sele$xyz]
hessian <- build.hessian(xyz, my.ff)
modes <- eigen(hessian)
## Dealing with unconventional residues
pdb <- read.pdb("1xj0")
## nma(pdb)
#modes <- nma(pdb, mass.custom=list(CSX=121.166))
# }
Run the code above in your browser using DataLab