From: Roman Petrenko (rpetrenko_at_gmail.com)
Date: Sun Jul 27 2008 - 04:09:35 CDT

thanks for your advices, but already have gone through this step.
so, here is the summary for all interested.
given two bonds C1-H1 in selection1 and C2-H2 in selection2,
translate/rotate selection2 so that two bonds are on the same spot.

after placing both C1 and C2 into the origin, here is the rest of the script

#find rotation angle
  set v1 [vecnorm $H1]
  set v2 [vecnorm $H2]
  set vdir [vecnorm [veccross $v1 $v2]]
  set angle [expr -1.0*acos([vecdot $v1 $v2])]
#rotate
  $selection2 move [trans bond {0.0 0.0 0.0} $vdir $angle rad]

I love VMD and all the support group!!!

On Sun, Jul 27, 2008 at 3:16 AM, Schreiner Eduard <eschrein_at_ks.uiuc.edu> wrote:
> an addition to what I wrote before:
> did you try to make two selections containing the only the atoms
> you mentioned and to determine the transformation matrix by "measure fit"?
> (check manual p166f for usage)
> I do not know, though, if it works, for only two atoms in each of
> the selections, but you could try.
>
>
> eddi
>
>
> On Jul 27, 2008, at 1:52 AM, Schreiner Eduard wrote:
>
>> Hi Roman,
>>
>> maybe you would like to take a look at the
>>
>> move [trans bond ....]
>>
>>
>> command (just search for "move [ trans bond" in the manual. In the current
>> from the vmd web page it is on pp 160f).
>> instead of "bond", you also can specify an axis like
>>
>> $sel move [trans bond {0.0 1.0 0.0} {0.0 0.0 0.0} 90 deg]
>>
>> Using something similart, you should be able to rotate your system in the
>> appropriate way.
>> Since you have already positioned one of the atoms at the correct
>> position, you will have to determine the angle for the rotation and the axis
>> of rotation. However, may get quite tricky. Maybe there is a simpler
>> solution.
>>
>>
>> eddi
>>
>> On Jul 26, 2008, at 11:31 PM, Roman Petrenko wrote:
>>
>>> I have two identical molecules (described by the same psf file), but
>>> with different coordinates. Each molecule has some inner bond CA-CB,
>>> the question is how to align molecule2 with molecule1, so that the
>>> specified bond in both molecules have EXACTLY the same coordinates.
>>>
>>> I tried fit - method and it didn't work.
>>>
>>> So far i've managed only to bring two CA atoms from each molecule to
>>> the same spot.
>>>
>>> Thanks.
>>>
>>> --
>>> Roman Petrenko.
>>> Physics Department
>>> University of Cincinnati
>
>

-- 
Roman Petrenko.
Physics Department
University of Cincinnati