[gmx-users] get dihedrals in 0 to 360 degrees instead of -180 to +180 degrees

Repic Matej matej.repic at epfl.ch
Thu Sep 10 10:58:30 CEST 2015

I do not think gmx angle supports this, but it very easy to just add 180
to xvg files. 

1) One approach is to edit the data file prior to plotting. Issue this

awk "{if (/@|#/){print}else{print $1+180,$2}" angdist.xvg > angdist360.xvg

2) With gnuplot you can use this command to plot and add 180 to the data
on the fly:

Set datafile commentschars "#@"
plot "angdist.xvg" using ($1+180.0):2

3) In xmgrace you can use Data >> Transformations >> Evaluate Expression.
Select both sets of data and write "x=x+180" in the Formula window and
Apply. Then you also have to change the axis start/stop in Plot >> Axis
Properties. And lastly, you have to add 180 to the average angle in the


Dr. Matej Repic
Ecole Polytechnique Fédérale de Lausanne
Laboratory of Computational Chemistry and Biochemistry
BCH 4108
CH - 1015 Lausanne

On 9/10/15, 09:47, "gromacs.org_gmx-users-bounces at maillist.sys.kth.se on
behalf of GAYATHRI S" <gromacs.org_gmx-users-bounces at maillist.sys.kth.se
on behalf of gayathri.s at iitb.ac.in> wrote:

>Hello everyone,
>I simulated an NADH molecule. I want to check how each of the dihedral
>angles changes during the simulation. To achieve the same, I used the
>following command:
>$g_angle -f full.xtc -n dangle.ndx -ov -all -type dihedral
>I got the desired output.
>However, the output shows angles ranging from -180 degrees to +180
>Is it possible to get the same output in 0 to 360 degrees format? If yes,
>what command should be used and in what syntax should it be used?
>Please suggest how to proceed.
>Thank you.
>Gromacs Users mailing list
>* Please search the archive at
>http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
>* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>* For (un)subscribe requests visit
>https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
>send a mail to gmx-users-request at gromacs.org.

More information about the gromacs.org_gmx-users mailing list