full-atom mktrj.nma()
Issue #187
resolved
Hi, is it possible to extrapolate the motion along a mode computed with nma on CA and write a full atom structure to a pdb file ? Regards, NB.
Comments (7)
-
-
Take the vector corresponding to each CA atom and duplicate it corresponding to the number of atoms in the residue. See the
m$modes
attribute. e.gm$modes[7, atom2xyz(1)]
represents atom 1 for mode 7.sele = atom.select(pdb, "protein") pdb = trim.pdb(pdb, sele) m = nma(pdb) natoms <- sum(pdb$calpha) times <- table(pdb$atom$resno) maa <- NULL for ( i in 1:natoms ) { tmp <- m$modes[atom2xyz(i), 7] maa <- c(maa, rep(tmp, times[i])) } # code from mktrj() mag = 10; step = 1.25; xyz = as.vector(pdb$xyz) nstep <- c(seq(step, to = mag, by = step)) zcoor <- cbind(1) %*% nstep scor <- function(x, u, m) { return(x * u + m) } plus <- sapply(c(zcoor), scor, u = maa, m = xyz) minus <- sapply(c(-zcoor), scor, u = maa, m = xyz) coor <- t(cbind(xyz, plus, plus[, rev(1:ncol(plus))], xyz, minus, minus[, rev(1:ncol(minus))])) write.pdb(pdb=pdb, xyz = coor, file = "all-atom_m7.pdb")
-
-
There is also an experimental version of all-atom NMA in the feature_aanma branch you might want to check out:
pdb <- read.pdb("1etl") pdb <- trim.pdb(pdb, "noh") pdb <- trim.pdb(pdb, "notwater") m <- aanma(pdb, outmodes="noh") trj <- mktrj(m) write.pdb(pdb, xyz=trj)
-
- changed status to resolved
-
tmp <- m$modes[7, atom2xyz(i)] should be: tmp <- m$modes[atom2xyz(i), 7]
-
Thanks for spotting this ! I've updated my code snippet above.
- Log in to comment
Hi,
It is possible, but I don't see the point to do that. Do you just want an alternative representation for the NMA mode or you really want to see how all heavy atoms move? If it is latter, an all-atom based NMA could be the solution.