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 = 1 0 0 0 cos! x " sin! x 0 sin! x cos! x # $ % % % & ' ( ( ( yR = cos! y 0 " sin!y 0 1 0 sin! y 0 cos!y # $ % % % % & ' ( ( ( ( 2. 1. 3. y x Sum of angles formula cos (α+β) = cos α cos β − sin α sin β sin (α+β) = sin α cos β + sin β cos α A rotation matrix β x y r α (x,y) (x’,y’) x' = |r| cos (α+β) = |r|(cos α cos β − sin α sin β) = (|r| cos α) cos β − (|r| sin α)sin β = x cos β − y sin β y' = |r| sin (α+β) = |r|(sin α cos β + sin β cos α) = (|r| sin α) cos β + (|r| cos α) sin β = y cos β + x sin β x = |r|cos α y = |r|sin α x' y' ! " # $ % & = cos' ( sin ' sin' cos ' ! " # # $ % & & rcos) rsin) ! " # $ % & = cos ' (sin ' sin ' cos' ! " # # $ % & & x y ! " # $ % & rotation matrix is the same for any r, any α. 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 # $ % % % & ' ( ( ( Rz = 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. Ry = Rx = Rotating in opposite order gives a different matrix x R y R = 1 0 0 0 cos!x " sin!x 0 sin!x cos! x # $ % % % & ' ( ( ( cos!y 0 "sin!y 0 1 0 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 Example: rotation in 2 steps Rotate the vector v=(1.,2.,3.) around Z by 60°, then around Y by -60° cos60° ! sin60° 0 sin60° cos60° 0 0 0 1 " # $ $ $ % & ' ' ' 1 2 3 " # $ $ $ % & ' ' ' = 1(0.5) ! 2(0.866) + 3(0) 1(0.866) + 2(0.5) + 3(0) 0 + 0 + 3(1) " # $ $ $ % & ' ' ' = !1.232 1.866 3 " # $ $ $ % & ' ' ' cos60° 0 ! sin 60° 0 1 0 sin60° 0 cos 60° " # $ $ $ % & ' ' ' !1.232 1.866 3 " # $ $ $ % & ' ' ' = !1.232(0.5) +1.866(0) ! 3(0.866) !1.232(0) +1.866(1) + 3(0) !1.232(0.866) +1.866(0) + 3(0.5) " # $ $ $ % & ' ' ' = !3.214 1.866 0.433 " # $ $ $ % & ' ' ' Euler angles, α β γ cos! " sin! 0 sin! cos! 0 0 0 1 # $ % % % & ' ( ( ( 1 0 0 0 cos ) " sin ) 0 sin ) cos ) # $ % % % & ' ( ( ( cos* " sin* 0 sin* cos* 0 0 0 1 # $ % % % & ' ( ( ( Order of rotations: 123 axis of rotation: z’’ x’ z cos! " sin! 0 sin! cos! 0 0 0 1 # $ % % % & ' ( ( ( cos) 0 " sin) 0 1 0 sin) 0 cos) # $ % % % & ' ( ( ( cos* " sin* 0 sin* cos* 0 0 0 1 # $ % % % & ' ( ( ( cos) 0 sin) 0 1 0 " sin) 0 cos) # $ % % % & ' ( ( ( cos! sin! 0 " sin! cos! 0 0 0 1 # $ % % % & ' ( ( ( 123 z’’ -z-y’y’’’z’’’’ 45 Polar angles, φψκ 3D rotation conventions: Net rotation = κ, around an axis axis defined by φ and ψ Each rotation is around a principle axis. 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-1 = RT •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. Least squares superposition Mxi + v ! yi 2 i " Problem: find the rotation matrix, M, and a vector, v, that minimize the following quantity: Where xi are the coordinates from one molecule and yi are the equivalent* coordinates from another molecule. *equivalent based on alignment Mapping structural equivalence = aligning the sequence 4DFR:A ISLIAALAVDRVIGMENAMPWNLPADLAWFKRNTLDKPVIMGRHTWESIG-RPLPGRKNI 1DFR:_ TAFLWAQNRNGLIGKDGHLPWHLPDDLHYFRAQTVGKIMVVGRRTYESFPKRPLPERTNV 4DFR:A ILSSQ-PGTDDRVTWVKSVDEAIAAC--GDVPEIMVIGGGRVYEQFLPKAQKLYLTHIDA 1DFR:_ VLTHQEDYQAQGAVVVHDVAAVFAYAKQHLDQELVIAGGAQIFTAFKDDVDTLLVTRLAG 4DFR:A EVEGDTHFPDYEPDDWESVFSEFHDADAQNS--HSYCFKILERR 1DFR:_ SFEGDTKMIPLNWDDFTKVSSRTVEDT---NPALTHTYEVWQKK Any position that is aligned is included in the sum of squares. Unaligned positions are not. Least squares At the position of best superposition, we have an approximate equality: First we eliminate v by translating the center of mass of both molecules to the origin.Now we have: We have one equation (i) for each atom, M has 9 unknowns. Mxi + v ! yi Mx' i ! y' i If there are more equations than unknowns, there is a unique solution. What is it? See the next two slides. least-squares superimposed molecules In class exercise: Continue MOE Tour •start MOE (using ‘moe -gfxvisual 0x31’ if using the SGI machines) •Open the MOE Tour web page: Help-->Tutorials-- >Getting Started.. •Go through the following sections at your own pace: •Saving and Loading a Molecule File •Saving a Molecule in a Database •Rendering the Molecule •Selecting Atoms •Moving Selected Atoms •Rotating About a Bond •Introducing the Atom Manager •Measuring Angles and Distances •Measuring Energy Read Cp 6-7 for next time • Structure superposition and classification