{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Solutions Q53 - 61"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# import all python add-ons etc that will be needed later on\n",
"%matplotlib inline\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from sympy import *\n",
"init_printing() # allows printing of SymPy results in typeset maths format\n",
"plt.rcParams.update({'font.size': 16}) # set font size for plots"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Q53 answer\n",
"Normalizing $\\vec n=\\vec b\\times\\vec c=|\\vec b||\\vec c|\\sin(\\alpha)\\vec u_n$ gives\n",
"$\\vec n\\cdot\\vec n = |\\vec b |^2|\\vec c |^2\\sin^2(\\alpha)\\vec u_n\\cdot\\vec u_n$. \n",
"\n",
"The dot product of two equal unit vectors is $\\vec u_n\\cdot\\vec u_n =1$, therefore equation $\\vec u_n\\cdot\\vec u_n=|\\vec b|^2|\\vec c|^2\\sin^2(\\alpha)$ and the unit vectors are not present. A similar equation applies for $m$.\n",
"\n",
"## Q54 answer\n",
"(a) To define the plane $C_1-C_2-C_6$ the vectors can be chosen to be $\\vec d_1$ and $\\vec d_2$, and for the other plane $\\vec d_2$ and $\\vec d_5$, see figure 46. The fact that $\\vec d_5$ does not join the end of $\\vec d_2$ does not matter because it is still in the $C_1-C_2-C_6$ plane and points in the correct direction. Any other vector in this plane would do. Calculating the vectors as coordinates means defining an origin and basis set.\n",
"\n",
"The coordinates of only three atoms need to be found in this particular molecule because, by symmetry, the others follow. Starting with atom $C_2$, this is positioned at $x = -d/2$, because the length of any side is $d$ and it is positioned midway along $C_2-C_6$ in the positive y direction. The $z$ coordinate is zero because the atom is in the $x-y$ plane, as are $C_3, C_5$ and $C_6$. The length $C_2-C_6$ is, by using the cosine rule on triangle $C_2-C_1-C_6$, $\\sqrt{2d^2-2d^2\\cos(\\theta)}=d\\sqrt{8/3}$ because $\\cos(\\theta)=-1/3$. The atom $C_2$ therefore, has half this length as its $y$ coordinates and $C_2 = (-d/2,d\\sqrt{2/3},0)$ and by symmetry\n",
"\n",
"$$\\displaystyle C_6=(-d/2,-d\\sqrt{2/3},0) ;\\quad C_3=(d/2,d\\sqrt{2/3},0),\\quad C_5= (d/2,-d\\sqrt{2/3},0)$$\n",
"\n",
"Some vectors can now be made. Vector $\\vec d_5$ is $C_5 - C_6$ and is $d_5 =d\\;\\boldsymbol i+0;\\boldsymbol j+0\\;\\boldsymbol k$ and $\\vec d_2 =C_2 -C_6 =0\\;\\boldsymbol i+2d 2/3\\;\\boldsymbol j+0\\;\\boldsymbol k$.\n",
"\n",
"Next, calculate the coordinates of atom $C_1$. Let a vector $\\vec p$ be that from $C_6 \\to C_1$ and is written as $p=d(a\\;\\boldsymbol i+b\\;\\boldsymbol j+c\\;\\boldsymbol k)$ where $a, b$ and $c$ have to be found; this definition means that $\\vec p$ points away from $C_6$ and that its coefficients are normalised making $a^2 +b^2 +c^2 =1$. The dot product between $\\vec p$ and $\\vec d_5$ is \n",
"\n",
"$$\\displaystyle \\vec p\\cdot \\vec d_5 = d^2(a\\;\\boldsymbol i+b\\;\\boldsymbol j+c\\;\\boldsymbol k)\\cdot(\\;\\boldsymbol i+0\\;\\boldsymbol j+0\\;\\boldsymbol k) =d ^2\\cos(\\theta)=d^2a=-d^2/3$$\n",
"\n",
"therefore $a = -1/3$ and therefore $b^2 + c^2 = 8/9$.\n",
"\n",
"The dot product with $\\vec d_2$ will allow $c$ to be calculated;\n",
"\n",
"$$\\displaystyle \\vec p\\cdot \\vec d_2 = d^2(-\\boldsymbol i/3+b\\;\\boldsymbol j+c\\;\\boldsymbol k)\\cdot(0\\;\\boldsymbol i+\\sqrt{8/3}\\;\\boldsymbol j+0\\;\\boldsymbol k) = d^2\\sqrt{8/3}\\cos(\\pi/2-\\theta/2)=d^2\\sqrt{8/3}b$$\n",
"\n",
"and as $b = \\cos(\\pi/2-\\theta/2)=\\sqrt{2/3}$ and therefore $c=\\sqrt{2/3}$.\n",
"\n",
"The y coordinate of atom $C_1$ is zero because by symmetry it lies on the $x$-axis. The coordinates of $C_1$ are found using the definition of $\\vec p$ which is $\\vec p = \\vec C_1 -\\vec C_6$ therefore $\\displaystyle C_1=(-5d/6,0,\\sqrt{2/3}d)$.\n",
"\n",
"Vector $\\vec d_1$ should point towards $C_6$ and therefore its components are calculated from $\\vec C_6-\\vec C_1$ making $\\vec d_1=(d/3)\\;\\boldsymbol i-\\sqrt{3/2}d\\;\\boldsymbol j-\\sqrt{2/3}d\\;\\boldsymbol k$ which is the inverse of $\\vec p$.\n",
"\n",
"Now that all the atoms coordinates are known, or inferred by symmetry, the rest of the question can be answered.\n",
"\n",
"(b) The distance between the $C_1$ and $C_4$ atoms is easily calculated since their coordinates are known. The coordinate of $C_4$ in the boat form, has the same $z$ value as $C_1$ in the chair form; $C_{1,boat} = ( -5d/6, 0, \\sqrt{2/3}d )$ but in the chair form $C_4 = -C_1$, therefore $C_{4,chair}=(5d/6,0,-\\sqrt{2/3}d)$, and the $C_1 - C_4$ distance is $7d/3=2.3^\\cdot$. In the boat form, only the $x$ and $y$ values are changed, $C_{4,boat} = (5d/6, 0, 2/3d)$ and the distance $5d/3$."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAANIAAAASCAYAAAAucYD2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy89olMNAAAACXBIWXMAABJ0AAASdAHeZh94AAADtUlEQVR4nO3aW6hVVRTG8Z95iqA7moYlYhcpsoc0ikpIiXqoDCp6CKKCCqLCDATJqNHIROulewQFWhKEIAVaGF3AlKhACYuKJFKj0EKjhyhSOz2sJWw357LPPvssV7E+2CzW2t+3x38+DOZcc89x/f39GjVqNDoddaQBGjX6P6jvSAM0avRfVmZOxa6+lgcTcAOuxQU4HX/jS6zEyoj4ZwQFnsRFmIGJ+BM78TZeiIi9o/FXlakrVzOWarg60GwOX9rdjFdwCT7DM1iLmXgVazJz3AgKPIjj8D6exRs4gMewrezk0firytSVqxlLNVzDaRaHL+2+w/V4p3Xmycwl+Bw34UZFc3WiEyPir/aHmbkMS/AQ7h2Fv6pMXbmasVTDNZxm09JIEfHRQK6I2J2ZL2MZ5uqwkQYCLrVGAX3OaPxVZerK1U2mrlzdZKrigszsw324U7Es3IOX8JRiRvq5082G/eX1QIf+oTS/vG4bI39VmbpydZOpK1c3mZ7WyMxjsB5X4Qs8jwmK5eDZOA3rhm2kshtvK283jADuUH4RjsdJihe9OSXwil74q8rUlasZy5jXeFHRRI/iiYjoL39jFTaWnq2dzEgrFBsO70bEex3427UIk1vuN+COiPi1R/6qMnXl6iZTV65uMmNWIzMvxl1YHxFLW7+LiI8z8xuchy3jhjrZkJkLFLsb3+LyiNg3BNyQyszJuEzRmCfguojY2it/VZm6cjVj6X2NzFyNW3FpRHw6QH6TYjY7Y9BGysz7FevBr3FlROweCqpTZeY0xQ7h9oiY2Wt/VZm6cnWTqStXN5le1sjMPRiPUw8t6dpyP6EvIiYPeEQoMxcqmugrzOtVE0FE7FQ05/mZObHX/qoydeXqJlNXrm4yvaqRmcdiEnYN0kSzMAVbGOCsXWYuxtOKHYp5EfFLJzAj1JTyenCM/FVl6srVTaauXN1kelHjYPmZNIj/4fK6lbazdpn5CB5XdNnVw70TZeZZOBrfR8T+luczsCcifm/zH4WlJdwnEfFbN/6qMnXlasYy9jUiYn9mbse5mTk/Ita1ZBYrDidQzkitZ+1uVzTRQWzCgszUph0Rsarl/kNMw3TsaHl+DZZn5mb8gL2KXZIrcCZ24+5R+KvK1JWrGUs1XMvxGtZm5pulZ67iLOqPmGqAGWl6eR2PhQbWRqwa5LtWfaD4s2oOLsTJ+EPxQrcaz7XNdiP1V5WpK1czlgq4IuL1zDwFD+AW7MNm3IO3sLd8vzLk9nejRo0607/r0Lj/aaeTGAAAAABJRU5ErkJggg==\n",
"text/latex": [
"$\\displaystyle 2.33333333333333 d$"
],
"text/plain": [
"2.33333333333333⋅d"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d = symbols('d', positive = True) # Use sympy make d a real positive value\n",
"C1 = Matrix( [-5*d/6,0 , d*sqrt(2/3)] ) # coordinates 1-6 for chair form.\n",
"C2 = Matrix( [-d/2 , d*sqrt(2/3) , 0] )\n",
"C3 = Matrix( [d/2 , d*sqrt(2/3) , 0] )\n",
"C4 = Matrix( [5*d/6 , 0 , -d*sqrt(2/3)] )\n",
"C5 = Matrix( [d/2 , -d*sqrt(2/3), 0] )\n",
"C6 = Matrix( [-d/2 , -d*sqrt(2/3), 0] )\n",
"C4b= Matrix( [5*d/6 , 0 , d*sqrt(2/3)] ) # C4 boat \n",
"\n",
"C14chair = sqrt((C1-C4).dot(C1-C4))\n",
"C14chair"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAC0AAAAUCAYAAAAZb7T/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy89olMNAAAACXBIWXMAABJ0AAASdAHeZh94AAADNElEQVR4nNXXf6ifcxQH8Ndmzepq+2Nzt6axNlZaUrO00Ii2xF3c+UOkJD8SrbBJKGcnZsgfyiz+EEaS4pIxIXJb5A/D0vyhzHZZu1sXyxZNc/3xfL7r2XO/X+5+mJx6Oj3ncz7nvD/nc348z5jh4WH/Nxr7XwM4Ehr3bxrPzBnYjr6IWHqs7B4COjO/x2kddAcjYtph2j+n8E3Nhcycih1YGxHLiuxRzMccTMFv2IY3sCYihkaALrQHT7SR7z1MwDCv8M/brF2hSs/Xa7I7VQd8H7vQhQVYiVsyc0FEDLQD/UtErDwCgO2oY6TRiyH012QTI+L3pmJmrsJ9uBe3HXVOZ+Y43I4bVdc6iLV4TBXpHREx2NgzERfj5Yg40JK3A1zo1QL6DNqnx4mZeR1OxT5sRn/deM35eKzHInyJJzFZdZ2nYxreauOjB+PR1wFkk5YUvrkT6Gl4sSHbmpk3RMTHDflTBfADeCgihsthnkdLt1Nq7MN77RBm5gqchEmqwrygAH6EkX36OVxSgHfhLDyDmdiQmWfXDJ+Lm7A+Ih5sAYaI6Mc35fWQIszMCbgUG/4mHVYgcEcB/C4WR8RuGpGOiGxs/hq3ZuZeLFdde29ZW1b4qg6OhwpvRnqRKoodU6PVWktbPE8V4S8ysyciNo12Ij5d+MKabHEB9lmHPbOwKyJ+bMiXYj/e/ienETEYEX3F12SsY/RjfHfhXRy84m5sr6dFizJzHqYbmRonqIrqw4jYM0rfImIbtmBuZk4ZLegFhX9X+IHydHfQv7/wZmosVEVstF2jTtNbvg+CzswzM7OrqZmZM7GmvL4EEfEHvsUpmbmkoX+PKgUYOQl78SfebONnTmZOaiMfW4ZLNz6JiJ/rhXg1lmdmv2re/4rZuBwT8A4er+mvxgt4LTNfwU5cpOo4A5ihFunMHIMr8Wlz2BS6DKszcyO2quplKi5U1cdO3MyhOf2RalDMxrW4q2zYiOvRExH7W8oRsU7Vkn7ANUVnAOdjGEMlF1s0vxyk/q1Rpw/wLE5W3dTduAo/ITE3IrbAmOP1E5CZD6u+HWZFxNajsXU8fwJ68dXRAuY4RvpY0l8kHRRh+xS3/QAAAABJRU5ErkJggg==\n",
"text/latex": [
"$\\displaystyle \\frac{5 d}{3}$"
],
"text/plain": [
"5⋅d\n",
"───\n",
" 3 "
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"C14boat = sqrt( (C1 - C4b).dot(C1 - C4b) )\n",
"C14boat"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(c) The $C_1-C_6-C_2$ and $C_2-C_6-C_5$ dihedral angles. Consulting figure 46 and defining the normal vector \\vec n = \\vec d_2 \\times \\vec d_5$, gives\n",
"\n",
"$$\\displaystyle \\vec n =\\begin{vmatrix}\\boldsymbol i&\\boldsymbol j&\\boldsymbol k\\\\0&\\sqrt{8/3}d&0\\\\d&0&0 \\end{vmatrix} = 0\\boldsymbol i +0\\boldsymbol j+\\sqrt{8/3}d^2 \\boldsymbol k$$\n",
"\n",
"making $|\\vec n|=\\sqrt{8/3}d^2$. The other perpendicular vector $\\vec m$ is\n",
"\n",
"$$\\displaystyle \\vec m =\\begin{vmatrix}\\boldsymbol i&\\boldsymbol j&\\boldsymbol k\\\\-d/3 & \\sqrt{2/3}d & \\sqrt{2/3}d\\\\ 0 & \\sqrt{8/3}d & 0 \\end{vmatrix} = \\frac{4d^2}{3}\\boldsymbol i +0\\boldsymbol j-\\frac{1}{3}\\sqrt{\\frac{8}{3}}d^2 \\boldsymbol k$$\n",
"\n",
"In the final dot product, only the $\\boldsymbol k$ vector term is not zero, using $\\displaystyle \\cos(\\psi)=\\frac{\\vec m\\cdot\\vec m}{|\\vec n||\\vec m|}$ we find the dihedral angle $\\psi =112.2^\\text{o}$."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dihedral angle = 112.21\n"
]
}
],
"source": [
"# using sympy with previously defined values.\n",
"d1 = C6 - C1\n",
"d2 = C2 - C6\n",
"d5 = C5 - C6\n",
"m = d1.cross(d2)\n",
"n = d2.cross(d5)\n",
"psi = acos(m.dot(n) /(sqrt(m.dot(m))*sqrt(n.dot(n)) ) )\n",
"print('{:s}{:8.2f}'.format('dihedral angle = ', psi*180/np.pi ))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(d) In calculating the torsion angle between $C_1-C_6-C_2$ and $C_1-C_6-C_5$, the atoms $C_1C_6$ join the two planes involved. The vector $\\vec m$ is therefore $\\vec m=-\\vec d_2 \\times \\vec d_1$ and $\\vec n=\\vec d_1 \\times \\vec d_5$. The calculation is"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dihedral angle = 74.50\n"
]
}
],
"source": [
"m = -d2.cross(d1)\n",
"n = d1.cross(d5)\n",
"psi = acos(m.dot(n) /(sqrt(m.dot(m))*sqrt(n.dot(n)) ) )\n",
"print('{:s}{:8.2f}'.format('dihedral angle = ', psi*180/np.pi ))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(e) The angle between $C_1-C_6-C_2$ and C$_5-C_4-C_3$ in the boat form, requires us to use $C_{4b}$ as defined above. The vector $\\vec d_4$ can be translated to start at $d_2$ without changing the torsion angle."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dihedral angle = 44.42\n"
]
}
],
"source": [
"d4 =C4b - C5\n",
"m = d1.cross(d2)\n",
"n = d2.cross(d4)\n",
"psi = acos(m.dot(n) /(sqrt(m.dot(m))*sqrt(n.dot(n)) ) )\n",
"print('{:s}{:8.2f}'.format('dihedral angle = ', psi*180/np.pi ))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This same result can be obtained more easily from geometry; a side view is show in figure 78.\n",
"\n",
"![Drawing](vectors-fig78.png)\n",
"\n",
"Figure 78. Side view for cyclohexane chair and boat forms.\n",
"\n",
"In this last calculation, if the $C_4$ atom from the chair form was used the calculated dihedral angle would have been $180^\\text{o}$ because the two planes involved are parallel.\n",
"\n",
"## Q55 answer\n",
"The bond N11-C12 lies between the two planes whose torsion (dihedral) angle $\\psi$ is to be calculated. Vectors $\\vec m$ and $\\vec n$ are therefore\n",
"\n",
"$$\\displaystyle \\vec m = \\overrightarrow{(C11-C8)} \\times \\overrightarrow{(C12-N11)},\\quad \\vec n = \\overrightarrow{(C12-N11)} \\times \\overrightarrow{(C13-C12)}$$\n",
"\n",
"so that the vectors point from C8 towards N16. Defining these vectors is the most difficult part as Python can be used to complete the algebra. The script to do this is shown below. A procedure is defined that accepts the atoms as input. Notice that we check that the angle has the correct sign with a function 'sign'. This function returns $+1$ or $-1$ only."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" torsion angle = -81.90\n",
" torsion angle = -78.25\n"
]
}
],
"source": [
"C8 = np.array( [ 120.627 , 4.607 ,38.990 ] )\n",
"N11 = np.array( [ 120.292 , 4.951 , 40.228 ] ) \n",
"C12 = np.array( [ 118.955 , 4.753 , 40.750 ] ) \n",
"C13 = np.array( [ 117.996 , 5.868 , 40.333 ] ) \n",
"N16 = np.array( [ 118.093 , 7.008 , 41.010 ] )\n",
"\n",
"#this procedure accepts atom vectors as input\n",
"\n",
"def torsion_angle(a1, a2, a3, a4):\n",
" A = a2 - a1\n",
" B = a3 - a2\n",
" C = a4 - a3\n",
" m = np.cross(A, B)\n",
" n = np.cross(B, C)\n",
" cos_angle = np.dot(m, n)/(np.sqrt( np.dot(n, n) )*np.sqrt( np.dot(m, m) ) )\n",
" angle = np.sign(np.dot(n,A))*np.arccos(cos_angle)*180/np.pi\n",
" return angle\n",
"\n",
"phi = torsion_angle(C8, N11, C12, C13)\n",
"print('{:s}{:8.2f}'.format(' torsion angle =', phi) )\n",
"phi=torsion_angle(N11,C12,C13,N16)\n",
"print('{:s}{:8.2f}'.format(' torsion angle =', phi) )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Consulting a Ramachandran plot, such as figure 38, suggests that this small part of the structure belongs to an $\\alpha$ -helix.\n",
"\n",
"## Q56 answer\n",
"The Python code to read the pdb is shown below. The order of atoms is always N-CA-C-O followed by the atoms in the residue. These atoms have indices 0,1,2,3 in the lists resA, resB, resC below. The next residue has the same pattern and so on. Three sequential residues are identified and read in in one pass of the data. Residue 35 is needed for part (b). The results are stored and then the torsion angle calculated. There are two chains in this protein so it is necessary to identify which one is to be used. The residue number to is are given in the question. "
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"torsion angle = -14.605\n"
]
}
],
"source": [
"# Algorithm. Torsion angle\n",
"\n",
"dataname='1TIM.pdb'\n",
"\n",
"numA = 36 # residue 36\n",
"numB = numA + 1 # residue B \n",
"numC = numA - 1\n",
"chain= 'B' # which chain ? \n",
"\n",
"resA = np.zeros((14,3),dtype=float) # as largest residiue trp has 14 atoms, 3 for x,y,z\n",
"resB = np.zeros((14,3),dtype=float)\n",
"resC = np.zeros((14,3),dtype=float)\n",
"with open(dataname) as f:\n",
" kA = 0 # counter for index in list resA etc.\n",
" kB = 0\n",
" kC = 0\n",
" for line in f:\n",
" new_str=' '.join(line.split()) \n",
" vals = new_str.split(' ')\n",
" if vals[0] == 'ATOM':\n",
" if vals[5] == str(numA) and vals[4] == chain:\n",
" resA[kA][:] = [vals[6],vals[7],vals[8]]\n",
" kA = kA + 1\n",
" if vals[5] == str(numB) and vals[4] == chain:\n",
" resB[kB][:] = [vals[6],vals[7],vals[8]]\n",
" kB = kB + 1\n",
" if vals[5] == str(numC) and vals[4] == chain:\n",
" resC[kC][:] = [vals[6],vals[7],vals[8]]\n",
" kC = kC + 1\n",
"f.close()\n",
"\n",
"print('{:s}{:6.3f}'.format('torsion angle = ',torsion_angle(resA[0],resA[1],resA[2],resB[0]) ) )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(b) The $\\phi$ angles are those between the N and the next adjacent C$_\\alpha$ atom; the sequence of atoms is C-N-C$_\\alpha$ - C. In figure 48, the first $\\phi$ angle is between N36 and CA36 but the list starts at C35. We use the values already read into the arrays."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"torsion angle = -85.957\n"
]
}
],
"source": [
"print('{:s}{:6.3f}'.format('torsion angle = ',torsion_angle(resC[2],resA[0],resA[1],resA[2]) ) )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Q57 answer\n",
"The torsion angle $v_2$ should be C$_3'$ endo for A-type DNA, and therefore have an angle from $0 \\to 90^\\text{o}$. We can use the torsion_angle(...) code above"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"torsion angle = 42.742\n"
]
}
],
"source": [
"C1 = np.array( [ 8.500 , 0.483 , -4.443 ] )\n",
"C2 = np.array( [ 8.902 , -0.134, -5.779 ] )\n",
"C3 = np.array( [ 8.751 , 1.078 , -6.697 ] )\n",
"C4 = np.array( [ 9.378 , 2.172 , -5.835 ] )\n",
"C5 = np.array( [ 8.989 , 3.594 , -6.187 ] )\n",
"O4 = np.array( [ 8.917 , 1.839 , -4.493 ] )\n",
"print('{:s}{:6.3f}'.format('torsion angle = ',torsion_angle(C1,C2,C3,C4) ) )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"which confirms the A type DNA. Extra confirmation would be that the angle $\\gamma$ is between approximately $30$\n",
"and $90^\\text{o}$.\n",
"\n",
"(b) As a check on the conformation, the C$_3'$ atom should be above the $\\mathrm{C_4'-O_4'-C_1'}$ plane and on the same side as the C$_5'$ atom with the C$_2'$ below it. The plane is defined by the vector $\\vec n$ normal to it. This is the cross product of the $\\vec{O_4-C_5}$ vector and the $\\vec{O_4-C_1}$ vector (see equation 44) and gives the equation of the plane. If $T$ is at some particular point in the plane, with position vector $\\vec T$ , the distance to a point $p$ with position vector $\\vec p$, is given by equation 45 which is $\\displaystyle d=\\frac{\\vec n\\cdot(\\vec p - \\vec T)}{\\sqrt{\\vec n \\cdot \\vec n}}$. The Python code is shown below;"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"n =np.cross( (C4-O4) , (C1-O4) )"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"to C3 d = 0.495\n",
"to C2 d = -0.209\n",
"to C5 d = 0.842\n"
]
}
],
"source": [
"T = O4\n",
"p = C3\n",
"d = np.dot(n,p-T)/np.sqrt( np.dot(n,n) )\n",
"print('{:s}{:6.3f}'.format('to C3 d = ',d ) )\n",
"d = np.dot(n,C2-T)/np.sqrt(np.dot(n,n) )\n",
"print('{:s}{:6.3f}'.format('to C2 d = ',d ) )\n",
"d = np.dot(n,C5-T)/np.sqrt(np.dot(n,n) )\n",
"print('{:s}{:6.3f}'.format('to C5 d = ',d ) )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Because the distance to C$_5'$ has the same sign as that to C$_3'$, these atoms must be on the same side of the sugar ring, making C$_3'$ _endo_ and C$_2'$ _exo_ because it has the opposite sign. The configuration has therefore been determined independently, without having to know what the range of torsion angles is supposed to be for a particular configuration.\n",
"\n",
"## Q58 answer\n",
"(a) The base shown is guanine which is a purine base. (b) Using the torsion_angle(...) code developed earlier, the calculation becomes very easy. All that is necessary is to put the coordinates into vector form."
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"gamma = 48.314\n",
"v2 = -25.033\n",
"chi = -124.566\n"
]
}
],
"source": [
"O5 = np.array( [ 3.903 , 9.424 , 56.660 ] ) \n",
"C5 = np.array( [ 3.829 , 10.592 , 57.472 ] )\n",
"C4 = np.array( [ 2.610 , 11.430 , 57.099 ] ) \n",
"C3 = np.array( [ 1.382 , 10.524 , 57.025 ] ) \n",
"C2 = np.array( [ 1.034 , 10.517 , 55.563 ] ) \n",
"C1 = np.array( [ 1.598 , 11.813 , 55.022 ] ) \n",
"O4 = np.array( [ 2.772 , 12.046 , 55.805 ] )\n",
"N9 = np.array( [ 1.981 , 11.653 , 53.605 ] ) \n",
"C4B= np.array( [ 1.493 , 12.380 , 52.547 ] )\n",
"print('{:s}{:6.3f}'.format('gamma = ',torsion_angle(O5,C5,C4,C3) ) )\n",
"print('{:s}{:6.3f}'.format('v2 = ',torsion_angle(C1,C2,C3,C4) ) )\n",
"print('{:s}{:6.3f}'.format('chi = ',torsion_angle(O4,C1,N9,C4B)) )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The DNA should be B type because the ring pucker is negative, indicating C$_2'$ _endo_ configuration. This can be confirmed by calculating the distance above and below the ring as in the previous example. The $\\chi$ torsion angle is large and negative indicating anti configuration.\n",
"\n",
"**Exercise:** Write a procedure to do a calculation to determine the DNA type given only the coordinate vectors. Calculate the $\\gamma, chi$ and $v_2$ angles and the absolute configuration, by calculating the distance of the C$_2'$ and C$_3'$ atoms above the $\\mathrm{C_4'-O_4'-C_1'}$ plane. Print out a statement of the DNA type as well as C$_3'$ exo, or endo etc and the angles and distances. Test your algorithm on the PDB entry 1AAY and on other DNA structures in the database.\n",
"\n",
"## Q59 answer\n",
"Using the definitions given in the question, the result is \n",
"\n",
"$$\\displaystyle \\frac{d\\vec L}{dt}=m\\vec r\\times \\frac{d^2\\vec r}{dt^2}+\\frac{d\\vec r}{dt}\\times \\frac{d\\vec r}{dt}$$\n",
"\n",
"However, the cross product of a vector with itself is zero, hence \n",
"\n",
"$$\\displaystyle \\frac{d\\vec L}{dt}=m\\vec r\\times \\frac{d^2\\vec r}{dt^2}$$\n",
"\n",
"## Q60 answer\n",
"The expansion of the triple product (see Section 17) gives $\\displaystyle \\vec a=\\vec\\omega \\times(\\vec\\omega \\times \\vec r)=(\\vec\\omega\\cdot \\vec r)\\vec\\omega-(\\vec\\omega\\cdot \\vec\\omega)\\vec r$\n",
"\n",
"Since $\\vec r$ and $\\vec\\omega$ are perpendicular, their dot product is zero, hence $\\vec a = -(\\vec\\omega\\cdot \\vec\\omega)\\vec r$ and the magnitude of $a$ is $|\\vec a| = a -\\omega^2r = -v^2/r$. As the sign is negative this centripetal acceleration is towards the centre of the orbit.\n",
"\n",
"## Q61 answer\n",
"There is no $k$ component, as motion is only in the $x-y$ or $i-j$ plane. The angular velocity, by definition, is perpendicular to this plane, and has a component only in the $z$ or $\\vec k$ direction where $\\vec\\omega = \\alpha\\vec \\omega k$ or $|\\vec \\omega |=\\alpha$.\n",
"\n",
"The cross product of $\\vec \\omega$ and $\\vec r$ is\n",
"\n",
"$$\\displaystyle \\qquad\\qquad\\begin{align} \\vec\\omega \\times\\vec r =& a \\vec k \\times\\big( r\\cos(\\alpha t)\\boldsymbol i+r\\sin(\\alpha t)\\big)\\boldsymbol j\\\\=& ar \\cos(\\alpha t)\\boldsymbol k\\times\\boldsymbol i+ar\\sin(\\alpha t)\\boldsymbol k\\times \\boldsymbol j\\\\=& ar \\cos(\\alpha)\\boldsymbol j-ar\\sin(\\alpha t)\\boldsymbol i\\\\ \\end{align}\\qquad\\qquad\\qquad\\qquad\\text{(A)}$$\n",
"\n",
"where in the last step we use the anti-commutative rule $\\boldsymbol k\\times \\boldsymbol j=-\\boldsymbol j\\times k =-\\boldsymbol i$.\n",
"\n",
"Velocity is the time derivative of position, and the linear velocity at any time $t$ is \n",
"\n",
"$$\\displaystyle \\frac{d}{dt}\\vec r(t)=\\vec v(t)=-\\alpha r\\sin(\\alpha t)\\boldsymbol i+\\alpha r\\cos(\\alpha t)\\boldsymbol j \\tag{B}$$\n",
"\n",
"As the cross product, equation A, is the same as the velocity, equation B, we conclude that linear velocity is the cross product of angular velocity and radius vector or $\\vec v=\\vec \\omega \\times \\vec r$."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}