[gmx-users] which tool to use a measure a user-defined angle in a traj

chris.neale at utoronto.ca chris.neale at utoronto.ca
Sat Jul 14 16:51:29 CEST 2007


> For instance, I want to measure the angle defined by a carbonyl  
> vector (a vector going through a C=O bond) in my molecule and the  
> z-axis of the simulation box.

Not sure if that tool exists. You could, however, do this:
1) use make_ndx to make an index group of only the two atoms of interest
2) trjconv -f entire.xtc -o two_atoms.gro
3) write a simple script to parse the output .gro trajectory file in  
order to obtain the angle to the z axis based on cos(theta)=(z2-z1)/r  
therefore theta=arccos[(z2-z1)/r] where the angle is defined to the  
negative z direction. If you used constraints for that bond then it  
will be especially simple, otherwise you will need good old pythagoras  
to get r.
Note1) If you've got lots of angles that you want to average over, the  
process is the same but with more book-keeping.
Note2) You could also try modifying template.c

Good luck.

PS: if you do write a script, please post it back to the list.




More information about the gromacs.org_gmx-users mailing list