<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Tim,<br>
    <br>
    thanks for the reference! There is a number of instances where this
    approach is useful. In Phenix this is also used to determine density
    map peak sphericity (see cctbx/maptbx/sphericity.h) and to get
    initial values for refinement of anisotropic ADPs from map peaks.<br>
    <br>
    Sure I will play with this and visit as many corner cases as I could
    think of!<br>
    <br>
    All the best,<br>
    Pavel<br>
    &nbsp;<br>
    <div class="moz-cite-prefix">On 1/21/14, 1:25 AM, Tim Gruene wrote:<br>
    </div>
    <blockquote cite="mid:52DE3CFB.8030009@shelx.uni-ac.gwdg.de"
      type="cite">
      <pre wrap="">Hi Pavel,

that's the method described in
<a class="moz-txt-link-freetext" href="http://journals.iucr.org/a/issues/2011/01/00/sc5036/index.html">http://journals.iucr.org/a/issues/2011/01/00/sc5036/index.html</a> ;-) based
on the moments of inertia (a computer scientist might name it
differently). I am not sure, though, you would get the desired result
for short helices. E.g. a helix defined by three atoms the eigenvalue
would point roughly in the direction of the external phosphates, which
is far from parallel with the helix axis.

Best,
Tim

On 01/21/2014 04:20 AM, Pavel Afonine wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi Ed,

interesting idea! Although I was thinking to have a tool that is a
little more general and a little less context dependent. Say you have
two clouds of points that are (thinking in terms of macromolecules) two
alpha helices (for instance), and you want to know the angle between the
axes of the two helices. How would I approach this?..

First, for each helix I would compute a symmetric 3x3 matrix like this:

sum(xn-xc)**2             sum(xn-xc)*(yn-xc) sum(xn-xc)*(zn-zc)
sum(xn-xc)*(yn-xc)     sum(yn-yc)**2 sum(yn-yc)*(yz-zc)
sum(xn-xc)*(zn-zc)     sum(yn-yc)*(yz-zc)        sum(zn-zc)**2

where (xn,yn,zn) is the coordinate of nth atom, the sum is taken over
all atoms, and (xc,yc,zc) is the coordinate of the center of mass.

Second, for each of the two matrices I would find its eigen-values and
eigen-vectors, and select eigen-vectors corresponding to largest
eigenvalues.

Finally, the desired angle is the angle between the two eigen-vectors
found above, which is computed trivially.
I think this a little simpler than finding the best fit for a 3D line.

What you think?

Pavel


On 1/20/14, 2:14 PM, Edward A. Berry wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">

Pavel Afonine wrote:
. .

</pre>
          <blockquote type="cite">
            <pre wrap="">The underlying procedure would do the following:
   - extract two sets of coordinates of atoms corresponding to two
provided atom selections;
   - draw two optimal lines (LS fit) passing through the above sets
of coordinates;
   - compute and report angle between those two lines?

</pre>
          </blockquote>
          <pre wrap="">
This could be innacurate for very short helices (admittedly not the
case one usually would be looking for angles), or determining the axis
of  a short portion of a curved helix. A more accurate way to
determine the axis- have a long canonical duplex constructed with its
axis along Z (0,0,1). Superimpose as many residues of that as required
on the duplex being tested, using only backbone atoms or even only
phosphates. Operate on (0,0,1) with the resulting operator (i.e. take
the third column of the rotation matrix) and use that as a vector
parallel to the axis of the duplex being tested.
_______________________________________________
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>
        <pre wrap="">
_______________________________________________
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>
      <pre wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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>