From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Tue Mar 04 2014 - 13:27:36 CST

Hi Dawid,

Its considered good form to keep vmd-l in the loop on these things.

Ahh. Well then part 4 is all you really care about. Assuming the
reference structure is mol 0, and the others are 1 through 50, this
should work:
set ref [atomselect 0 "all"]
set sel [atomselect 1 "all"]
set M [measure fit $sel $ref] ; #This would be the matrix you are
interested in. Note that it ALSO does rotation. If you only want
translation, you'd measure the center of geometry difference and use
moveby instead of move.
for { set i 1 } { $i <= 50 } { incr i } {
    set all [atomselect $i "all"]
    $all move $M
}
-Josh
On 03/04/2014 01:20 PM, Dawid das wrote:
> No, what I want to do is:
> 1) I have reference structure.
> 2) I have 50 other structures.
> 3) I want to align those 50 structures on the reference one.
> 4) Actually I just want to find a vector/matrix which translates the
> first of 50 structures to the reference one.
> Then I want to translate all of the rest structures (49) by the same
> vector.
>
> What I tried is:
> After adding the 50+reference structures I set the variables for them:
> set k 0
> while {k<=50} {set sel$k [atomselect 0 all]; incr k 1}
>
> Than next step:
> set k 1
> while {k<=50} {$sel$k move [measure fit $sel$k $sel0]; incr k 1}
>
> But I cannot properly invoke the sel1 sel2 and so on variables. I
> tried every combination of "", {}, [] and () braces. Still got some
> errors.
>
>
> 2014-03-04 20:01 GMT+01:00 Josh Vermaas <vermaas2_at_illinois.edu
> <mailto:vermaas2_at_illinois.edu>>:
>
> Hi Dawid,
>
> I'm assuming you want the whole structure to be aligned based on a
> subset. So you'd have 3 selections:
> ref = atomselection of the part of the reference molecule you want
> to do the alignment based on
> sel = atomselection of the part of the new molecule that is
> comparable to ref
> all = atomselection of the whole new molecule (since you move the
> whole molecule, not just a small part of it.)
> So you'd do the movement on the all selection, ie:
> set all [atomselect top "all"]
>
> $all move [measure fit $sel $ref] ; #Does the movement.
>
> -Josh
>
>
> On 03/04/2014 11:31 AM, Dawid das wrote:
>> Hi Josh,
>>
>> Firstly, thank you all for clues. I really appreciate it.
>> However I don't know if I understood Josh correctly. I made an
>> atomselections
>> for reference and sel easily but I have no idea how to make
>> atomselection
>> for all molecules (except for reference one), because that is
>> what I actually
>> want to do and this is what you explained, right?
>>
>>
>> 2014-03-03 23:27 GMT+01:00 Josh Vermaas <vermaas2_at_illinois.edu
>> <mailto:vermaas2_at_illinois.edu>>:
>>
>> Hi Dawid,
>>
>> Sure. Just write a script/use the RMSD trajectory tool. Since
>> you are dealing with 50 structures, and loading them by hand
>> is a pain, I'd use the Tcl scripting interface (it will save
>> you alot of trouble later on). The script would:
>>
>> Load the reference structure
>> Make some atomselection that will be your reference (ref)
>> Make a loop over the 50 others{
>> Load the new structure
>> Make an atomselection that is the same size as the reference
>> selection (sel)
>> Make an atomselection that includes the whole structure (all)
>> $all move [measure fit $sel $ref] ; #Does the movement.
>> Save the new coordinates to a new file
>> Cleanup (delete atomselections made inside the loop, possibly
>> delete the molecule too)
>> }
>> Be happy.
>>
>> To implement this, you should familiarize yourself with the
>> "mol" and "atomselect" commands
>> (http://www.ks.uiuc.edu/Research/vmd/current/ug/node119.html), the
>> exact structure and contents of which will change depending
>> on how you setup the files/what features of the system are
>> interesting to you.
>>
>> Good luck!
>> -Josh Vermaas
>>
>>
>>
>> On 03/03/2014 03:25 PM, Dawid das wrote:
>>> Dear vmd specialists,
>>>
>>> I want to do following thing.
>>> Let's say I have a reference structure and 50 others.
>>> Now I want to align those 50 on the reference structure.
>>> When I do it I want to save new xyz coordinates for 50
>>> transformed structures. Is it possible at all?
>>>
>>> How do I specify that my first structure is actually the
>>> reference one?
>>>
>>> Thanks in advance,
>>> Dawid Grabarek
>>
>>
>
>