calculating rmsd for atoms of each residue

80 views
Skip to first unread message

Divya Singhal

unread,
Jun 17, 2021, 3:57:48 PM6/17/21
to MDnalysis discussion
Hi..
I am a beginner to use MDAnalysis and trying to calculate the rmsd values of atoms for each residue. I am using following code to calculate this:

u = mda.Universe('structure.pdb', 'rmsd.dcd') 
ref=mda.Universe('referance.pdb')
per_res_rmsd=np.empty((800,94),float)
for r in range (94):
    atom=(u.residues[r]).atoms
    atom_ref=(ref.residues[r]).atoms
    R = rms.RMSD(atom,  # universe to align
            atom_ref,  # reference universe or atomgroup
             select='resid 1-94')  # group to superimpose and calculate

             #groupselections=[GRP])  # groups for RMSD
             #ref_frame=0)  # frame index of the reference
    R.run()
    per_res_rmsd[:,r]=R.rmsd[:,2]

But i am not sure whether I am doing it right or not. Please help
    

Oliver Beckstein

unread,
Jun 17, 2021, 7:27:48 PM6/17/21
to mdnalysis-discussion
Hi Divya Singhal,

Do you want the RMSD for each residue and frame after (a) superposition of each residue on itself in the reference, or (b) superposition of all residues on all residues in the reference? (a) would measure the internal configurationial flexibility, (b) how much each residue contributes to the overal RMSD.  Depending on (a) or (b), different approaches apply.

I am asking because your code snippet contains "select='resid 1-94')  # group to superimpose and calculate” which points towards (b) being intended but "atom_ref,  # reference universe or atomgroup” being "atom_ref=(ref.residues[r]).atoms” actually does (a). 

For (b) you could use "groupselections=[f”resid {resid}” for resid in range(1, 95)]”. For (a) you have to something like what you’re already doing.

Oliver

--
Oliver Beckstein (he/his/him)


MDAnalysis – a NumFOCUS fiscally sponsored project




Reply all
Reply to author
Forward
0 new messages