full-atom mktrj.nma()

Issue #187 resolved
Former user created an issue

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)

  1. Xinqiu Yao

    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.

  2. Lars Skjærven

    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.g m$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")
    
  3. Lars Skjærven

    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)
    
  4. Log in to comment