Dear CCP4 members,
    I have finally used Eleanor's idea, and it works very well. After
applying SSM, we can get a rotation matrix(M), and a displacement vector N:
     (Xnew,Ynew,Znew)'=M*(X,Y,Z)'+N
Then, from the rotation matrix M, we can get its another representative
format-----*quaternion number.  *The quaternion number has 4 elements, the
first element(w) of which represents the cosine value of half of the
rotation anger, and the next 3 elements(x0,y0,z0) represent the rotation
vector. That means the molecule rotates an angle of acos(w)*2*180/pi degrees
around the vector (x0,y0,z0).
   The attached file is the matlab program i wrote to translate M into a
quaternion number. That should be very easy to be translated into other
language formats.

Best & regards,
Yuan SHANG



On Thu, Aug 19, 2010 at 7:34 PM, Frances C. Bernstein <
f...@bernstein-plus-sons.com> wrote:

> Pete Artymiuk wrote:
> -----------------------
>
> I have an old badly-written Fortran program (I wrote it for a Vax, but it
> still compiles and runs in g95 - isn't Fortran wonderful?)  that takes
> Arnott & Dover's polar coordinates and converts them to a helix of any
> required length* in PDB (or Diamond!) format.
> -----------------------
>
> Wow, that is an old program!
>
> For everyone under the ago of 60 reading this list, Diamond
> format was the very first PDB format, used for the first 100
> or so entries that we had.  It was based on the output format
> of the Diamond real-space refinement program and each line was
> 132 characters long.  Long lines were awkward, in some ways,
> to handle on computers of that time so we designed what is
> now known as PDB format.  If you want to know more, you can
> look at page 9 of the September 1974 PDB Newsletter (available
> on the RCSB web site if you start at
>
> http://www.rcsb.org/pdb/static.do?p=general_information/news_publications/newsletters/newsletter.html#pre1999)
> for the format of coordinate records in the original format.
>
> The reason that I know that there were about 100 entries
> released in the original format is that I was the one who had
> to convert them all into the new PDB format in 1976.
>
>                       Frances Bernstein
>
> =====================================================
> ****                Bernstein + Sons
> *   *       Information Systems Consultants
> ****    5 Brewster Lane, Bellport, NY 11713-2803
> *   * ***
> **** *            Frances C. Bernstein
>  *   ***      f...@bernstein-plus-sons.com
>  ***     *
>  *   *** 1-631-286-1339    FAX: 1-631-286-1999
> =====================================================
>
function V=Matrix2Quat(M)
tq(1)=1+M(1,1)+M(2,2)+M(3,3);
tq(2)=1+M(1,1)-M(2,2)-M(3,3);
tq(3)=1-M(1,1)+M(2,2)-M(3,3);
tq(4)=1-M(1,1)-M(2,2)+M(3,3);
j=1;
QW=0;
QX=0;
QY=0;
QZ=0;
for i=1:4
    if(tq(i)>tq(j))
        j=i;
    end
end
% check the diagonal
if (j==1)
        %/* perform instant calculation */
        QW = tq(j);
        QX = M(2,3)-M(3,2);
        QY = M(3,1)-M(1,3);
        QZ = M(1,2)-M(2,1);
elseif (j==2)
        QW = M(2,3)-M(3,2);
        QX = tq(j);
        QY = M(1,2)+M(2,1);
        QZ = M(1,3)+M(1,3);
elseif (j==3) 
        QW = M(3,1)-M(1,3);
        QX = M(1,2)+M(2,1);
        QY = tq(j);
        QZ = M(2,3)+M(3,2);
else 
        QW = M(1,2)-M(2,1);
        QX = M(3,1)+M(1,3);
        QY = M(2,3)+M(3,2);
        QZ = tq(j);
end

 s = sqrt(0.25/tq(j));
 QW =  QW*s;
 QX = QX*s;
 QY = QY*s;
 QZ = QZ*s;
 V(1,1)=QX;
 V(2,1)=QY;
 V(3,1)=QZ;
 V(4,1)=QW;
 V(5,1)=acos(QW)*2*180/pi;

Reply via email to