Aligning the distance between two centroids with an axis

From: Mert Gür (gurmert_at_gmail.com)
Date: Fri Jan 30 2009 - 04:02:55 CST

Dear all,
I have a system composed of two proteins. I defined the first centroid
(c1) to be the centroid of the Calfa atoms of protein1 . The same way I
defined the second centroid (c2) to be the centroid of the Calfa atoms of
protein2 .
What I would like to do is to align the vector v=c1-c2 with the x axis
(Could also be y axis or z axis). I think what I need is to rotate my
protein with respects to this vector. But unfortunately I have no clue how
to do that. I did some search but I haven't come along any relevant
information .
I appreciate any help,hint or source.
Thanks in advance,
Mert

set allatoms [atomselect top all]

$allatoms set beta 0

set c1atom [atomselect top "chain A and name CA"]

$c1atom set beta 1

$allatoms set occupancy 0

set c2atom [atomselect top "chain B and name CA"]

$c2atom set occupancy 1

set c1 [lindex [$c1datom get {x y z}] 0]

set c2 [lindex [$c2atom get {x y z}] 0]

vecnorm [vecsub $c1 $c2]

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:52:19 CST