|
@@ -34,7 +34,7 @@ def get_turns(residues):
|
34
|
34
|
if(i+j<len(residues)):
|
35
|
35
|
if(res.h_bond(residues[i+j])<-0.5):
|
36
|
36
|
print(j,"TURN", residues[i].resid, residues[i+j].resid)
|
37
|
|
- turns[residues[i].resid] = Turn(j,residues[i].resid)
|
|
37
|
+ turns[i] = Turn(j,residues[i].resid)
|
38
|
38
|
return(turns)
|
39
|
39
|
|
40
|
40
|
def get_bridges(residues):
|
|
@@ -53,11 +53,6 @@ def get_bridges(residues):
|
53
|
53
|
'ipos':residues[i].resid,
|
54
|
54
|
'jpos':residues[j].resid,
|
55
|
55
|
'btype':"para"}
|
56
|
|
- # if(residues[i-1].h_bond(residues[j])+
|
57
|
|
- # residues[j].h_bond(residues[i+1]))<E_min:
|
58
|
|
- # E_min = residues[i-1].h_bond(residues[j])
|
59
|
|
- # +residues[j].h_bond(residues[i+1])
|
60
|
|
- # bridge_type = "para"
|
61
|
56
|
|
62
|
57
|
if(residues[j-1].h_bond(residues[i])<-0.5
|
63
|
58
|
and residues[i].h_bond(residues[j+1])<-0.5):
|
|
@@ -66,11 +61,6 @@ def get_bridges(residues):
|
66
|
61
|
'ipos':residues[i].resid,
|
67
|
62
|
'jpos':residues[j].resid,
|
68
|
63
|
'btype':"para"}
|
69
|
|
- # if(residues[j-1].h_bond(residues[i])+
|
70
|
|
- # residues[i].h_bond(residues[j+1]))<E_min:
|
71
|
|
- # E_min = residues[j-1].h_bond(residues[i])
|
72
|
|
- # +residues[i].h_bond(residues[j+1])
|
73
|
|
- # bridge_type = "para"
|
74
|
64
|
|
75
|
65
|
if(residues[i].h_bond(residues[j])<-0.5
|
76
|
66
|
and residues[j].h_bond(residues[i])<-0.5):
|
|
@@ -79,11 +69,6 @@ def get_bridges(residues):
|
79
|
69
|
'ipos':residues[i].resid,
|
80
|
70
|
'jpos':residues[j].resid,
|
81
|
71
|
'btype':"anti"}
|
82
|
|
- # if(residues[i].h_bond(residues[j])+
|
83
|
|
- # residues[j].h_bond(residues[i]))<E_min:
|
84
|
|
- # E_min = residues[i].h_bond(residues[j])
|
85
|
|
- # +residues[j].h_bond(residues[i])
|
86
|
|
- # bridge_type = "anti"
|
87
|
72
|
|
88
|
73
|
if(residues[i-1].h_bond(residues[j+1])<-0.5
|
89
|
74
|
and residues[j-1].h_bond(residues[i+1])<-0.5):
|
|
@@ -92,11 +77,7 @@ def get_bridges(residues):
|
92
|
77
|
'ipos':residues[i].resid,
|
93
|
78
|
'jpos':residues[j].resid,
|
94
|
79
|
'btype':"anti"}
|
95
|
|
- # if(residues[i-1].h_bond(residues[j+1])+
|
96
|
|
- # residues[j-1].h_bond(residues[i+1]))<E_min:
|
97
|
|
- # E_min = residues[i-1].h_bond(residues[j+1])
|
98
|
|
- # +residues[j-1].h_bond(residues[i+1])
|
99
|
|
- # bridge_type = "anti"
|
|
80
|
+
|
100
|
81
|
if(bridge):
|
101
|
82
|
if(bridge['res1']+bridge['res2']<E_min):
|
102
|
83
|
E_min = bridge['res1']+bridge['res2']
|
|
@@ -107,14 +88,51 @@ def get_bridges(residues):
|
107
|
88
|
bridges[strongest_bridge['ipos']] = (Bridge(strongest_bridge['btype'],
|
108
|
89
|
strongest_bridge['ipos'],
|
109
|
90
|
strongest_bridge['jpos']))
|
110
|
|
- bridges[strongest_bridge['jpos']] = (Bridge(strongest_bridge['btype'],
|
111
|
|
- strongest_bridge['jpos'],
|
112
|
|
- strongest_bridge['ipos']))
|
|
91
|
+ # bridges[strongest_bridge['jpos']] = (Bridge(strongest_bridge['btype'],
|
|
92
|
+ # strongest_bridge['jpos'],
|
|
93
|
+ # strongest_bridge['ipos']))
|
113
|
94
|
if(len(bridges)>0):
|
114
|
95
|
return(bridges)
|
115
|
96
|
else:
|
116
|
97
|
return(False)
|
117
|
98
|
|
|
99
|
+# def get_bonds(residues):
|
|
100
|
+# for i,res1 in enumerate(residues):
|
|
101
|
+# E_min = 0
|
|
102
|
+# strongest_bridge = []
|
|
103
|
+# for j in range(-5,6):
|
|
104
|
+# if(i+j < len(residues)):
|
|
105
|
+# res2 = residues[i+j]
|
|
106
|
+# if(res1.h_bond(res2)<-0.5) and (res1.h_bond(res2)<E_min):
|
|
107
|
+# E_min = res1.h_bond(res2)
|
|
108
|
+# strongest_bridge = [res1, res2]
|
|
109
|
+# if(len(strongest_bridge)>0):
|
|
110
|
+# diff = strongest_bridge[0].resid - strongest_bridge[1].resid
|
|
111
|
+# if( abs (diff) > 1 and abs(diff)<=5):
|
|
112
|
+# print(diff)
|
|
113
|
+
|
|
114
|
+def get_bonds(residues):
|
|
115
|
+ bonds = {}
|
|
116
|
+ k = 0
|
|
117
|
+ for i,res in enumerate(residues):
|
|
118
|
+ E_min = 0
|
|
119
|
+ for j in range(-5,-2):
|
|
120
|
+ if(i+j<len(residues)):
|
|
121
|
+ if(residues[i+j].h_bond(res)<-0.5):
|
|
122
|
+ k+=1
|
|
123
|
+ #if(res.h_bond(residues[i+j])<E_min):
|
|
124
|
+ E_min = res.h_bond(residues[i+j])
|
|
125
|
+ res_a = res
|
|
126
|
+ res_b = residues[i+j]
|
|
127
|
+ if j not in bonds:
|
|
128
|
+ bonds[j] = []
|
|
129
|
+ bonds[j].append([res_a.resid, res_b.resid])
|
|
130
|
+ #turns[residues[i].resid] = Turn(j,residues[i].resid)
|
|
131
|
+ for key in bonds.keys():
|
|
132
|
+ print(key, len(bonds[key]))
|
|
133
|
+
|
|
134
|
+ print("LH",k)
|
|
135
|
+
|
118
|
136
|
def get_helix(residues, turns):
|
119
|
137
|
i = 1
|
120
|
138
|
helix = []
|