## VMD-L Mailing List

**From:** Giacomo Fiorin (*giacomo.fiorin_at_gmail.com*)

**Date:** Wed Mar 22 2023 - 05:27:42 CDT

**Next message:**Gumbart, JC: "Re: Re: No ffTK .gau Extension in Determine File Type in VMD for Visualization Problem?"**Previous message:**Norbert Straeter: "Re: calculation of rotation angle"**In reply to:**Norbert Straeter: "Re: calculation of rotation angle"**Messages sorted by:**[ date ] [ thread ] [ subject ] [ author ] [ attachment ]

Hi Sangita, a possible alternative may be using a recent version of VMD

1.9.4, and specifically the Colvars module

<https://urldefense.com/v3/__http://colvars.github.io/colvars-refman-vmd/colvars-refman-vmd.html__;!!DZ3fjg!-WJtKlZHhzPr5NLh9CPDrp44taG6gOlW8NjJswzhX8NO0MX1b2eawv5x_mSuYuymXKL-RZFSddjjGXjUoP_TICzwZg$ > that

is distributed with it.

If you have a reference structure for each of the chains, you could define

an orientation

<https://urldefense.com/v3/__http://colvars.github.io/colvars-refman-vmd/colvars-refman-vmd.html*sec:cvc_orientation__;Iw!!DZ3fjg!-WJtKlZHhzPr5NLh9CPDrp44taG6gOlW8NjJswzhX8NO0MX1b2eawv5x_mSuYuymXKL-RZFSddjjGXjUoP9tUGSJzg$ >

collective variable with respect to it, and that variable gives you the

same rotation computed by VMD, in a quaternion format. That format is

equivalent to the 3x3 matrix, and arguably just as useful for direct human

consumption. For this reason, the orientationAngle

<https://urldefense.com/v3/__http://colvars.github.io/colvars-refman-vmd/colvars-refman-vmd.html*sec:cvc_orientationAngle__;Iw!!DZ3fjg!-WJtKlZHhzPr5NLh9CPDrp44taG6gOlW8NjJswzhX8NO0MX1b2eawv5x_mSuYuymXKL-RZFSddjjGXjUoP8X-5bmfw$ >

function can give you the *angle* of that rotation.

If you would like to choose the axis of rotation yourself, you can extract

the angle of the sub-rotation around that axis using spinAngle

<https://urldefense.com/v3/__http://colvars.github.io/colvars-refman-vmd/colvars-refman-vmd.html*sec:cvc_spinAngle__;Iw!!DZ3fjg!-WJtKlZHhzPr5NLh9CPDrp44taG6gOlW8NjJswzhX8NO0MX1b2eawv5x_mSuYuymXKL-RZFSddjjGXjUoP-h0LLC7w$ >.

Be aware of the mathematical caveat that this function is not defined

everywhere (but neither are Euler angles, for that matter).

Using Colvars in VMD can be done via the command line scripting interface

<https://urldefense.com/v3/__http://colvars.github.io/colvars-refman-vmd/colvars-refman-vmd.html*sec:cv_scripting__;Iw!!DZ3fjg!-WJtKlZHhzPr5NLh9CPDrp44taG6gOlW8NjJswzhX8NO0MX1b2eawv5x_mSuYuymXKL-RZFSddjjGXjUoP8pS8fjPw$ >

or the Dashboard

<https://urldefense.com/v3/__http://colvars.github.io/colvars-refman-vmd/colvars-refman-vmd.html*sec:dashboard__;Iw!!DZ3fjg!-WJtKlZHhzPr5NLh9CPDrp44taG6gOlW8NjJswzhX8NO0MX1b2eawv5x_mSuYuymXKL-RZFSddjjGXjUoP8-SXAyOw$ >

GUI.

Giacomo

On Wed, Mar 22, 2023 at 5:14 AM Norbert Straeter <strater_at_bbz.uni-leipzig.de>

wrote:

*> Dear Sangita,
*

*>
*

