|
@@ -19,30 +19,40 @@ def get_turns(residues):
|
19
|
19
|
for i,res in enumerate(residues):
|
20
|
20
|
for j in range(3,6):
|
21
|
21
|
if(i+j<len(residues)):
|
22
|
|
- if(res.h_bond(residues[i+j])):
|
|
22
|
+ if(res.h_bond(residues[i+j]<-0.5)):
|
23
|
23
|
turns.append(Turn(j))
|
24
|
24
|
return(turns)
|
25
|
25
|
|
26
|
26
|
def get_bridges(residues):
|
27
|
|
- # TODO : non-overlaping check to add
|
28
|
27
|
bridges = []
|
29
|
|
- for i,res in enumerate(residues):
|
30
|
|
- for j, res in enumerate(residues):
|
31
|
|
- if(i-1>=0 and i+1<len(residues)
|
32
|
|
- and j-1>=0 and j+1<len(residues)):
|
33
|
|
- if((residues[i-1].h_bond(residues[j])
|
34
|
|
- and residues[j].h_bond(residues[i+1]))
|
35
|
|
- or(residues[j-1].h_bond(residues[i])
|
36
|
|
- and residues[i].h_bond(residues[j+1]))):
|
37
|
|
- bridges.append(Bridge("para"))
|
|
28
|
+ for i in range(1,len(residues)-4):
|
|
29
|
+ E_min = 0
|
|
30
|
+ for j in range(i+2,len(residues)-1):
|
|
31
|
+ # select triplet with the minimal energy
|
|
32
|
+
|
|
33
|
+ if(residues[i-1].h_bond(residues[j])<-0.5
|
|
34
|
+ and residues[j].h_bond(residues[i+1])<-0.5):
|
|
35
|
+ if(residues[i-1].h_bond(residues[j])+
|
|
36
|
+ residues[j].h_bond(residues[i+1]))<E_min:
|
|
37
|
+ E_min = residues[i-1].h_bond(residues[j])
|
|
38
|
+ +residues[j].h_bond(residues[i+1])
|
|
39
|
+
|
|
40
|
+ if(residues[j-1].h_bond(residues[i])<-0.5
|
|
41
|
+ and residues[i].h_bond(residues[j+1])<-0.5):
|
|
42
|
+ if(residues[j-1].h_bond(residues[i])+
|
|
43
|
+ residues[i].h_bond(residues[j+1]))<E_min:
|
|
44
|
+ E_min = residues[j-1].h_bond(residues[i])
|
|
45
|
+ +residues[i].h_bond(residues[j+1])
|
|
46
|
+ #bridges.append(Bridge("para"))
|
38
|
47
|
|
39
|
|
- if(i-1>=0 and i+1<len(residues)
|
40
|
|
- and j-1>=0 and j+1<len(residues)):
|
41
|
|
- if((residues[i].h_bond(residues[j])
|
42
|
|
- and residues[j].h_bond(residues[i]))
|
43
|
|
- or(residues[i-1].h_bond(residues[j+1])
|
44
|
|
- and residues[j-1].h_bond(residues[i+1]))):
|
45
|
|
- bridges.append(Bridge("anti"))
|
|
48
|
+
|
|
49
|
+ if((residues[i].h_bond(residues[j])<-0.5
|
|
50
|
+ and residues[j].h_bond(residues[i])<-0.5)
|
|
51
|
+ or(residues[i-1].h_bond(residues[j+1])<-0.5
|
|
52
|
+ and residues[j-1].h_bond(residues[i+1])<-0.5)):
|
|
53
|
+
|
|
54
|
+ #bridges.append(Bridge("anti"))
|
|
55
|
+ #bridges.append(strongest_bridge)
|
46
|
56
|
return(bridges)
|
47
|
57
|
|
48
|
58
|
def get_helix(turns):
|