|
@@ -144,8 +144,10 @@ def get_helix(residues, turns):
|
144
|
144
|
while(i+k in turns):
|
145
|
145
|
k+=1
|
146
|
146
|
temp_res.append(residues[i])
|
|
147
|
+ last_res_pos = residues[i].resid+k
|
147
|
148
|
if(k>=1):
|
148
|
|
- print(k,"- HELIX at", residues[i].resid)
|
|
149
|
+ helix_size=last_res_pos - residues[i].resid
|
|
150
|
+ print(turns[i].turn_type,"- HELIX at", residues[i].resid)
|
149
|
151
|
helix.append(Helix(temp_res,residues[i].resid))
|
150
|
152
|
i = i+k
|
151
|
153
|
else:
|
|
@@ -167,8 +169,8 @@ def get_ladders(bridges, residues):
|
167
|
169
|
ladders[i] = k-1
|
168
|
170
|
print("ladder", bridges[i].res_num, bridges[i+k-1].res_num)
|
169
|
171
|
ladders[i] = {'start':bridges[i].res_num,
|
170
|
|
- 'end':bridges[i+k-1].res_num,
|
171
|
|
- 'bridges':temp_bridges}
|
|
172
|
+ 'end':bridges[i+k-1].res_num,
|
|
173
|
+ 'bridges':temp_bridges}
|
172
|
174
|
i+=k-1
|
173
|
175
|
else:
|
174
|
176
|
i+=1
|
|
@@ -201,10 +203,10 @@ def res_list(ladder):
|
201
|
203
|
def get_bends(residues):
|
202
|
204
|
bends = {}
|
203
|
205
|
for i in range(2,len(residues)-2):
|
204
|
|
- angle = vector_angles(vectors_substr(position_vector(residues[i].atoms["CA"].coords),
|
205
|
|
- position_vector(residues[i-2].atoms["CA"].coords)),
|
206
|
|
- vectors_substr(position_vector(residues[i+2].atoms["CA"].coords),
|
207
|
|
- position_vector(residues[i].atoms["CA"].coords)))
|
|
206
|
+ angle = math.degrees(vector_angles(vectors_substr(position_vector(residues[i].atoms["CA"].coords),
|
|
207
|
+ position_vector(residues[i-2].atoms["CA"].coords)),
|
|
208
|
+ vectors_substr(position_vector(residues[i+2].atoms["CA"].coords),
|
|
209
|
+ position_vector(residues[i].atoms["CA"].coords))))
|
208
|
210
|
if(angle>70):
|
209
|
211
|
print("angle", residues[i].resid, angle)
|
210
|
212
|
bends[residues[i].resid] = angle
|
|
@@ -240,8 +242,7 @@ def vector_angles(v1,v2):
|
240
|
242
|
norm_v2 = vector_norm(v2)
|
241
|
243
|
term = dot_prod/(abs(norm_v1)*abs(norm_v2))
|
242
|
244
|
rad_angle = math.acos(term)
|
243
|
|
- deg_angle = rad_angle*(180/math.pi)
|
244
|
|
- return deg_angle
|
|
245
|
+ return rad_angle
|
245
|
246
|
|
246
|
247
|
def calc_dihedral(u1, u2, u3, u4):
|
247
|
248
|
""" Calculate dihedral angle method. From bioPython.PDB
|
|
@@ -299,3 +300,30 @@ def get_chirality(residues):
|
299
|
300
|
|
300
|
301
|
return chirality
|
301
|
302
|
|
|
303
|
+
|
|
304
|
+def get_phi_psi(residues):
|
|
305
|
+ for i in range(len(residues)):
|
|
306
|
+ if(i==0):
|
|
307
|
+ phi = 360.0
|
|
308
|
+ else:
|
|
309
|
+ phi = calc_dihedral(residues[i-1].atoms["C"].coords,
|
|
310
|
+ residues[i].atoms["N"].coords,
|
|
311
|
+ residues[i].atoms["CA"].coords,
|
|
312
|
+ residues[i].atoms["C"].coords)
|
|
313
|
+ if(i==len(residues)-1):
|
|
314
|
+ psi = 360.0
|
|
315
|
+ else:
|
|
316
|
+ psi = calc_dihedral(residues[i].atoms["N"].coords,
|
|
317
|
+ residues[i].atoms["CA"].coords,
|
|
318
|
+ residues[i].atoms["C"].coords,
|
|
319
|
+ residues[i+1].atoms["N"].coords)
|
|
320
|
+
|
|
321
|
+ print("ANGLES", i, phi, psi)
|
|
322
|
+
|
|
323
|
+def get_TCO(res1, res2):
|
|
324
|
+ CO_res1 = vector_from_pos(res1.atoms["C"].coords,
|
|
325
|
+ res1.atoms["O"].coords)
|
|
326
|
+ CO_res2 = vector_from_pos(res2.atoms["C"].coords,
|
|
327
|
+ res2.atoms["O"].coords)
|
|
328
|
+ angle = vector_angles(CO_res1, CO_res2)
|
|
329
|
+ return(math.cos(angle))
|