*> if you have a rotation matrix and a translation vector that describes the
*

*> rotation and translation of an object in 3d space, than you can transform
*

*> this to a screw operation. A rotation axis is not sufficient. What you need
*

*> is the vector describing the orientation of the screw axis (direction
*

*> cosines, three values), a point on the axis (x,y,z coordinates) and the
*

*> translation along the axis (one scalar value). This information can be used
*

*> to plot the screw axis in space, which might describe the rotation of
*

*> domains or subunits or the symmetry axes of homooligomers. Usually these
*

*> have small translation parts, i.e. may be approximated as pure rotations
*

*> around an axis.
*

*>
*

*> Some programs that superpose proteins output the rotation vector and
*

*> rotation angle, but I know two programs that do the complete conversion
*

*> (including the translation). One of them is DynDom, written to analyse
*

*> domain movements. Search for DynDom and you will find it including the
*

*> Fortran source code from which you can probably extract the necessary
*

*> functions to do the conversion. The second program is probably the simpler
*

*> solution, as it was written to only do the conversion specified above. I
*

*> received it about 25 years ago via email when I was a postdoc, following a
*

*> question similar to yours. Unfortunately I do not have the email anymore,
*

*> so I do not know who the author of this program is (probably "WSB", see
*

*> below). It is called matcon and is also written in Fortran. I recently
*

*> compiled it under Windows ubuntu using the gnu gfortran compiler and after
*

*> some minor corrections of the source code, it still works. The conversion
*

*> involves eigenvalue decomposition of the matrix and I vaguely remember that
*

*> this can fail for certain symmetric situations such as perfect closed
*

*> symmetry in homooligomers.
*

*>
*

*> There may be other programs or libraries around that do the same job,
*

*> perhaps even in tcl. Depending on what you want to do exactly, you may try
*

*> to port the fortran routines to tcl or python, perhaps you can replace some
*

*> subroutines by functions in python numpy or scipy. A simpler way that I
*

*> usually choose is to write the matrix and rotation vector to a file via
*

*> (vmd) tcl, call matcon via tcl to convert the RT matrix and read the
*

*> desired information from the log file back in to the tcl script for
*

*> display. This would be the option if you need this conversion for many
*

*> structures along the trajectory. If you only need it for a few
*

*> calculations, just use matcon interactively to copy/paste the matrix and
*

*> rotation vector. Following is the head of the matcon source code specifying
*

*> some literature to read (to write your own version :-)) and an example
*

*> output of the program.
*

*>
*

*> If you are interested in the matcon fortran program write to me via my
*

*> direct email.
*

*>
*

*> Best regards,
*

*>
*

*> Norbert
*

*>
*

*> C MATCON: PROGRAM TO DECOMPOSE LINEAR TRANSFORM INTO
*

*> C ORTHOGONAL AND NON-ORTHOGONAL PARTS, THEN CONVERT
*

*> C FORMER INTO EULER ROTATIONS, POLAR ROTATIONS, AND
*

*> C AN EQUIVALENT SCREW OPERATION.
*

*> C
*

*> C === This version:
*

*> C 1) assumes that the matrix on the file is *NOT* transposed.
*

*> C 2) produces Euler angles in both R&B and PROTEIN
*

*> conventions.
*

*> C WSB JUL-87
*

*> C
*

*> C THE PROGRAM WILL ALSO GENERATE A ROTATION MATRIX TO MAKE
*

*> C THE EQUIVALENT SCREW AXIS COINCIDENT WITH THE Z-COORDINATE
*

*> C AXIS, IF REQUESTED.
*

*> C
*

*> C REFER TO:
*

*> C M. ROSSMANN AND D. BLOW, ACTA CRYST. 15, P. 24 (1962),
*

*> C FOR DEFINITIONS OF ROTATION ANGLES.
*

*> C R. DIAMOND, ACTA CRYST. A32, P. 1 (1976),
*

*> C FOR PROCEDURE TO RESOLVE ORTHOGNAL FACTOR.
*

