Related to issue #198 rmsf per residue

Issue #199 closed
Former user created an issue

Lars thank you for your reply to rmsf per residue computations. How would one do the same thing for different snapshots from md trajectory of transducin. Compute rmsf for say c,n and o atom of each residue and then average to get rmsf per residue?

Isn't there a grpby option or something as in the case of dccm?

Comments (6)

  1. Lars Skjærven

    There is no grpby argument for the rmsf function at the moment. This could certainly be a nice addition. The suggestion below uses pdb id 1d1d as trajectory, and some elements from Xinqiu's answer from issue #198. Hope it helps.

    # read trajectory
    pdb <- read.pdb("1d1d", multi=TRUE)
    xyz <- pdb$xyz
    
    # superimpose trajectory
    xyz <- fit.xyz(xyz[1, ], xyz)
    
    # select atoms
    sele <- atom.select(pdb, elety=c("CA", "C", "N", "O"))
    
    # calc rmsf
    r <- rmsf(xyz[, sele$xyz])
    
    # residue numbers to group by
    resno <- pdb$atom$resno[sele$atom]
    
    # mean rmsf values
    tapply(r, as.factor(resno), mean)
    
  2. Barry Grant

    Should we add a 'grpby' to the rmsf() function? I think this answer/approach is clear and possibly sufficient but we can add a ToDo if folk want this.

  3. Xinqiu Yao

    Yes, it would be nice. Have updated this issue as 'ToDo'. I just wonder should we still keep two copies of ToDo in issues and wiki?

  4. Log in to comment