From: Ajasja Ljubetič (ajasja.ljubetic_at_gmail.com)
Date: Tue Sep 15 2015 - 03:20:41 CDT

Hi!

I just had to do this recently, so I'm attaching the proc. If you would
like to align on the protein only, change all to protein:

proc center_tray {{mol top}} {
  set nf [molinfo $mol get numframes]
  set allp [atomselect $mol "all"]

  for {set i 0} {$i < $nf} {incr i} {
    $allp frame $i
    # center the protein
    $allp moveby [vecinvert [measure center $allp]]

  }
  $allp delete
  display resetview

}

All the best,
Ajasja

On 15 September 2015 at 08:40, Norman Geist <norman.geist_at_uni-greifswald.de>
wrote:

> If you want to align the frames using only translations you can move by
> the difference of the centers of mass. Measure fit will always rotate.
>
> Norman Geist
>
> -----Ursprüngliche Nachricht-----
> Von: owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] Im Auftrag
> von Simon Dürr
> Gesendet: Montag, 14. September 2015 17:16
> An: vmd-l_at_ks.uiuc.edu
> Betreff: vmd-l: Align only translation not rotation
>
> I'm using the following command to align one of the frames of my
> simulation to frame 0 to better understand what the ILS tools
> (ILS:shift_to_center) do.
>
> I however run into a strange problem.
>
> I do this:
> set sel [atomselect top "protein and name CA"]
> set molid [$sel molid]
> set refid $molid
> set ref [atomselect $refid [$sel text] frame 0]
> set all [atomselect $molid all]
>
> $sel frame 1
> $all frame 1
> set mat [measure fit $sel $ref]
> set shift [lindex $mat 0 3]
> lappend shift [lindex $mat 1 3]
> lappend shift [lindex $mat 2 3]
> $all moveby $shift
>
> The command should carry out only the transformation part of the
> alignment and omit the rotation. I therefore expect to see frame1
> aligned on the frame0 with little differences due to rotation (the
> frames are 1ns apart)
> What I get instead is the protein aligned in the y-axis and frame X is
> shifted on the x-z-plane about 5A away from the frame0.
>
> Has anyone an idea why this happens?
>
> Cheers,
> Simon
>
>
>