*> C J. COX, J. MOL. BIOL. 28, P. 152 (1967),
*

*> C FOR PROCEDURE TO OBTAIN EQUIVALENT SCREW OP.
*

*> C
*

*>
*

*>
*

*> ***MATCON: convert rotation matrix***
*

*> Line 1 of rotation matrix:
*

*> Line 2 of rotation matrix:
*

*> Line 3 of rotation matrix:
*

*> Translation vector:
*

*> Current matrix and vector (NOT transposed):
*

*> -0.34523 -0.73013 0.58969
*

*> 0.12035 0.58869 0.79935
*

*> -0.93077 0.34693 -0.11536
*

*> 20.65764 47.75508 -83.17358
*

*> DETERMINANT = 1.00000
*

*> Current matrix and vector (NOT transposed):
*

*> -0.34523 0.12035 -0.93077
*

*> -0.73013 0.58869 0.34693
*

*> 0.58969 0.79935 -0.11536
*

*> Equivalent Euler angles (THETA1,THETA2,THETA3)
*

*> Rossmann & Blow convention: 143.583 96.624 -69.558
*

*> PROTEIN convention: -110.442 96.624 36.417
*

*> Equivalent Huber angles (PSI,THETA,PHI): -11.554 53.068 -101.069
*

*> a1,a2,alfa,b1,b2,beta: 0.1146E+01 -0.3411E+00 -0.3361E+01
*

*> 0.1146E+01 -0.6098E+00 -0.1880E+01
*

*> Equivalent Polar angles (PSI,PHI,CHI or KAPPA): 147.643 61.989
*

*> 115.846
*

*> i.e., a CHI rotation around the unit vector: 0.25135 -0.84473
*

*> -0.47250
*

*> The screw axis passes through the point: -19.28110 22.13858 -49.83575
*

*> The translation along this screw axis is 4.15187 Angstroms
*

*> 0CHECK: APPLY D TO O AND SUBTRACT S
*

*> 75.32047 61.08323 -69.13616
*

*> Matrix to rotate screw axis onto Z axis:
*

*> -0.13476 0.45288 -0.88133
*

*> 0.95847 0.28520 0.00000
*

*> 0.25135 -0.84473 -0.47250
*

*> DETERMINANT = 1.00000
*

*> 0CHECK: APPLY ROTATION TO R
*

*> -0.00000 0.00000 1.00000
*

*> LENGTH = 1.000
*

*>
*

*> Am 21.03.2023 um 19:05 schrieb Sangita Kachhap:
*

*>
*

*> Hi,
*

*>
*

*> I have MD trajectories of a protein system having 4 chains, and I have to
*

*> calculate the rotation angle and axis of each chain.
*

*> Through VMD, I have calculated a transformation (4X4) matrix, having 3X3
*

*> rotation matrix and 1 translation matrix. But, I have no idea how to get
*

*> rotation angle and axis from transformation matrix
*

*>
*

*> It would be great if anyone could help me.
*

*>
*

*> ---
*

*> Sangita
*

*>
*

*>
*

-- ------------------------------------------------------------------------ This message discusses the usage of Colvars, a software library that is distributed with VMD, but is independently developed and maintained. Please see https://urldefense.com/v3/__https://colvars.github.io__;!!DZ3fjg!-WJtKlZHhzPr5NLh9CPDrp44taG6gOlW8NjJswzhX8NO0MX1b2eawv5x_mSuYuymXKL-RZFSddjjGXjUoP-np_QLcQ$ for further information. ------------------------------------------------------------------------

**Next message:**Gumbart, JC: "Re: Re: No ffTK .gau Extension in Determine File Type in VMD for Visualization Problem?"**Previous message:**Norbert Straeter: "Re: calculation of rotation angle"**In reply to:**Norbert Straeter: "Re: calculation of rotation angle"**Messages sorted by:**[ date ] [ thread ] [ subject ] [ author ] [ attachment ]