***  For details on how to be removed from this list visit the  ***
***          CCP4 home page http://www.ccp4.ac.uk         ***


venkataraman kabaleeswaran wrote:
***  For details on how to be removed from this list visit the  ***
***          CCP4 home page http://www.ccp4.ac.uk         ***


Hi everyone

I have used lsqkab and lsqman to superimpose related
molecules.
I would like to display the axis of rotation from the
rotation matrix that was used by lsqman to superpose the two subunits.
I am also interested in  calculating vectors for the
different rotation axes and their corresponding
rotation angles.

How can this be done?  Any help would be greatly
appreciated.

Below is some perl code which converts a 3x3 matrix to a vector plus angle.

You can then draw the vector, (perhaps translated to the centre of mass) in pymol with a cgo ( http://pymol.sourceforge.net/newman/user/S0500cgo.html#14_4 ) as seen in fig2a in http://nar.oxfordjournals.org/cgi/content/full/32/18/5442

================
#!/usr/bin/perl

@[EMAIL PROTECTED];

$T=$m[0]+$m[4]+$m[8]+1;

if ($T>0.0005) {
    print "Case 1: ";
    $S=0.5/sqrt($T);
    $w = 0.25 / $S;
    $x=($m[5]-$m[7])/$S;
    $y=($m[6]-$m[2])/$S;
    $z=($m[1]-$m[3])/$S;
} else {
    print "Case 2";
    if (($m[0]>$m[4])&&($m[0]>$m[8])) {
        print "a: ";
        $S=sqrt( 1.0 + $m[0] - $m[4] - $m[8] ) * 2;
        $x=0.5/$S;
        $y=($m[1]+$m[3])/$S;
        $z=($m[2]+$m[6])/$S;
        $w=($m[5]+$m[7])/$S;
    } elsif (($m[4]>$m[0])&&($m[4]>$m[8])) {
        print "b: ";
        $S=sqrt( 1.0 + $m[4] - $m[0] - $m[8] ) * 2;
        $x=($m[1]+$m[3])/$S;
        $y=0.5/$S;
        $z=($m[5]+$m[7])/$S;
        $w=($m[2]+$m[6])/$S;
#    } elsif (($m[8]>$m[0])&&($m[8]>$m[4])) {
    } else {
        print "c: ";
        $S=sqrt( 1.0 + $m[8] - $m[0] - $m[4] ) * 2;
        $x=($m[2]+$m[6])/$S;
        $y=($m[5]+$m[7])/$S;
        $z=0.5/$S;
        $w=($m[1]+$m[3])/$S;
    }
}
$angle= 2*acos($w);
$angledeg=$angle*180/3.1415926;
print "$x $y $z $angledeg\n";

sub acos { atan2( sqrt(1 - $_[0] * $_[0]), $_[0] ) }
===============

Cheers,
Charlie
--
Dr Charles S. Bond        University of Dundee   Tel: +44-1382-388325
Honorary Lecturer               Dow St, Dundee   Fax: +44-1382-345764
BBSRC David Phillips Fellow  DD1 5EH, Scotland  [EMAIL PROTECTED]
School of Life Sciences      http://stein.bioch.dundee.ac.uk/~charlie

Reply via email to