Re: Trouble using rotateReference, centerRefrence and refPositionsGroup in the colvar module

From: Giacomo Fiorin (
Date: Tue Feb 07 2012 - 16:57:33 CST

Hello Ajasja, sorry for the late reply.

Yes, you can use these two variables to find out the difference between
colvars and VMD fitting. However, I don't suppose there is an issue with
the vector distance between the two centers of geometry, right? :-)

The function in the tcl file attached (sorry, I forgot to upload it in the
VMD script library some time ago) prints you the rotation matrix that you
can use with "atomselect moveby" in VMD. It is a 4x4 matrix as per VMD's

You can also just look at the 3x3 matrix elements. Because the rotation in
the colvars module is applied when both the reference and the current
positions are centered on the origin, you should compute VMD's matrix with
"measure fit" under the same conditions. Also, it uses centers of geometry
rather than centers of mass, so use "weight occupancy" or something like

Be consistent with the convention (which coordinates are rotated into
which), or try comparing the transpose of one matrix with the other and see
if you get a much better result ;-)

My guess is that if you have a well-defined structure (read: thermal
fluctuations are much smaller than the radius of gyration of the reference
coordinates), the colvars' matrix and that computed by VMD via the Kabsch
method should be pretty much the same. If you're not in those conditions,
they may differ, but in that case they are both not very meaningful.


On Mon, Feb 6, 2012 at 5:55 PM, Ajasja Ljubetič

> To answer part of my own question
>> Is the colvars module using the same algorithm for molecule alignment as
>> VMD?
> The colvar module uses quaternations for finding the optimal rotation. So
> I can define an orientation colvar and a DistanceVec colvar to obtain the
> full transformation matrix, which would enable me to visualise exactly what
> is going on using VMD.
> By the way, where can the script " quaternion2rmatrix.tcl" be found?
> Best regards,
> Ajasja

This archive was generated by hypermail 2.1.6 : Tue Dec 31 2013 - 23:21:38 CST