Python Programming for Biology: Bioinformatics and Beyond



Download 7,75 Mb.
Pdf ko'rish
bet123/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   119   120   121   122   123   124   125   126   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

Torsion angle

The following example combines use of both the math module and NumPy. The objective

is to make a function that is able to calculate what is known as a  torsion  angle.

12

 While



the standard kind of angle involves three points, which we can imagine as a ‘V’ with the

angle being the amount of turn between the two ends about the connecting point, a torsion

angle is defined by four points. You can imagine these four points as forming a ‘Z’ shape

made  of  three  lines,  where  the  torsion  angle  is  the  twist  between  the  first  and  last  lines.

Our illustration of a ‘Z’ on a flat page is a torsion angle of 180°, but if one of the end lines



came directly out of the page then the torsion angle would be 90°.

Measuring torsion angles will be helpful in later chapters where the four defining points

are  atoms  of  a  molecule  and  the  lines  connecting  them  are  chemical  bonds.  For  protein

molecules especially, the torsion angles of atoms along the backbone provide quite a bit of

useful  information.  In  this  context  the  torsion  angle  is  defined  to  be  the  angle  between

chemical  bonds  and  we  can  define  these  bond  vectors  as  the  difference  vectors  between

atom positions: what we have to add to one atom position to get to the other. The central

chemical  bond  (the  middle  line  of  ‘Z’)  is  the  axis  about  which  the  rotation  between  the

other bonds is measured.

We  now  provide  the  function  that  calculates  the  torsion  angle.  Firstly,  we  import  the

required  NumPy  and  mathematical  functions.  Notice  that  we  have  not  used  the  NumPy

cross() function before; this calculates the cross-product between two vectors, which was

mentioned briefly in the context of rotations. If you imagine two directional lines in three-

dimensional space, emanating from the same point, the cross-product will be a new line at

right angles to both the other lines.

13

from numpy import cross, dot, array



from math import sqrt, acos

A  function  is  defined  which  takes  a  list  of  four  coordinate  positions  to  calculate  the

torsion  angle  between  them.  Here  the  order  of  the  input  coordinates  is  critical;  we  will

measure  the  twist  about  the  axis  defined  by  the  central  two  coordinates  (coord2  and

coord3). We will not describe the mathematics behind the calculations in great detail, but

we will describe the basic operation performed at each step.




Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   119   120   121   122   123   124   125   126   ...   514




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish