|
@@ -243,11 +243,12 @@ def get_bridges(residues):
|
243
|
243
|
bridges = {}
|
244
|
244
|
bridge = {}
|
245
|
245
|
strongest_bridge = {}
|
|
246
|
+ selected_bridges = []
|
246
|
247
|
for i in range(1,len(residues)-4):
|
247
|
248
|
E_min = 0
|
248
|
249
|
for j in range(i+2,len(residues)-1):
|
249
|
250
|
# select triplet with the minimal energy
|
250
|
|
-
|
|
251
|
+
|
251
|
252
|
if(residues[i-1].h_bond(residues[j])<-0.5
|
252
|
253
|
and residues[j].h_bond(residues[i+1])<-0.5):
|
253
|
254
|
bridge = {'res1':residues[i-1].h_bond(residues[j]),
|
|
@@ -292,20 +293,47 @@ def get_bridges(residues):
|
292
|
293
|
if(bridge['res1']+bridge['res2']<E_min):
|
293
|
294
|
E_min = bridge['res1']+bridge['res2']
|
294
|
295
|
strongest_bridge = bridge
|
|
296
|
+ if strongest_bridge not in selected_bridges:
|
|
297
|
+ selected_bridges.append(strongest_bridge)
|
295
|
298
|
coord_bridge = [i,j]
|
296
|
299
|
bridge = {}
|
|
300
|
+
|
297
|
301
|
# finally add the strongest bridge at i and j pos
|
298
|
302
|
if(strongest_bridge):
|
299
|
|
- bridges[strongest_bridge['i']] = (Bridge(strongest_bridge['btype'],
|
300
|
|
- strongest_bridge['ipos'],
|
301
|
|
- strongest_bridge['jpos'],
|
302
|
|
- [strongest_bridge['i'],
|
303
|
|
- strongest_bridge['j']]))
|
304
|
|
- bridges[strongest_bridge['j']] = (Bridge(strongest_bridge['btype'],
|
305
|
|
- strongest_bridge['jpos'],
|
306
|
|
- strongest_bridge['ipos'],
|
307
|
|
- [strongest_bridge['i'],
|
308
|
|
- strongest_bridge['j']]))
|
|
303
|
+ if(len(selected_bridges)>1):
|
|
304
|
+ bridges[strongest_bridge['i']] = (Bridge(strongest_bridge['btype'],
|
|
305
|
+ strongest_bridge['ipos'],
|
|
306
|
+ strongest_bridge['jpos'],
|
|
307
|
+ [strongest_bridge['i'],
|
|
308
|
+ strongest_bridge['j']],
|
|
309
|
+ selected_bridges[-2]['btype'],
|
|
310
|
+ selected_bridges[-2]['ipos'],
|
|
311
|
+ selected_bridges[-2]['jpos'],
|
|
312
|
+ [selected_bridges[-2]['i'],
|
|
313
|
+ selected_bridges[-2]['j']]))
|
|
314
|
+
|
|
315
|
+ bridges[strongest_bridge['j']] = (Bridge(strongest_bridge['btype'],
|
|
316
|
+ strongest_bridge['ipos'],
|
|
317
|
+ strongest_bridge['jpos'],
|
|
318
|
+ [strongest_bridge['i'],
|
|
319
|
+ strongest_bridge['j']],
|
|
320
|
+ selected_bridges[-2]['btype'],
|
|
321
|
+ selected_bridges[-2]['ipos'],
|
|
322
|
+ selected_bridges[-2]['jpos'],
|
|
323
|
+ [selected_bridges[-2]['i'],
|
|
324
|
+ selected_bridges[-2]['j']]))
|
|
325
|
+ else:
|
|
326
|
+ bridges[strongest_bridge['i']] = (Bridge(strongest_bridge['btype'],
|
|
327
|
+ strongest_bridge['ipos'],
|
|
328
|
+ strongest_bridge['jpos'],
|
|
329
|
+ [strongest_bridge['i'],
|
|
330
|
+ strongest_bridge['j']]))
|
|
331
|
+
|
|
332
|
+ bridges[strongest_bridge['j']] = (Bridge(strongest_bridge['btype'],
|
|
333
|
+ strongest_bridge['ipos'],
|
|
334
|
+ strongest_bridge['jpos'],
|
|
335
|
+ [strongest_bridge['i'],
|
|
336
|
+ strongest_bridge['j']]))
|
309
|
337
|
if(len(bridges)>0):
|
310
|
338
|
return(bridges)
|
311
|
339
|
else:
|