<< Chapter < Page | Chapter >> Page > |
Now it is time to actually rotate dihedral bonds. Recall from our discussion of Forward Kinematics that one can define the transformation matrix/matrices to account for a dihedral rotation, depending on the representation method you choose (global or local coordinates, as discussed below). If you need to compute values such as bond lengths and bond angles, You can compute the bond length between two atoms as the Euclidean distance between them. You can also compute the angle between two bonds, the bond angle, as the the angle between two normalized vectors, which amounts to taking the dot product of the normalized vectors. If you need to identify one atom as your anchor atom, with the default backbone orientation, your anchor atom is the N of the very first aminoacid (the very first atom of the chain).
Now we will put our knowledge into practice. You will manipulate the structure in the pdb file backbone_native.pdb , which is the backbone of the 1COA structure of CI2. You may want to save this pdb file for later visualization in VMD.
Even though you are welcome yo use any programming language to perform
rotations, here we provide you with a setup for Matlab. Matlab offers a lotof matrix
operations that you would otherwise have to implement yourself in languageslike C/C++, for example. We provide some hints/directions for those ofyou who choose to implement this assignment in Matlab. The very first step
you need to do is to read from an ASCII file that contains the cartesiancoordinates of the chain you will manipulate and save these coordinates in a
data structure that will represent your chain. The simplest data structure atthis point is an array, where positions 3*(i-1)+1, 3*(i-1)+2, and 3*(i-1)+3
contain the coordinates of atom i. Note that Matlab starts counting from 1.Take a look at the backbone_native.pdb file. Find out what the number of atoms is.
You can read the cartesian coordinates from the
backbone_native.crd file (note that this .crd file does NOT have a dummy line at the beginning to read it easily with Matlab). You can do
so with the command:
cartesian_coordinates =
textread(input_file, '%f');
where you have set the input file to
where you have stored backbone_native.crd as in forexample
input_file = '/home/user_name/rest_of_the_path/backbone_native.crd' ;
. You can check how
many coordinates you have read with the command
length(cartesian_coordinates)
.
The
textread
command stores all coordinates
read from the backbone.crd file in the
cartesian_coordinates
array. You could manipulate this array with the
dihedral rotations you will define. However, it might be more convenient formatrix operations and for clarity to store the cartesian coordinates in a
matrix with N rows and 3 colums for each row. In this way, row i contains allthe three cartesian coordinates for atom i. Define the number of atoms in the
backbone with the command
N is
length(cartesian_coordinates)/3;
. Now you need to declare a matrix
with the right dimensions. Since you actually need to work with homogeneouscoordinates, it might be convenient to declare a matrix with N rows and 4
columns, where the last column contains 1.You can do so with the command
backbone_chain = zeros (N, 4);
which creates a matrix with N rows and 4 columns initialized to all
zeros. You can set the fourth column to 1 with the command
backbone_chain(:, 4) = 1;
Now you need to place the cartesian coordinates from the array to
this matrix. You can do so with the for loop below:
for i = 1:N
for j = 1:3backbone_chain(i,j) = cartesian_coordinates((i-1) * 3 + j);
end;end;
Notification Switch
Would you like to follow the 'Geometric methods in structural computational biology' conversation and receive update notifications?