Lecture 4: Rotation and Translation in Bioinformatics 2, Study notes of Biology

The concept of rotation and translation in bioinformatics 2, focusing on least-squares superposition and the calculation of rotation matrices when moving the mouse to rotate a molecule. It covers the mathematical formulas for rotation angles, new atom coordinates, and the sum of angles formula.

Typology: Study notes

Pre 2010

Uploaded on 08/09/2009

koofers-user-i3u
koofers-user-i3u 🇺🇸

10 documents

1 / 27

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Bioinformatics 2 -- lecture 4
Rotation and translation
Least-squares superposition
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download Lecture 4: Rotation and Translation in Bioinformatics 2 and more Study notes Biology in PDF only on Docsity!

Bioinformatics 2 -- lecture 4

Rotation and translation

Least-squares superposition

What happens when you move the mouse to

rotate a molecule?

Mouse sends mouse

coordinates (Δx,Δy) to the

running program

Rotation angles are calculated:

θ x

= Δx*scale, θ y

= Δy*scale

Rotation matrices are calculated:

x

R =

0 cos! x

" sin! x

0 sin! x

cos! x

( y

R =

cos!

y

0 " sin!

y

sin!

y

0 cos!

y

2.

1.

3.

y

x

Rotation is angular addition

β

x

r

α

(x,y)

(x’,y’)

y

axis of

rotation =

Cartesian

origin

atom starts at

(x=| r| cosα, y=| r| sinα)

..rotates to...

(x'=| r| cos(α+β), y'=| r| sin(α+β))

Convention: angles are measured counter-clockwise.

Sum of angles formula

cos (α+β) = cos α cos β − sin α sin β

sin (α+β) = sin α cos β + sin β cos α

A rotation around a principle axis

The Z coordinate stays the same. X and Y change.

cos! " sin! 0

sin! cos! 0

0 0 1

$

%

%

%

&

'

(

(

(

R

z

=

cos! 0 sin!

0 1 0

" sin! 0 cos!

$

%

%

%

&

'

(

(

(

1 0 0

0 cos! " sin!

0 sin! cos!

$

%

%

%

&

'

(

(

(

The Y coordinate stays the same. X and Z change.

The X coordinate stays the same. Y and Z change.

R

y

=

R

x

=

A 3D rotation matrix

Is the product of 2D rotation matrices.

cos! " sin! 0

sin! cos! 0

0 0 1

$

%

%

%

&

'

(

(

(

cos ) 0 " sin )

0 1 0

sin ) 0 cos )

$

%

%

%

&

'

(

(

(

=

cos! cos ) " sin! cos!

sin! cos ) cos! "sin! sin )

sin ) 0 cos )

$

%

%

%

&

'

(

(

(

Rotation around z-axis

Rotation around y-axis 3D rotation

Rotating in opposite order gives a different matrix

x

R

y

R =

0 cos! x

" sin! x

0 sin! x

cos! x

cos! y

0 "sin! y

sin! y

0 cos! y

cos! y

0 " sin! y

" sin! x

sin! y

cos! x

" sin! x

cos! y

sin! y

cos! x

sin! x

cos! x

cos! y

Reversing the rotation

x '

y '

cos ' sin '

( sin ' cos '

x

y

For the opposite rotation, flip the matrix.

The inverse matrix = The transposed matrix.

cos! sin!

" sin! cos!

$

% %

&

'

( (

cos! " sin!

sin! cos!

$

% %

&

'

( (

=

1 0

0 1

$

%

&

'

(

A B

C D

!

"

$

%

& &

T

=

A C

B D

!

"

$

%

& &

This is the “transpose”

NOTE: cosb cosb + sinb sinb = 1

Right-handed 90° rotations:

x

y

0! 1 0

z

z

x

y

y

z

x

90° rotation around

X

Y

Z

For a R-handed rotation, the - sine is up and to the right of the + sine.

Helpful hint:

In class exercise: rotate a point

(x,y,z) = (1., 4., 7.)

Rotate this point by 90° around the Z-axis

Then...

Rotate the new point by 90° around the Y-axis.

What are the new coordinates?

Polar angles

z = north pole

x = prime meridean

@ equator

y

ψ

φ

κ

Rotation of κ degrees around an axis axis

located at φ degrees longitude and ψ degrees

latitude

Special properties of rotation matrices

Read more about rotation matrices at:

http://mathworld.wolfram.com/RotationMatrix.html

  • They are square, 2x2 or 3x3(higher dimensions in principle)
  • The product of any two rotation matrices is a rotation matrix.
  • The inverse equals the transpose, R

    = _R_

T

  • Every row/column is a unit vector.
  • Any two rows/columns are orthogonal vectors.
  • The cross-product of any two rows equals the third.
  • | x | = | Rx |, where R is a rotation matrix.

pseudo-pseudocode program for computing rmsd

sum = 0

N = 0

while {

/** Read coordinates for two aligned positions.

read (x 1

,y 1

,z 1

) , (x 2

,y 2

,z 2

)

/** Compute the distance

2

d =(x 1

-x 2

)

2 +(y 1

-y 2

)

2 +(z 1

-z 2

)

2

/** sum it.

sum = sum + d

/** keep track of how many pairs there are.

N = N + 1

}

/** Average and take square root.

rmsd = sqrt(sum/N)

Least squares superposition

M x

i

+ v! y

i

2

i

Problem: find the rotation matrix, M, and a vector, v,

that minimize the following quantity:

Where x i

are the coordinates from one molecule and

y i

are the equivalent* coordinates from another molecule.

  • equivalent based on alignment