From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Feb 26 2009 - 14:25:06 CST

John,
  Thanks, I've implemented this fix and tested it in my local build.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Thu, Feb 26, 2009 at 01:21:15PM -0500, Jumper, John wrote:
> There is a bug in VMD's weighted RMS fits for version 1.8.7a24. The
> correlation matrix for the fit is calculated with squared weights while
> the
> translation vector is calculated with unsquared weights. This results
> in an
> incorrect fit and a wrong RMSD value.
>
> The bug can be demonstrated by running the following commands on the PDB
> file
> at the end of this email.
>
> gopython
> from atomsel import *
> w = [1.0, 1.5, 2.0, 2.5]
> s1 = atomsel('index 0 to 3')
> s2 = atomsel('index 4 to 7')
> s1.rmsd(s2, w)
> s1.move(s1.fit(s2, w))
> s1.rmsd(s2, w)
>
> The RMSD value before the fit is significantly lower than the value
> after the
> fit. The following patch to fitrms.c fixes the bug.
>
> --- fitrms.c.bak 2009-02-26 11:40:57.416552000 -0500
> +++ fitrms.c 2009-02-26 11:41:25.159180000 -0500
> @@ -166,9 +166,9 @@
> double x1 = w * (vv1[0] - t1[0]);
> double y1 = w * (vv1[1] - t1[1]);
> double z1 = w * (vv1[2] - t1[2]);
> - double x2 = w * (vv2[0] - t2[0]);
> - double y2 = w * (vv2[1] - t2[1]);
> - double z2 = w * (vv2[2] - t2[2]);
> + double x2 = (vv2[0] - t2[0]);
> + double y2 = (vv2[1] - t2[1]);
> + double z2 = (vv2[2] - t2[2]);
> aatmp[0] += x2 * x1;
> aatmp[1] += x2 * y1;
> aatmp[2] += x2 * z1;
>
>
> rmsfit.pdb:
>
> CRYST1 100.000 100.000 100.000 90.00 90.00 90.00 P 1 1
> ATOM 1 C A X 1 1.110 -2.448 1.069 1.00 0.00
> C
> ATOM 2 C A X 1 -6.396 -6.853 10.913 1.00 0.00
> C
> ATOM 3 C A X 1 9.566 -8.395 7.453 1.00 0.00
> C
> ATOM 4 C A X 1 10.124 0.427 9.370 1.00 0.00
> C
> ATOM 5 C A X 1 0.000 0.000 0.000 1.00 0.00
> C
> ATOM 6 C A X 1 -7.911 -7.880 11.156 1.00 0.00
> C
> ATOM 7 C A X 1 10.937 -1.364 10.292 1.00 0.00
> C
> ATOM 8 C A X 1 10.380 -5.561 7.382 1.00 0.00
> C
> END
>
> Thank you.
>
> John Jumper
> D. E. Shaw Research

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078