<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
we discussed this recently on phenixbb. Here is the copy: <br>
<br>
phenix.pdbtools model.pdb rotate_about_axis.axis="chain A and resseq
1:123 and (name CA or name CB)"
rotate_about_axis.atom_selection="chain A and resseq 1"
rotate_about_axis.angle=35
<br>
<br>
where
<br>
<br>
rotate_about_axis.axis defines the rotation axis (must be two points
in space);
<br>
rotate_about_axis.atom_selection defines the atoms that will be
rotated about the axis;
<br>
rotate_about_axis.angle defines rotation angle in degrees.
<br>
<br>
Instead of specifying atom selection string in
rotate_about_axis.axis, you can give it coordinates of two points:
<br>
<br>
phenix.pdbtools model.pdb rotate_about_axis.axis="1.234 2.345 4.567
-2.321 3.765 0.001" rotate_about_axis.atom_selection="chain A and
resseq 1:123" rotate_about_axis.angle=35
<br>
<br>
If interested in the math details - see the code in phenix.pdbtools
that does it.<br>
<br>
Pavel.
<br>
<br>
<br>
<br>
On 5/25/11 12:24 PM, Nathaniel Echols wrote:
<blockquote
cite="mid:BANLkTinhaY+RVD4JFGwb0=qxVs1V+CMeQQ@mail.gmail.com"
type="cite">
<div>FYI, for anyone inclined to write their own programs, there
is a similar Python function for this in CCTBX:</div>
<div><br>
</div>
<div>from mmtbx.refinement.fit_rotamers
import�rotate_point_around_axis</div>
<div>xyz_new =�rotate_point_around_axis(axis_start, axis_end, xyz,
angle_degrees)</div>
<div><br>
</div>
<div>I'm not posting the code here because Paul's version is
clearer, but it's in
$PHENIX/cctbx_project/mmtbx/refinement/fit_rotamers.py. �(It
wouldn't surprise me if this duplicates a more general function
in one of the lower-level math modules, but I'm not sure where
to look.)</div>
<div><br>
</div>
<div>-Nat</div>
<div><br>
</div>
On Wed, May 25, 2011 at 12:11 PM, Paul Emsley <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:paul.emsley@bioch.ox.ac.uk">paul.emsley@bioch.ox.ac.uk</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">On 25/05/11 19:41, Hena Dutta wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<br>
Dear Members,
<div class="im"><br>
<br>
<br>
I want to know the mathematical relations between 2 sets
of co-ordinates, one before and one after the rotation. I
used COOT to rotate the side chain (containing atoms N1,
C2, N3, �C4, C5, C6, N6, N7 and C8) of Adenine by 180
degree about the glycosidic bond (C1�-N9). How the initial
co-ordinates (Xi, Yi, Zi) and final co-ordinates (Xf, Yf,
Zf) are mathematically related? I shall be very grateful
if someone can tell me the equations.<br>
<br>
<br>
</div>
</blockquote>
<br>
I got it from the matrix from the Amore documentation.<br>
<br>
Coord_orth<br>
rotate_round_vector(direction, // vector of the bond about
which we are rotating<br>
� � � � � � � � � � � � � � � �position, �// of the moving
atom<br>
� � � � � � � � � � � � � � � �origin_shift, // typically the
position of the B atom (e.g. N9)<br>
� � � � � � � � � � � � � � � �angle) {<br>
<br>
� �unit_vec = direction.unit();<br>
<br>
� l = unit_vec[0];<br>
� m = unit_vec[1];<br>
� n = unit_vec[2];<br>
<br>
� ll = l*l;<br>
� mm = m*m;<br>
� nn = n*n;<br>
� cosk = cos(angle);<br>
� sink = sin(angle);<br>
� I_cosk = 1.0 - cosk;<br>
<br>
� // The Rotation matrix angle w about vector with direction
cosines l,m,n.<br>
� //<br>
� // ( l**2+(m**2+n**2)cos k � � lm(1-cos k)-nsin k � � �
�nl(1-cos k)+msin k � )<br>
� // ( lm(1-cos k)+nsin k � � � �m**2+(l**2+n**2)cos k � �
mn(1-cos k)-lsin k � )<br>
� // ( nl(1-cos k)-msin k � � � �mn(1-cos k)+lsin k � � �
�n*2+(l**2+m**2)cos k )<br>
� //<br>
� // �Thanks for that pointer EJD :).<br>
<br>
<br>
<br>
�Paul.<br>
<br>
<br>
<br>
_______________________________________________<br>
phenixbb mailing list<br>
<a moz-do-not-send="true"
href="mailto:phenixbb@phenix-online.org" target="_blank">phenixbb@phenix-online.org</a><br>
<a moz-do-not-send="true"
href="http://phenix-online.org/mailman/listinfo/phenixbb"
target="_blank">http://phenix-online.org/mailman/listinfo/phenixbb</a><br>
</blockquote>
</div>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
phenixbb mailing list
<a class="moz-txt-link-abbreviated" href="mailto:phenixbb@phenix-online.org">phenixbb@phenix-online.org</a>
<a class="moz-txt-link-freetext" href="http://phenix-online.org/mailman/listinfo/phenixbb">http://phenix-online.org/mailman/listinfo/phenixbb</a>
</pre>
</blockquote>
<br>
</body>
</html>