Dear all,
I am trying to use MDAnalysis to calculate the dihedral angles (chi1, chi2, etc.) of my residue at various timesteps and have some questions.
To better understand the manner in which MDAnalysis calculates Dihedral angles, I looked at the source code, in particular the function _calc_dihedral_angle formula in calc_distances.h.
I also looked into the formula for calculating dihedral angle in Wikipedia and other sources, and I noticed the formula for calculating the dihedral angle is slightly different than how MDAnalysis does it. Here are the differences and my questions:
1. In most formulas, to calculate the normal vectors, n1 = va x vb and n2 = vb x vc, where va = coord2 - coord1 and vb = coord3 - coord2 and vc = coord4 - coord3.
However, MDAnalysis uses n1 = -va x vb and n2 = -vb x vc, so can you let me know why MDAnalysis does it this way?
2. Some versions of calculating the dihedral angle formula state that
alpha (our dihedral angle) = atan2(norm(cross(n1, n2)), dot(n1, n2))
However, MDAnalysis calculates alpha in the following way (according to my interpretation of the source code)
alpha = atan2(dot(cross(n1, n2), (vb/|vb|)), dot(n1, n2))
After drawing a few diagrams to convince myself, the angle between cross(n1, n2) and (vb/|vb|) must be nonzero, so norm(cross(n1, n2)) should not equal dot(cross(n1, n2), (vb/|vb|)),
So my question is - why does MDAnalysis calculate the numerator as dot(cross(n1, n2), (vb/|vb|)) instead of norm(cross(n1, n2))?
I would greatly appreciate it if you can help answer my questions.
Thank you for your help.
Sincerely,
Annika