From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Aug 05 2011 - 16:35:52 CDT

Hi,
  For a given atom selection, you can query the existing coordinates
with "$sel get {x y z}" or similar script commands, and then compute whatever
new coordinates you want, and then replace the existing coordinates with
the new ones with "$sel set {x y z} ....." where .... is another Tcl list
or list of lists, etc. With this, you could write your own Tcl procedure
to do any manipulation you like, including things not easily expressed
with the built-in translation/rotation commands, etc.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Fri, Jul 29, 2011 at 07:44:38AM -0700, nahren manuel wrote:
> Dear VMD users,
> I want to restrain two atoms.A(index 6, OL) and B(index 17, NR).
> ATOM 1 CL ALA 1 16.626 18.862 20.798 1.00
> 1.00
> ATOM 5 CLP ALA 1 17.760 19.029 19.867 1.00
> 0.17
> ATOM 6 OL ALA 1 17.642 19.725 18.875 1.00
> 1.17
> ATOM 14 HB3 ALA 1 19.962 17.574 17.698 1.00
> 28.91
> ATOM 15 CRP ALA 1 20.897 19.618 19.502 1.00
> 0.15
> ATOM 16 OR ALA 1 21.893 19.687 20.187 1.00
> 1.63
> ATOM 17 NR ALA 1 20.489 20.661 18.782 1.00 0.77
> I move atom 6 to origin using
> $sel moveby "-17.642 -19.725 -18.875"
>
> ATOM 5 CLP ALADX 1 -0.700 0.540 -0.850 0.00 0.00
> ATOM 6 OL ALADX 1 0.000 0.000 0.000 0.00 0.00
> ATOM 15 CRP ALADX 1 -4.070 -1.100 -0.090 0.00 0.00
>
> ATOM 17 NR ALADX 1 -4.200 -2.080 0.850 0.00 0.00
> I want translate the above to have somethings like (irrespective of
> coordinates of other atoms)
>
> ATOM 6 OL ALADX 1 0.000 0.000 0.000 0.00 0.00
>
> ATOM 17 NR ALADX 1 x.xxx 0.000 0.000 0.00 0.00
> So that I can apply restraint between the atoms 6 and 17 along X-axis.
> Best regards,
> nahren

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