introvoyz041 commited on
Commit
ef28eb2
·
verified ·
1 Parent(s): 314ba34

Migrated from GitHub

Browse files
Files changed (46) hide show
  1. .gitattributes +6 -0
  2. data/LICENSE +21 -0
  3. data/benchmark/__init__.py +1 -0
  4. data/benchmark/config.py +1036 -0
  5. data/benchmark/get_cath.py +1029 -0
  6. data/benchmark/version.py +1 -0
  7. data/benchmark/visualization.py +1101 -0
  8. data/dataset_visualization/crystal_structure_set.pdf +0 -0
  9. data/dataset_visualization/crystal_structure_set.txt +595 -0
  10. data/dataset_visualization/dataset_visualization.py +94 -0
  11. data/dataset_visualization/nmr_benchmark.txt +189 -0
  12. data/dataset_visualization/nmr_set.pdf +3 -0
  13. data/dataset_visualization/trainingset_pisces_expanded.pdf +0 -0
  14. data/examples/Comparison_summary.pdf +0 -0
  15. data/examples/ProDcoNN.csv +3 -0
  16. data/examples/ProDcoNN.csv.pdf +0 -0
  17. data/examples/ProDcoNN.txt +615 -0
  18. data/examples/Rosetta.csv +3 -0
  19. data/examples/Rosetta.csv.pdf +0 -0
  20. data/examples/Rosetta.txt +600 -0
  21. data/examples/TIMED.csv +3 -0
  22. data/examples/TIMED.csv.pdf +0 -0
  23. data/examples/TIMED.txt +615 -0
  24. data/examples/TIMED_1a41.pdb +0 -0
  25. data/examples/denseCPD.csv +3 -0
  26. data/examples/denseCPD.csv.pdf +0 -0
  27. data/examples/denseCPD.txt +609 -0
  28. data/examples/evoEF2.csv +3 -0
  29. data/examples/evoEF2.csv.pdf +0 -0
  30. data/examples/evoEF2.txt +609 -0
  31. data/requirements.txt +10 -0
  32. data/run_benchmark.py +218 -0
  33. data/run_predictions/make_empty_backbone_set.py +124 -0
  34. data/run_predictions/run_EvoEF2/evo.sh +16 -0
  35. data/run_predictions/run_EvoEF2/evoef2_dataset.py +177 -0
  36. data/run_predictions/run_EvoEF2/run_evoef2.py +81 -0
  37. data/run_predictions/run_Rosetta/fixbb.py +217 -0
  38. data/run_predictions/run_Rosetta/run_fixbb.py +73 -0
  39. data/run_predictions/run_proteinsolver.ipynb +201 -0
  40. data/setup.py +12 -0
  41. data/test/__init__.py +0 -0
  42. data/test/run_test.py +63 -0
  43. data/test/test_data.csv +0 -0
  44. data/test/test_data.txt +13 -0
  45. data/test/test_set.txt +10 -0
  46. data/test/trainingset.txt +0 -0
.gitattributes CHANGED
@@ -57,3 +57,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
60
+ data/dataset_visualization/nmr_set.pdf filter=lfs diff=lfs merge=lfs -text
61
+ data/examples/ProDcoNN.csv filter=lfs diff=lfs merge=lfs -text
62
+ data/examples/Rosetta.csv filter=lfs diff=lfs merge=lfs -text
63
+ data/examples/TIMED.csv filter=lfs diff=lfs merge=lfs -text
64
+ data/examples/denseCPD.csv filter=lfs diff=lfs merge=lfs -text
65
+ data/examples/evoEF2.csv filter=lfs diff=lfs merge=lfs -text
data/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Wells Wood Research Group
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/benchmark/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from .version import __version__
data/benchmark/config.py ADDED
@@ -0,0 +1,1036 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ acids = [
2
+ "A",
3
+ "C",
4
+ "D",
5
+ "E",
6
+ "F",
7
+ "G",
8
+ "H",
9
+ "I",
10
+ "K",
11
+ "L",
12
+ "M",
13
+ "N",
14
+ "P",
15
+ "Q",
16
+ "R",
17
+ "S",
18
+ "T",
19
+ "V",
20
+ "W",
21
+ "Y",
22
+ ]
23
+
24
+ UNCOMMON_RESIDUE_DICT = {
25
+ "DLY": "LYS",
26
+ "OTH": "THR",
27
+ "GHP": "GLY",
28
+ "YOF": "TYR",
29
+ "HS9": "HIS",
30
+ "HVA": "VAL",
31
+ "C5C": "CYS",
32
+ "TMD": "THR",
33
+ "NC1": "SER",
34
+ "CSR": "CYS",
35
+ "LYP": "LYS",
36
+ "PR4": "PRO",
37
+ "KPI": "LYS",
38
+ "02K": "ALA",
39
+ "4AW": "TRP",
40
+ "MLE": "LEU",
41
+ "NMM": "ARG",
42
+ "DNE": "LEU",
43
+ "NYS": "CYS",
44
+ "SEE": "SER",
45
+ "DSG": "ASN",
46
+ "ALA": "ALA",
47
+ "CSA": "CYS",
48
+ "SCH": "CYS",
49
+ "TQQ": "TRP",
50
+ "PTM": "TYR",
51
+ "XPR": "PRO",
52
+ "VLL": "UNK",
53
+ "B3Y": "TYR",
54
+ "PAQ": "TYR",
55
+ "FME": "MET",
56
+ "NAL": "ALA",
57
+ "TYI": "TYR",
58
+ "OXX": "ASP",
59
+ "CSS": "CYS",
60
+ "OCS": "CYS",
61
+ "193": "UNK",
62
+ "GLJ": "GLU",
63
+ "PM3": "PHE",
64
+ "DTR": "TRP",
65
+ "MEQ": "GLN",
66
+ "HSO": "HIS",
67
+ "TYW": "TYR",
68
+ "LED": "LEU",
69
+ "PHL": "PHE",
70
+ "TDD": "LEU",
71
+ "MEA": "PHE",
72
+ "FGA": "GLU",
73
+ "GGL": "GLU",
74
+ "PSH": "HIS",
75
+ "3CF": "PHE",
76
+ "MSE": "MET",
77
+ "2SO": "HIS",
78
+ "B3S": "SER",
79
+ "PSW": "SEC",
80
+ "C4R": "CYS",
81
+ "XCP": "UNK",
82
+ "LYF": "LYS",
83
+ "WFP": "PHE",
84
+ "A8E": "VAL",
85
+ "0AF": "TRP",
86
+ "PEC": "CYS",
87
+ "JJJ": "CYS",
88
+ "3TY": "UNK",
89
+ "SVY": "SER",
90
+ "DIL": "ILE",
91
+ "MHS": "HIS",
92
+ "MME": "MET",
93
+ "MMO": "ARG",
94
+ "B3A": "ALA",
95
+ "CHG": "UNK",
96
+ "PHI": "PHE",
97
+ "AR2": "ARG",
98
+ "MND": "ASN",
99
+ "BTR": "TRP",
100
+ "AEI": "ASP",
101
+ "TIH": "ALA",
102
+ "DDE": "HIS",
103
+ "S1H": "SER",
104
+ "DSE": "SER",
105
+ "AR4": "GLU",
106
+ "FDL": "LYS",
107
+ "PRJ": "PRO",
108
+ "CY3": "CYS",
109
+ "2TY": "TYR",
110
+ "AR7": "ARG",
111
+ "CTH": "THR",
112
+ "DTY": "TYR",
113
+ "SYS": "CYS",
114
+ "C1X": "LYS",
115
+ "SVV": "SER",
116
+ "ASN": "ASN",
117
+ "SNC": "CYS",
118
+ "AKZ": "ASP",
119
+ "OMY": "TYR",
120
+ "JJL": "CYS",
121
+ "XSN": "ASN",
122
+ "0UO": "TRP",
123
+ "TCQ": "TYR",
124
+ "OSE": "SER",
125
+ "NPH": "CYS",
126
+ "0A0": "ASP",
127
+ "1PA": "PHE",
128
+ "SIC": "CYS",
129
+ "TY8": "TYR",
130
+ "AYA": "ALA",
131
+ "ALN": "ALA",
132
+ "SXE": "SER",
133
+ "B3T": "UNK",
134
+ "BB9": "CYS",
135
+ "HL2": "LEU",
136
+ "0AR": "ARG",
137
+ "SVA": "SER",
138
+ "DBB": "THR",
139
+ "KPY": "LYS",
140
+ "DPP": "ALA",
141
+ "32S": "UNK",
142
+ "FGL": "GLY",
143
+ "N80": "PRO",
144
+ "IGL": "GLY",
145
+ "PF5": "PHE",
146
+ "OYL": "HIS",
147
+ "MNL": "LEU",
148
+ "PBF": "PHE",
149
+ "CEA": "CYS",
150
+ "OHI": "HIS",
151
+ "ESC": "MET",
152
+ "2JG": "SER",
153
+ "1X6": "SER",
154
+ "4BF": "TYR",
155
+ "MAA": "ALA",
156
+ "3X9": "CYS",
157
+ "BFD": "ASP",
158
+ "CZ2": "CYS",
159
+ "23P": "ALA",
160
+ "I4G": "GLY",
161
+ "CMT": "CYS",
162
+ "LVN": "VAL",
163
+ "OAS": "SER",
164
+ "TY2": "TYR",
165
+ "SCS": "CYS",
166
+ "PFX": "UNK",
167
+ "MF3": "UNK",
168
+ "OBS": "LYS",
169
+ "GL3": "GLY",
170
+ "0A9": "PHE",
171
+ "MVA": "VAL",
172
+ "B3Q": "UNK",
173
+ "DOA": "UNK",
174
+ "MP8": "PRO",
175
+ "CYR": "CYS",
176
+ "5PG": "GLY",
177
+ "ILY": "LYS",
178
+ "DNW": "ALA",
179
+ "BCX": "CYS",
180
+ "AZK": "LYS",
181
+ "AAR": "ARG",
182
+ "TRN": "TRP",
183
+ "NBQ": "TYR",
184
+ "RVX": "SER",
185
+ "PSA": "PHE",
186
+ "Z3E": "THR",
187
+ "OCY": "CYS",
188
+ "2ZC": "SER",
189
+ "N2C": "UNK",
190
+ "SBD": "SER",
191
+ "MSA": "GLY",
192
+ "SET": "SER",
193
+ "HS8": "HIS",
194
+ "SMF": "PHE",
195
+ "HYP": "PRO",
196
+ "PYX": "CYS",
197
+ "XPL": "PYL",
198
+ "DMK": "ASP",
199
+ "BIF": "PHE",
200
+ "M3L": "LYS",
201
+ "CYF": "CYS",
202
+ "O12": "UNK",
203
+ "SRZ": "SER",
204
+ "LAL": "ALA",
205
+ "2MR": "ARG",
206
+ "4PH": "PHE",
207
+ "2LT": "TYR",
208
+ "LPL": "UNK",
209
+ "3YM": "TYR",
210
+ "LRK": "LYS",
211
+ "FVA": "VAL",
212
+ "MED": "MET",
213
+ "ILM": "ILE",
214
+ "6CL": "LYS",
215
+ "CXM": "MET",
216
+ "DHV": "VAL",
217
+ "PR3": "CYS",
218
+ "HAR": "ARG",
219
+ "KWS": "GLY",
220
+ "SAR": "GLY",
221
+ "0LF": "PRO",
222
+ "45F": "PRO",
223
+ "12A": "A",
224
+ "CLG": "LYS",
225
+ "DHI": "HIS",
226
+ "PTR": "TYR",
227
+ "DMT": "UNK",
228
+ "OMT": "MET",
229
+ "TBG": "VAL",
230
+ "PLJ": "PRO",
231
+ "IAM": "ALA",
232
+ "DBY": "TYR",
233
+ "CPC": "UNK",
234
+ "GLZ": "GLY",
235
+ "4FW": "TRP",
236
+ "SLZ": "LYS",
237
+ "HIA": "HIS",
238
+ "FOE": "CYS",
239
+ "IYR": "TYR",
240
+ "KST": "LYS",
241
+ "B3M": "UNK",
242
+ "BB6": "CYS",
243
+ "CYW": "CYS",
244
+ "MPQ": "GLY",
245
+ "HHK": "LYS",
246
+ "HGL": "UNK",
247
+ "SE7": "ALA",
248
+ "ELY": "LYS",
249
+ "TRO": "TRP",
250
+ "DNP": "ALA",
251
+ "MK8": "LEU",
252
+ "200": "PHE",
253
+ "WVL": "VAL",
254
+ "LPD": "PRO",
255
+ "NCB": "ALA",
256
+ "DDZ": "ALA",
257
+ "MYK": "LYS",
258
+ "OLD": "HIS",
259
+ "DYS": "CYS",
260
+ "LET": "LYS",
261
+ "ESB": "TYR",
262
+ "HR7": "ARG",
263
+ "DI7": "TYR",
264
+ "QCS": "CYS",
265
+ "ASA": "ASP",
266
+ "CSX": "CYS",
267
+ "P3Q": "TYR",
268
+ "OHS": "ASP",
269
+ "SOY": "SER",
270
+ "EHP": "PHE",
271
+ "ZCL": "PHE",
272
+ "32T": "UNK",
273
+ "AHB": "ASN",
274
+ "TRX": "TRP",
275
+ "0AK": "ASP",
276
+ "TH5": "THR",
277
+ "GHG": "GLN",
278
+ "XW1": "ALA",
279
+ "23F": "PHE",
280
+ "1OP": "TYR",
281
+ "AGT": "CYS",
282
+ "PYA": "ALA",
283
+ "2MT": "PRO",
284
+ "4FB": "PRO",
285
+ "CSB": "CYS",
286
+ "TRQ": "TRP",
287
+ "MDO": "GLY",
288
+ "CAS": "CYS",
289
+ "TTQ": "TRP",
290
+ "T0I": "TYR",
291
+ "LLY": "LYS",
292
+ "GVL": "SER",
293
+ "BPE": "CYS",
294
+ "0TD": "ASP",
295
+ "TYY": "TYR",
296
+ "BH2": "ASP",
297
+ "D3P": "GLY",
298
+ "CY4": "CYS",
299
+ "CHP": "GLY",
300
+ "DFO": "UNK",
301
+ "NLB": "LEU",
302
+ "QPH": "PHE",
303
+ "DTH": "THR",
304
+ "LLO": "LYS",
305
+ "LYN": "LYS",
306
+ "DPN": "PHE",
307
+ "EFC": "CYS",
308
+ "FP9": "PRO",
309
+ "OMX": "TYR",
310
+ "AGQ": "TYR",
311
+ "PHD": "ASP",
312
+ "PR9": "PRO",
313
+ "B3L": "UNK",
314
+ "LYX": "LYS",
315
+ "IT1": "LYS",
316
+ "DBU": "THR",
317
+ "0A8": "CYS",
318
+ "TYX": "UNK",
319
+ "QMM": "GLN",
320
+ "CME": "CYS",
321
+ "ACB": "ASP",
322
+ "TRF": "TRP",
323
+ "HOX": "PHE",
324
+ "DA2": "ARG",
325
+ "DNS": "LYS",
326
+ "BIL": "UNK",
327
+ "SUN": "SER",
328
+ "TYJ": "TYR",
329
+ "3PX": "PRO",
330
+ "CLD": "SER",
331
+ "IPG": "GLY",
332
+ "CLH": "LYS",
333
+ "XCN": "CYS",
334
+ "CZZ": "CYS",
335
+ "THO": "UNK",
336
+ "CY1": "CYS",
337
+ "CYS": "CYS",
338
+ "PFF": "PHE",
339
+ "MLL": "LEU",
340
+ "PG1": "SER",
341
+ "BMT": "THR",
342
+ "CSZ": "CYS",
343
+ "DSN": "SER",
344
+ "NIY": "TYR",
345
+ "FH7": "LYS",
346
+ "CGV": "CYS",
347
+ "SVZ": "SER",
348
+ "ORQ": "ARG",
349
+ "DLS": "LYS",
350
+ "DVA": "VAL",
351
+ "BHD": "ASP",
352
+ "TPQ": "TYR",
353
+ "STY": "TYR",
354
+ "CSP": "CYS",
355
+ "31Q": "CYS",
356
+ "B3E": "GLU",
357
+ "LEF": "LEU",
358
+ "GLH": "GLU",
359
+ "LCK": "LYS",
360
+ "GME": "GLU",
361
+ "FHO": "LYS",
362
+ "MDH": "UNK",
363
+ "ECC": "GLN",
364
+ "34E": "VAL",
365
+ "ASB": "ASP",
366
+ "HCS": "UNK",
367
+ "KYN": "TRP",
368
+ "OIC": "UNK",
369
+ "VR0": "ARG",
370
+ "U2X": "TYR",
371
+ "PHE": "PHE",
372
+ "TYS": "TYR",
373
+ "SBG": "SER",
374
+ "A5N": "ASN",
375
+ "CYD": "CYS",
376
+ "4DP": "TRP",
377
+ "3AH": "HIS",
378
+ "FCL": "PHE",
379
+ "PRV": "GLY",
380
+ "CYQ": "CYS",
381
+ "MBQ": "TYR",
382
+ "DAS": "ASP",
383
+ "CS4": "CYS",
384
+ "B3K": "LYS",
385
+ "NLE": "LEU",
386
+ "143": "CYS",
387
+ "PR7": "PRO",
388
+ "DAH": "PHE",
389
+ "LE1": "VAL",
390
+ "TQZ": "CYS",
391
+ "LGY": "LYS",
392
+ "CML": "CYS",
393
+ "CSW": "CYS",
394
+ "N10": "SER",
395
+ "2RX": "SER",
396
+ "TOQ": "TRP",
397
+ "0AH": "SER",
398
+ "P2Q": "TYR",
399
+ "CYG": "CYS",
400
+ "DGL": "GLU",
401
+ "KOR": "MET",
402
+ "DAR": "ARG",
403
+ "2ML": "LEU",
404
+ "PTH": "TYR",
405
+ "CCS": "CYS",
406
+ "HMR": "ARG",
407
+ "33X": "ALA",
408
+ "UN2": "UNK",
409
+ "IML": "ILE",
410
+ "4CY": "MET",
411
+ "ZZJ": "ALA",
412
+ "DFI": "UNK",
413
+ "TIS": "SER",
414
+ "LLP": "LYS",
415
+ "MHU": "PHE",
416
+ "QPA": "CYS",
417
+ "175": "GLY",
418
+ "SAH": "CYS",
419
+ "IIL": "ILE",
420
+ "BCS": "CYS",
421
+ "R4K": "TRP",
422
+ "TYQ": "TYR",
423
+ "NCY": "UNK",
424
+ "FT6": "TRP",
425
+ "OBF": "UNK",
426
+ "0CS": "ALA",
427
+ "4HL": "TYR",
428
+ "TXY": "TYR",
429
+ "DOH": "ASP",
430
+ "CSE": "CYS",
431
+ "DAB": "ALA",
432
+ "GLK": "GLU",
433
+ "TYN": "TYR",
434
+ "LEI": "VAL",
435
+ "M0H": "CYS",
436
+ "CLB": "SER",
437
+ "MGG": "ARG",
438
+ "CGU": "GLU",
439
+ "UF0": "SER",
440
+ "SLL": "LYS",
441
+ "ML3": "LYS",
442
+ "HPH": "PHE",
443
+ "SME": "MET",
444
+ "ALC": "ALA",
445
+ "ASL": "ASP",
446
+ "CHS": "UNK",
447
+ "2TL": "THR",
448
+ "HT7": "TRP",
449
+ "SGB": "SER",
450
+ "OPR": "ARG",
451
+ "B3D": "ASP",
452
+ "FLT": "TYR",
453
+ "DGN": "GLN",
454
+ "4CF": "PHE",
455
+ "HLU": "LEU",
456
+ "FZN": "LYS",
457
+ "C6C": "CYS",
458
+ "HTI": "CYS",
459
+ "OMH": "SER",
460
+ "WLU": "LEU",
461
+ "23S": "UNK",
462
+ "U3X": "PHE",
463
+ "SEB": "SER",
464
+ "DBZ": "ALA",
465
+ "BB7": "CYS",
466
+ "2RA": "ALA",
467
+ "SCY": "CYS",
468
+ "6CW": "TRP",
469
+ "AHP": "ALA",
470
+ "ARO": "ARG",
471
+ "RE3": "TRP",
472
+ "1TQ": "TRP",
473
+ "VDL": "UNK",
474
+ "4IN": "TRP",
475
+ "GFT": "SER",
476
+ "CPI": "UNK",
477
+ "LSO": "LYS",
478
+ "CGA": "GLU",
479
+ "MLZ": "LYS",
480
+ "HTR": "TRP",
481
+ "00C": "CYS",
482
+ "FAK": "LYS",
483
+ "PRS": "PRO",
484
+ "ME0": "MET",
485
+ "SDP": "SER",
486
+ "HSL": "SER",
487
+ "C3Y": "CYS",
488
+ "823": "ASN",
489
+ "PHA": "PHE",
490
+ "LYZ": "LYS",
491
+ "HTN": "ASN",
492
+ "LP6": "LYS",
493
+ "ALV": "ALA",
494
+ "NVA": "VAL",
495
+ "CSD": "CYS",
496
+ "DMH": "ASN",
497
+ "PG9": "GLY",
498
+ "PCA": "GLU",
499
+ "KCX": "LYS",
500
+ "MDF": "TYR",
501
+ "TYB": "TYR",
502
+ "MHL": "LEU",
503
+ "GNC": "GLN",
504
+ "NLO": "LEU",
505
+ "MEN": "ASN",
506
+ "POM": "PRO",
507
+ "2HF": "HIS",
508
+ "CY0": "CYS",
509
+ "ZYK": "PRO",
510
+ "R1A": "CYS",
511
+ "CAF": "CYS",
512
+ "YCM": "CYS",
513
+ "ORN": "ALA",
514
+ "H5M": "PRO",
515
+ "MLY": "LYS",
516
+ "KYQ": "LYS",
517
+ "DPQ": "TYR",
518
+ "MIS": "SER",
519
+ "TPO": "THR",
520
+ "XX1": "LYS",
521
+ "SMC": "CYS",
522
+ "DHA": "SER",
523
+ "MGN": "GLN",
524
+ "FLA": "ALA",
525
+ "ILX": "ILE",
526
+ "QIL": "ILE",
527
+ "2KP": "LYS",
528
+ "CS1": "CYS",
529
+ "HNC": "CYS",
530
+ "PRK": "LYS",
531
+ "LYR": "LYS",
532
+ "DM0": "LYS",
533
+ "TSY": "CYS",
534
+ "NYB": "CYS",
535
+ "MHO": "MET",
536
+ "KFP": "LYS",
537
+ "SEN": "SER",
538
+ "999": "ASP",
539
+ "VLM": "UNK",
540
+ "CMH": "CYS",
541
+ "ONL": "UNK",
542
+ "M2L": "LYS",
543
+ "LME": "GLU",
544
+ "AIB": "ALA",
545
+ "CYJ": "LYS",
546
+ "CS3": "CYS",
547
+ "WPA": "PHE",
548
+ "MTY": "TYR",
549
+ "MIR": "SER",
550
+ "HZP": "PRO",
551
+ "LTA": "UNK",
552
+ "HIP": "HIS",
553
+ "PPN": "PHE",
554
+ "APK": "LYS",
555
+ "HPE": "PHE",
556
+ "SVX": "SER",
557
+ "JJK": "CYS",
558
+ "03Y": "CYS",
559
+ "D4P": "UNK",
560
+ "1AC": "ALA",
561
+ "B3X": "ASN",
562
+ "0FL": "ALA",
563
+ "2KK": "LYS",
564
+ "LMQ": "GLN",
565
+ "RE0": "TRP",
566
+ "MSO": "MET",
567
+ "ZYJ": "PRO",
568
+ "GMA": "GLU",
569
+ "DPR": "PRO",
570
+ "1TY": "TYR",
571
+ "TOX": "TRP",
572
+ "DPL": "PRO",
573
+ "M2S": "MET",
574
+ "4HT": "TRP",
575
+ "BUC": "CYS",
576
+ "C1S": "CYS",
577
+ "TA4": "UNK",
578
+ "CSO": "CYS",
579
+ "5CW": "TRP",
580
+ "TRW": "TRP",
581
+ "DCY": "CYS",
582
+ "DAL": "ALA",
583
+ "0QL": "CYS",
584
+ "THC": "THR",
585
+ "FGP": "SER",
586
+ "MCS": "CYS",
587
+ "AZH": "ALA",
588
+ "HIQ": "HIS",
589
+ "ABA": "ASN",
590
+ "TH6": "THR",
591
+ "FHL": "LYS",
592
+ "ZAL": "ALA",
593
+ "ICY": "CYS",
594
+ "IZO": "MET",
595
+ "F2F": "PHE",
596
+ "VAI": "VAL",
597
+ "TY5": "TYR",
598
+ "07O": "CYS",
599
+ "AA4": "ALA",
600
+ "RGL": "ARG",
601
+ "SAC": "SER",
602
+ "PXU": "PRO",
603
+ "NFA": "PHE",
604
+ "LA2": "LYS",
605
+ "0BN": "PHE",
606
+ "LYK": "LYS",
607
+ "FTY": "TYR",
608
+ "NZH": "HIS",
609
+ "CSJ": "CYS",
610
+ "30V": "CYS",
611
+ "DLE": "LEU",
612
+ "TLY": "LYS",
613
+ "L3O": "LEU",
614
+ "LDH": "LYS",
615
+ "NEP": "HIS",
616
+ "ALY": "LYS",
617
+ "GPL": "LYS",
618
+ "01W": "UNK",
619
+ "WRP": "TRP",
620
+ "MCL": "LYS",
621
+ "2AS": "UNK",
622
+ "CSU": "CYS",
623
+ "SOC": "CYS",
624
+ "HRG": "ARG",
625
+ "NMC": "GLY",
626
+ "TYO": "TYR",
627
+ "LHC": "UNK",
628
+ "D11": "THR",
629
+ "I2M": "ILE",
630
+ "TTS": "TYR",
631
+ "FC0": "PHE",
632
+ "HIC": "HIS",
633
+ "YPZ": "TYR",
634
+ "5CS": "CYS",
635
+ "SEP": "SER",
636
+ "BBC": "CYS",
637
+ "3MY": "TYR",
638
+ "HQA": "ALA",
639
+ "11Q": "PRO",
640
+ "AGM": "ARG",
641
+ "BG1": "SER",
642
+ "IAS": "ASP",
643
+ "SBL": "SER",
644
+ "56A": "HIS",
645
+ "FTR": "TRP",
646
+ "DIV": "VAL",
647
+ "ALO": "THR",
648
+ "BTK": "LYS",
649
+ "M3R": "ARG",
650
+ }
651
+
652
+ blosum62 = {
653
+ ("W", "F"): 1,
654
+ ("L", "R"): -2,
655
+ ("S", "P"): -1,
656
+ ("V", "T"): 0,
657
+ ("Q", "Q"): 5,
658
+ ("N", "A"): -2,
659
+ ("Z", "Y"): -2,
660
+ ("W", "R"): -3,
661
+ ("Q", "A"): -1,
662
+ ("S", "D"): 0,
663
+ ("H", "H"): 8,
664
+ ("S", "H"): -1,
665
+ ("H", "D"): -1,
666
+ ("L", "N"): -3,
667
+ ("W", "A"): -3,
668
+ ("Y", "M"): -1,
669
+ ("G", "R"): -2,
670
+ ("Y", "I"): -1,
671
+ ("Y", "E"): -2,
672
+ ("B", "Y"): -3,
673
+ ("Y", "A"): -2,
674
+ ("V", "D"): -3,
675
+ ("B", "S"): 0,
676
+ ("Y", "Y"): 7,
677
+ ("G", "N"): 0,
678
+ ("E", "C"): -4,
679
+ ("Y", "Q"): -1,
680
+ ("Z", "Z"): 4,
681
+ ("V", "A"): 0,
682
+ ("C", "C"): 9,
683
+ ("M", "R"): -1,
684
+ ("V", "E"): -2,
685
+ ("T", "N"): 0,
686
+ ("P", "P"): 7,
687
+ ("V", "I"): 3,
688
+ ("V", "S"): -2,
689
+ ("Z", "P"): -1,
690
+ ("V", "M"): 1,
691
+ ("T", "F"): -2,
692
+ ("V", "Q"): -2,
693
+ ("K", "K"): 5,
694
+ ("P", "D"): -1,
695
+ ("I", "H"): -3,
696
+ ("I", "D"): -3,
697
+ ("T", "R"): -1,
698
+ ("P", "L"): -3,
699
+ ("K", "G"): -2,
700
+ ("M", "N"): -2,
701
+ ("P", "H"): -2,
702
+ ("F", "Q"): -3,
703
+ ("Z", "G"): -2,
704
+ ("X", "L"): -1,
705
+ ("T", "M"): -1,
706
+ ("Z", "C"): -3,
707
+ ("X", "H"): -1,
708
+ ("D", "R"): -2,
709
+ ("B", "W"): -4,
710
+ ("X", "D"): -1,
711
+ ("Z", "K"): 1,
712
+ ("F", "A"): -2,
713
+ ("Z", "W"): -3,
714
+ ("F", "E"): -3,
715
+ ("D", "N"): 1,
716
+ ("B", "K"): 0,
717
+ ("X", "X"): -1,
718
+ ("F", "I"): 0,
719
+ ("B", "G"): -1,
720
+ ("X", "T"): 0,
721
+ ("F", "M"): 0,
722
+ ("B", "C"): -3,
723
+ ("Z", "I"): -3,
724
+ ("Z", "V"): -2,
725
+ ("S", "S"): 4,
726
+ ("L", "Q"): -2,
727
+ ("W", "E"): -3,
728
+ ("Q", "R"): 1,
729
+ ("N", "N"): 6,
730
+ ("W", "M"): -1,
731
+ ("Q", "C"): -3,
732
+ ("W", "I"): -3,
733
+ ("S", "C"): -1,
734
+ ("L", "A"): -1,
735
+ ("S", "G"): 0,
736
+ ("L", "E"): -3,
737
+ ("W", "Q"): -2,
738
+ ("H", "G"): -2,
739
+ ("S", "K"): 0,
740
+ ("Q", "N"): 0,
741
+ ("N", "R"): 0,
742
+ ("H", "C"): -3,
743
+ ("Y", "N"): -2,
744
+ ("G", "Q"): -2,
745
+ ("Y", "F"): 3,
746
+ ("C", "A"): 0,
747
+ ("V", "L"): 1,
748
+ ("G", "E"): -2,
749
+ ("G", "A"): 0,
750
+ ("K", "R"): 2,
751
+ ("E", "D"): 2,
752
+ ("Y", "R"): -2,
753
+ ("M", "Q"): 0,
754
+ ("T", "I"): -1,
755
+ ("C", "D"): -3,
756
+ ("V", "F"): -1,
757
+ ("T", "A"): 0,
758
+ ("T", "P"): -1,
759
+ ("B", "P"): -2,
760
+ ("T", "E"): -1,
761
+ ("V", "N"): -3,
762
+ ("P", "G"): -2,
763
+ ("M", "A"): -1,
764
+ ("K", "H"): -1,
765
+ ("V", "R"): -3,
766
+ ("P", "C"): -3,
767
+ ("M", "E"): -2,
768
+ ("K", "L"): -2,
769
+ ("V", "V"): 4,
770
+ ("M", "I"): 1,
771
+ ("T", "Q"): -1,
772
+ ("I", "G"): -4,
773
+ ("P", "K"): -1,
774
+ ("M", "M"): 5,
775
+ ("K", "D"): -1,
776
+ ("I", "C"): -1,
777
+ ("Z", "D"): 1,
778
+ ("F", "R"): -3,
779
+ ("X", "K"): -1,
780
+ ("Q", "D"): 0,
781
+ ("X", "G"): -1,
782
+ ("Z", "L"): -3,
783
+ ("X", "C"): -2,
784
+ ("Z", "H"): 0,
785
+ ("B", "L"): -4,
786
+ ("B", "H"): 0,
787
+ ("F", "F"): 6,
788
+ ("X", "W"): -2,
789
+ ("B", "D"): 4,
790
+ ("D", "A"): -2,
791
+ ("S", "L"): -2,
792
+ ("X", "S"): 0,
793
+ ("F", "N"): -3,
794
+ ("S", "R"): -1,
795
+ ("W", "D"): -4,
796
+ ("V", "Y"): -1,
797
+ ("W", "L"): -2,
798
+ ("H", "R"): 0,
799
+ ("W", "H"): -2,
800
+ ("H", "N"): 1,
801
+ ("W", "T"): -2,
802
+ ("T", "T"): 5,
803
+ ("S", "F"): -2,
804
+ ("W", "P"): -4,
805
+ ("L", "D"): -4,
806
+ ("B", "I"): -3,
807
+ ("L", "H"): -3,
808
+ ("S", "N"): 1,
809
+ ("B", "T"): -1,
810
+ ("L", "L"): 4,
811
+ ("Y", "K"): -2,
812
+ ("E", "Q"): 2,
813
+ ("Y", "G"): -3,
814
+ ("Z", "S"): 0,
815
+ ("Y", "C"): -2,
816
+ ("G", "D"): -1,
817
+ ("B", "V"): -3,
818
+ ("E", "A"): -1,
819
+ ("Y", "W"): 2,
820
+ ("E", "E"): 5,
821
+ ("Y", "S"): -2,
822
+ ("C", "N"): -3,
823
+ ("V", "C"): -1,
824
+ ("T", "H"): -2,
825
+ ("P", "R"): -2,
826
+ ("V", "G"): -3,
827
+ ("T", "L"): -1,
828
+ ("V", "K"): -2,
829
+ ("K", "Q"): 1,
830
+ ("R", "A"): -1,
831
+ ("I", "R"): -3,
832
+ ("T", "D"): -1,
833
+ ("P", "F"): -4,
834
+ ("I", "N"): -3,
835
+ ("K", "I"): -3,
836
+ ("M", "D"): -3,
837
+ ("V", "W"): -3,
838
+ ("W", "W"): 11,
839
+ ("M", "H"): -2,
840
+ ("P", "N"): -2,
841
+ ("K", "A"): -1,
842
+ ("M", "L"): 2,
843
+ ("K", "E"): 1,
844
+ ("Z", "E"): 4,
845
+ ("X", "N"): -1,
846
+ ("Z", "A"): -1,
847
+ ("Z", "M"): -1,
848
+ ("X", "F"): -1,
849
+ ("K", "C"): -3,
850
+ ("B", "Q"): 0,
851
+ ("X", "B"): -1,
852
+ ("B", "M"): -3,
853
+ ("F", "C"): -2,
854
+ ("Z", "Q"): 3,
855
+ ("X", "Z"): -1,
856
+ ("F", "G"): -3,
857
+ ("B", "E"): 1,
858
+ ("X", "V"): -1,
859
+ ("F", "K"): -3,
860
+ ("B", "A"): -2,
861
+ ("X", "R"): -1,
862
+ ("D", "D"): 6,
863
+ ("W", "G"): -2,
864
+ ("Z", "F"): -3,
865
+ ("S", "Q"): 0,
866
+ ("W", "C"): -2,
867
+ ("W", "K"): -3,
868
+ ("H", "Q"): 0,
869
+ ("L", "C"): -1,
870
+ ("W", "N"): -4,
871
+ ("S", "A"): 1,
872
+ ("L", "G"): -4,
873
+ ("W", "S"): -3,
874
+ ("S", "E"): 0,
875
+ ("H", "E"): 0,
876
+ ("S", "I"): -2,
877
+ ("H", "A"): -2,
878
+ ("S", "M"): -1,
879
+ ("Y", "L"): -1,
880
+ ("Y", "H"): 2,
881
+ ("Y", "D"): -3,
882
+ ("E", "R"): 0,
883
+ ("X", "P"): -2,
884
+ ("G", "G"): 6,
885
+ ("G", "C"): -3,
886
+ ("E", "N"): 0,
887
+ ("Y", "T"): -2,
888
+ ("Y", "P"): -3,
889
+ ("T", "K"): -1,
890
+ ("A", "A"): 4,
891
+ ("P", "Q"): -1,
892
+ ("T", "C"): -1,
893
+ ("V", "H"): -3,
894
+ ("T", "G"): -2,
895
+ ("I", "Q"): -3,
896
+ ("Z", "T"): -1,
897
+ ("C", "R"): -3,
898
+ ("V", "P"): -2,
899
+ ("P", "E"): -1,
900
+ ("M", "C"): -1,
901
+ ("K", "N"): 0,
902
+ ("I", "I"): 4,
903
+ ("P", "A"): -1,
904
+ ("M", "G"): -3,
905
+ ("T", "S"): 1,
906
+ ("I", "E"): -3,
907
+ ("P", "M"): -2,
908
+ ("M", "K"): -1,
909
+ ("I", "A"): -1,
910
+ ("P", "I"): -3,
911
+ ("R", "R"): 5,
912
+ ("X", "M"): -1,
913
+ ("L", "I"): 2,
914
+ ("X", "I"): -1,
915
+ ("Z", "B"): 1,
916
+ ("X", "E"): -1,
917
+ ("Z", "N"): 0,
918
+ ("X", "A"): 0,
919
+ ("B", "R"): -1,
920
+ ("B", "N"): 3,
921
+ ("F", "D"): -3,
922
+ ("X", "Y"): -1,
923
+ ("Z", "R"): 0,
924
+ ("F", "H"): -1,
925
+ ("B", "F"): -3,
926
+ ("F", "L"): 0,
927
+ ("X", "Q"): -1,
928
+ ("B", "B"): 4,
929
+ }
930
+
931
+ classes = {
932
+ 1: "Mainly Alpha",
933
+ 2: "Mainly Beta",
934
+ 3: "Alpha Beta",
935
+ 4: "Few Structures/Special",
936
+ }
937
+
938
+ architectures = {
939
+ "1.10": "Orthogonal Bundle",
940
+ "1.20": "Up-down Bundle",
941
+ "1.25": "Alpha Horseshoe",
942
+ "1.40": "Alpha solenoid",
943
+ "1.50": "Alpha/alpha barrel",
944
+ "2.10": "Ribbon",
945
+ "2.20": "Single Sheet",
946
+ "2.30": "Roll",
947
+ "2.40": "Beta Barrel",
948
+ "2.50": "Clam",
949
+ "2.60": "Sandwich",
950
+ "2.70": "Distorted Sandwich",
951
+ "2.80": "Trefoil",
952
+ "2.90": "Orthogonal Prism",
953
+ "2.100": "Aligned Prism",
954
+ "2.102": "3-layer Sandwich",
955
+ "2.105": "3 Propeller",
956
+ "2.110": "4 Propeller",
957
+ "2.115": "5 Propeller",
958
+ "2.120": "6 Propeller",
959
+ "2.130": "7 Propeller",
960
+ "2.140": "8 Propeller",
961
+ "2.150": "2 Solenoid",
962
+ "2.160": "3 Solenoid",
963
+ "2.170": "Beta Complex",
964
+ "2.180": "Shell",
965
+ "3.10": "Roll",
966
+ "3.15": "Super Roll",
967
+ "3.20": "Alpha-Beta Barrel",
968
+ "3.30": "2-Layer Sandwich",
969
+ "3.40": "3-Layer(aba) Sandwich",
970
+ "3.50": "3-Layer(bba) Sandwich",
971
+ "3.55": "3-Layer(bab) Sandwich",
972
+ "3.60": "4-Layer Sandwich",
973
+ "3.65": "Alpha-beta prism",
974
+ "3.70": "Box",
975
+ "3.75": "5-stranded Propeller",
976
+ "3.80": "Alpha-Beta Horseshoe",
977
+ "3.90": "Alpha-Beta Complex",
978
+ "3.100": "Ribosomal Protein L15; Chain: K; domain 2",
979
+ "4.10": "Irregular",
980
+ "6.10": "Helix non-globular",
981
+ "6.20": "Other non-globular",
982
+ }
983
+
984
+ # move into .txt file, no need for a special function for ts50.
985
+ ts50 = [
986
+ "1AHSA",
987
+ "1BVYF",
988
+ "1PDOA",
989
+ "2VA0A",
990
+ "3IEYB",
991
+ "2XR6A",
992
+ "3II2A",
993
+ "1OR4A",
994
+ "2QDLA",
995
+ "3NZMA",
996
+ "3VJZA",
997
+ "1ETEA",
998
+ "2A2LA",
999
+ "2FVVA",
1000
+ "3L4RA",
1001
+ "1LPBA",
1002
+ "3NNGA",
1003
+ "2CVIA",
1004
+ "3GKNA",
1005
+ "2J49A",
1006
+ "3FHKA",
1007
+ "3PIVA",
1008
+ "3LQCA",
1009
+ "3GFSA",
1010
+ "3E8MA",
1011
+ "1DX5I",
1012
+ "3NY7A",
1013
+ "3K7PA",
1014
+ "2CAYA",
1015
+ "1I8NA",
1016
+ "1V7MV",
1017
+ "1H4AX",
1018
+ "3T5GB",
1019
+ "3Q4OA",
1020
+ "3A4RA",
1021
+ "2I39A",
1022
+ "3AQGA",
1023
+ "3EJFA",
1024
+ "3NBKA",
1025
+ "4GCNA",
1026
+ "2XDGA",
1027
+ "3GWIA",
1028
+ "3HKLA",
1029
+ "3SO6A",
1030
+ "3ON9A",
1031
+ "4DKCA",
1032
+ "2GU3A",
1033
+ "2XCJA",
1034
+ "1Y1LA",
1035
+ "1MR1C",
1036
+ ]
data/benchmark/get_cath.py ADDED
@@ -0,0 +1,1029 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Functions for creating and scoring CATH datasets"""
2
+
3
+ import numpy as np
4
+ import pandas as pd
5
+ import ampal
6
+ import gzip
7
+ from pathlib import Path
8
+ from sklearn import metrics
9
+ from benchmark import config
10
+ import string
11
+ from subprocess import CalledProcessError
12
+ import re
13
+ from scipy.stats import entropy
14
+ from benchmark import visualization
15
+ from typing import Tuple, List, Iterable
16
+ import warnings
17
+ from sklearn.preprocessing import LabelBinarizer
18
+ import wget
19
+ import click
20
+
21
+ def download_data(out_dir: Path) -> None:
22
+ """Download CATH file.
23
+
24
+ Parameters
25
+ ----------
26
+ out_dir: Path:
27
+ Directory where to store the file."""
28
+ if click.confirm(
29
+ f"CATH file does not exist. It will be downloaded to {out_dir.resolve()}. Continue? "
30
+ ):
31
+ wget.download('ftp://orengoftp.biochem.ucl.ac.uk/cath/releases/latest-release/cath-classification-data/cath-domain-description-file.txt', out=str(out_dir))
32
+ else:
33
+ exit()
34
+
35
+ def read_data(CATH_file: str) -> pd.DataFrame:
36
+ """If CATH .csv exists, loads the DataFrame. If CATH .txt exists, makes DataFrame and saves it. If CATH .txt file doesn't exist, downloads it.
37
+
38
+ Parameters
39
+ ----------
40
+ CATH_file: str
41
+ CATH .txt file name.
42
+
43
+ Returns
44
+ -------
45
+ df:pd.DataFrame
46
+ DataFrame containing CATH and PDB codes."""
47
+ path = Path(CATH_file)
48
+ #download if doesn't exist.
49
+ if not path.exists():
50
+ download_data(path.parent)
51
+ # load .csv if exists, faster than reading .txt
52
+ if path.with_suffix(".csv").exists():
53
+ df = pd.read_csv(path.with_suffix(".csv"), index_col=0)
54
+ # start, stop needs to be str
55
+ df["start"] = df["start"].apply(str)
56
+ df["stop"] = df["stop"].apply(str)
57
+ return df
58
+
59
+ else:
60
+ cath_info = []
61
+ temp = []
62
+ start_stop = []
63
+ with open(path) as file:
64
+ for line in file:
65
+ if line[:6] == "DOMAIN":
66
+ # PDB
67
+ temp.append(line[10:14])
68
+ # chain
69
+ temp.append(line[14])
70
+ if line[:6] == "CATHCO":
71
+ # class, architecture, topology, homologous superfamily
72
+ cath = [int(i) for i in line[10:].strip("\n").split(".")]
73
+ temp = temp + cath
74
+ if line[:6] == "SRANGE":
75
+ j = line.split()
76
+ # start and stop resi, can be multiple for the same chain
77
+ # must be str to deal with insertions (1A,1B) later.
78
+ start_stop.append([str(j[1][6:]), str(j[2][5:])])
79
+ if line[:2] == "//":
80
+ # keep fragments from the same chain as separate entries
81
+ for fragment in start_stop:
82
+ cath_info.append(temp + fragment)
83
+ start_stop = []
84
+ temp = []
85
+ df = pd.DataFrame(
86
+ cath_info,
87
+ columns=[
88
+ "PDB",
89
+ "chain",
90
+ "class",
91
+ "architecture",
92
+ "topology",
93
+ "hsf",
94
+ "start",
95
+ "stop",
96
+ ],
97
+ )
98
+ df.to_csv(path.with_suffix(".csv"))
99
+ return df
100
+
101
+
102
+ def tag_dssp_data(assembly: ampal.Assembly) -> None:
103
+ """Same as ampal.dssp.tag_dssp_data(), but fixed a bug with insertions. Tags each residue in ampal.Assembly with secondary structure. Works in place.
104
+
105
+ Parameters
106
+ ----------
107
+ assembly: ampal.Assembly
108
+ Protein assembly."""
109
+
110
+ dssp_out = ampal.dssp.run_dssp(assembly.pdb, path=False)
111
+ dssp_data = ampal.dssp.extract_all_ss_dssp(dssp_out, path=False)
112
+ for i, record in enumerate(dssp_data):
113
+ rnum, sstype, chid, _, phi, psi, sacc = record
114
+ # deal with insertions
115
+ if len(chid) > 1:
116
+ for i, res in enumerate(assembly[chid[1]]):
117
+ if res.insertion_code == chid[0] and assembly[chid[1]][i].tags == {}:
118
+ assembly[chid[1]][i].tags["dssp_data"] = {
119
+ "ss_definition": sstype,
120
+ "solvent_accessibility": sacc,
121
+ "phi": phi,
122
+ "psi": psi,
123
+ }
124
+ break
125
+
126
+ else:
127
+ assembly[chid][str(rnum)].tags["dssp_data"] = {
128
+ "ss_definition": sstype,
129
+ "solvent_accessibility": sacc,
130
+ "phi": phi,
131
+ "psi": psi,
132
+ }
133
+
134
+
135
+ def get_sequence(
136
+ series: pd.Series, path_to_pdb: Path
137
+ ) -> Tuple[str, str, int, int, List[int]]:
138
+ """Gets a sequence of from PDB file, CATH fragment indexes and secondary structure labels.
139
+
140
+ Parameters
141
+ ----------
142
+ series: pd.Series
143
+ Series containing one CATH instance.
144
+ path_to_assemblies:Path
145
+ Path to directory with biologcial assemblies.
146
+
147
+ Returns
148
+ -------
149
+ sequence: str
150
+ True sequence.
151
+ dssp: str
152
+ dssp codes.
153
+ start: int
154
+ CATH fragment start residue number, same as in PDB. NOT EQUAL TO SEQUENCE INDEX.
155
+ stop:int
156
+ CATH fragment stop residue number, same as in PDB. NOT EQUAL TO SEQUENCE INDEX.
157
+ uncommon_index:list
158
+ List with residue number of uncommon amino acids.
159
+ """
160
+
161
+ path = path_to_pdb / series.PDB[1:3] / f"pdb{series.PDB}.ent.gz"
162
+
163
+ if path.exists():
164
+ with gzip.open(path, "rb") as protein:
165
+ assembly = ampal.load_pdb(protein.read().decode(), path=False)
166
+ # convert pdb res id into sequence index,
167
+ # some files have discontinuous residue ids so ampal.get_slice_from_res_id() does not work
168
+ start = 0
169
+ stop = 0
170
+ # if nmr structure, get 1st model
171
+ if isinstance(assembly, ampal.AmpalContainer):
172
+ assembly = assembly[0]
173
+ # run dssp
174
+ try:
175
+ tag_dssp_data(assembly)
176
+ except CalledProcessError:
177
+ raise CalledProcessError(f"dssp failed on {series.PDB}.pdb.")
178
+ # some biological assemblies are broken
179
+ try:
180
+ chain = assembly[series.chain]
181
+ except KeyError:
182
+ raise KeyError(f"{series.PDB}.pdb is missing chain {series.chain}.")
183
+
184
+ # compatibility with evoef and leo's model, store non-canonical residue index in a separate column and include regular amino acid in the sequence
185
+ sequence = ""
186
+ uncommon_index = []
187
+ dssp = ""
188
+ for i, residue in enumerate(chain):
189
+ # add dssp data, assume random structure if dssp did not return anything for this residue
190
+ try:
191
+ dssp += residue.tags["dssp_data"]["ss_definition"]
192
+ except KeyError:
193
+ dssp += " "
194
+ # deal with uncommon residues
195
+ one_letter_code = ampal.amino_acids.get_aa_letter(residue.mol_code)
196
+ if one_letter_code == "X":
197
+ try:
198
+ uncommon_index.append(i)
199
+ sequence += ampal.amino_acids.get_aa_letter(
200
+ config.UNCOMMON_RESIDUE_DICT[residue.mol_code]
201
+ )
202
+ except KeyError:
203
+ raise ValueError(
204
+ f"{series.PDB}.pdb has unrecognized amino acid {residue.mol_code}."
205
+ )
206
+ else:
207
+ sequence += one_letter_code
208
+
209
+ # deal with insertions
210
+ if series.start[-1].isalpha():
211
+ if (residue.id + residue.insertion_code) == series.start:
212
+ start = i
213
+ else:
214
+ if residue.id == series.start:
215
+ start = i
216
+ if series.stop[-1].isalpha():
217
+ if (residue.id + residue.insertion_code) == series.stop:
218
+ stop = i
219
+ else:
220
+ if residue.id == series.stop:
221
+ stop = i
222
+ if uncommon_index==[]:
223
+ uncommon_index=np.NaN
224
+ return sequence, dssp, start, stop, uncommon_index
225
+ else:
226
+ raise FileNotFoundError(
227
+ f"{series.PDB}.pdb is missing, download it or remove it from your dataset."
228
+ )
229
+
230
+
231
+ def get_pdbs(
232
+ df: pd.DataFrame, cls: int, arch: int = 0, topo: int = 0, homologous_sf: int = 0
233
+ ) -> pd.DataFrame:
234
+ """Gets PDBs based on CATH code, at least class has to be specified.
235
+
236
+ Parameters
237
+ ----------
238
+ df: pd.DataFrame
239
+ DataFrame containing CATH dataset.
240
+ cls: int
241
+ CATH class
242
+ arch: int = 0
243
+ CATH architecture
244
+ topo: int = 0
245
+ CATH topology
246
+ homologous_sf: int = 0
247
+ CATH homologous superfamily
248
+
249
+ Returns
250
+ -------
251
+ df:pd.DataFrame
252
+ DataFrame containing PDBs with specified CATH code."""
253
+
254
+ if homologous_sf != 0:
255
+ return df.loc[
256
+ (df["class"] == cls)
257
+ & (df["topology"] == topo)
258
+ & (df["architecture"] == arch)
259
+ & (df["hsf"] == homologous_sf)
260
+ ].copy()
261
+ elif topo != 0:
262
+ return df.loc[
263
+ (df["class"] == cls)
264
+ & (df["topology"] == topo)
265
+ & (df["architecture"] == arch)
266
+ ].copy()
267
+ elif arch != 0:
268
+ return df.loc[(df["class"] == cls) & (df["architecture"] == arch)].copy()
269
+ else:
270
+ return df.loc[(df["class"] == cls)].copy()
271
+
272
+
273
+ def get_resolution(df: pd.DataFrame, path_to_pdb: Path) -> List[float]:
274
+ """Gets resolution of each structure in DataFrame
275
+
276
+ Parameters
277
+ ----------
278
+ df: pd.DataFrame
279
+ DataFrame with CATH fragment info.
280
+ path_to_pdb: Path
281
+ Path to the directory with PDB files.
282
+
283
+ Returns
284
+ -------
285
+ res: list
286
+ List with resolutions."""
287
+
288
+ res = []
289
+ for i, protein in df.iterrows():
290
+ path = path_to_pdb / protein.PDB[1:3] / f"pdb{protein.PDB}.ent.gz"
291
+
292
+ if path.exists():
293
+ with gzip.open(path, "rb") as pdb:
294
+ pdb_text = pdb.read().decode()
295
+ item = re.findall("REMARK 2 RESOLUTION.*$", pdb_text, re.MULTILINE)
296
+
297
+ if item[0].split()[3]!='NOT':
298
+ res.append(float(item[0].split()[3]))
299
+ #nmr structures have no resolution
300
+ else:
301
+ res.append(np.NaN)
302
+ else:
303
+ res.append(np.NaN)
304
+ return res
305
+
306
+
307
+ def append_sequence(
308
+ df: pd.DataFrame, path_to_pdb: Path
309
+ ) -> pd.DataFrame:
310
+ """Get sequences for all entries in the dataframe, changes start and stop from PDB resid to index number,adds resolution of each chain.
311
+
312
+ Parameters
313
+ ----------
314
+ df: pd.DataFrame
315
+ CATH dataframe.
316
+ path_to_pdb: Path
317
+ Path to the directory with PDB files.
318
+
319
+
320
+ Returns
321
+ -------
322
+ working_copy:pd.DataFrame
323
+ DataFrame with appended sequences,dssp data, start/stop numbers, uncommon index list and resolution data."""
324
+
325
+ # make copy to avoid changing original df.
326
+ working_copy = df.copy()
327
+ sequence, dssp, start, stop, uncommon_index = zip(
328
+ *[get_sequence(x, path_to_pdb) for i, x in df.iterrows()]
329
+ )
330
+ working_copy.loc[:, "sequence"] = sequence
331
+ working_copy.loc[:, "dssp"] = dssp
332
+ working_copy.loc[:, "start"] = start
333
+ working_copy.loc[:, "stop"] = stop
334
+ working_copy.loc[:, "uncommon_index"]=uncommon_index
335
+ working_copy.loc[:, "resolution"] = get_resolution(working_copy, path_to_pdb)
336
+
337
+ return working_copy
338
+
339
+
340
+ def filter_with_user_list(
341
+ df: pd.DataFrame, path: Path, ispisces: bool = False
342
+ ) -> pd.DataFrame:
343
+ """Selects PDB chains specified in .txt file. Multiple CATH entries for the same protein are removed to leave only one example.
344
+ Parameters
345
+ ----------
346
+ df: pd.DataFrame
347
+ CATH info containing dataframe
348
+ path: Path
349
+ Path to dataset .txt file
350
+ ispisces:bool = False
351
+ Reads pisces formating if True, otherwise pdb+chain, e.g., 1a2bA\n.
352
+
353
+ Returns
354
+ -------
355
+ DataFrame with selected chains."""
356
+
357
+ path = Path(path)
358
+ with open(path) as file:
359
+ if ispisces:
360
+ filtr = [x.split()[0] for x in file.readlines()[1:]]
361
+ else:
362
+ filtr = [x.upper().strip("\n") for x in file.readlines()]
363
+ frame_copy = df.copy()
364
+ frame_copy["PDB+chain"] = df.PDB + df.chain
365
+ # must be upper letters for string comparison
366
+ frame_copy["PDB+chain"] = frame_copy["PDB+chain"].str.upper()
367
+ return df.loc[frame_copy["PDB+chain"].isin(filtr)].drop_duplicates(
368
+ subset=["PDB", "chain"]
369
+ )
370
+
371
+
372
+ def filter_with_resolution(
373
+ df: pd.DataFrame, minimum: float, maximum: float
374
+ ) -> pd.DataFrame:
375
+ """Gets DataFrame slice with chain resolution between min and max.
376
+
377
+ Parameters:
378
+ -----------
379
+ df: pd.DataFrame
380
+ CATH DataFrame.
381
+ minimum:float
382
+ maximum:float
383
+
384
+ Returns
385
+ -------
386
+ DataFrame with chains."""
387
+
388
+ return df[(df["resolution"] >= minimum) & (df["resolution"] < maximum)]
389
+
390
+
391
+ def lookup_blosum62(res_true: str, res_prediction: str) -> int:
392
+ """Returns score from the matrix.
393
+
394
+ Parameters
395
+ ----------
396
+ res_true: str
397
+ First residue code.
398
+ res_prediction: str
399
+ Second residue code.
400
+
401
+ Returns
402
+ --------
403
+ Score from the matrix."""
404
+
405
+ if (res_true, res_prediction) in config.blosum62.keys():
406
+ return config.blosum62[res_true, res_prediction]
407
+ else:
408
+ return config.blosum62[res_prediction, res_true]
409
+
410
+ def load_prediction_matrix(
411
+ df: pd.DataFrame, path_to_dataset: Path, path_to_probabilities: Path
412
+ ) -> dict:
413
+ """Loads predicted probabilities from .csv file to dictionary, drops entries for which sequence prediction fails.
414
+ Parameters
415
+ ----------
416
+ df: pd.DataFrame
417
+ CATH dataframe.
418
+ path_to_dataset: Path
419
+ Path to prediction dataset labels.
420
+ path_to_probabilities:Path
421
+ Path to .csv file with probabilities.
422
+
423
+ Returns
424
+ -------
425
+ empty_dict:dict
426
+ Dictionary with predicted sequences, key is PDB+chain."""
427
+
428
+ path_to_dataset = Path(path_to_dataset)
429
+ path_to_probabilities = Path(path_to_probabilities)
430
+ counter=0
431
+ with open(path_to_dataset) as file:
432
+ labels = [x.strip('\n').split() for x in file.readlines()[3:]]
433
+ predictions = pd.read_csv(path_to_probabilities, header=None).values
434
+ empty_dict = {k: [] for k in df.PDB.values + df.chain.values}
435
+ for chain in labels:
436
+ if chain[0] in empty_dict:
437
+ empty_dict[chain[0]]=predictions[counter:counter+int(chain[1])]
438
+ counter+=int(chain[1])
439
+ # drop keys with missing values
440
+ filtered_empty_dict = {
441
+ k: v for k, v in empty_dict.items() if len(v) != 0
442
+ }
443
+ # warn about missing predictions
444
+ missing_structures = [x for x in empty_dict if x not in filtered_empty_dict]
445
+ if len(missing_structures) > 0:
446
+ warnings.warn(f"{path_to_probabilities.name}: {*missing_structures,} predictions are missing.")
447
+ return filtered_empty_dict
448
+
449
+
450
+ def most_likely_sequence(probability_matrix: np.array) -> str:
451
+ """Makes protein sequence from probability matrix.
452
+
453
+ Parameters
454
+ ----------
455
+ probability_matrix: np.array
456
+ Array in shape n,20 with probabilities for each amino acid.
457
+
458
+ Returns
459
+ -------
460
+ String with the sequence"""
461
+
462
+ if len(probability_matrix) > 0:
463
+ most_likely_seq = [
464
+ config.acids[x] for x in np.argmax(probability_matrix, axis=1)
465
+ ]
466
+ return "".join(most_likely_seq)
467
+ else:
468
+ return ""
469
+
470
+
471
+ def format_sequence(
472
+ df: pd.DataFrame,
473
+ predictions: dict,
474
+ by_fragment: bool = True,
475
+ ignore_uncommon:bool=False,
476
+ ) -> Tuple[np.array, np.array, np.array, List[List], List[List]]:
477
+ """
478
+ Concatenates and formats all sequences in the DataFrame for metrics calculations.
479
+
480
+ Parameters
481
+ ----------
482
+ df: pd.DataFrame
483
+ DataFrame with CATH fragment info. The frame must have predicted sequence, true sequence and start/stop index of CATH fragment.
484
+ predictions: dict
485
+ Dictionary with loaded predictions.
486
+ by_fragment: bool
487
+ If true scores only CATH fragments, if False, scores entire chain.
488
+ ignore_uncommon=True
489
+ If True, ignores uncommon residues in accuracy calculations.
490
+ score_sequence=False
491
+ True if dictionary contains sequences, False if probability matrices(matrix shape n,20).
492
+
493
+ Returns
494
+ -------
495
+ sequece:np.array
496
+ Array with protein sequence.
497
+ prediction:np.array
498
+ Array of predicted protein residues or probability matrix, shape n or n,20.
499
+ dssp: np.array
500
+ Array with dssp data.
501
+ true_secondary:List[List[Union(chr,np.array)]]
502
+ List with true sequences split by secondary structure type. Entries can be character lists or np.arrays with probability matrices. Format:[helices,sheets,loops,random].
503
+ predicted_secondary:List[List[Union[chr,np.array]]
504
+ List with predicted sequences split by secondary structure type. Entries can be character lists or np.arrays with probability matrices. Format:[helices,sheets,loops,random].
505
+ """
506
+ sequence = ""
507
+ dssp = ""
508
+ # Store failed structures
509
+ failed = []
510
+ prediction = np.empty([0, 20])
511
+ for i, protein in df.iterrows():
512
+ if protein.PDB + protein.chain in predictions:
513
+ start = protein.start
514
+ stop = protein.stop
515
+ predicted_sequence = predictions[protein.PDB + protein.chain]
516
+ # remove uncommon acids
517
+ if ignore_uncommon and isinstance(protein.uncommon_index,list):
518
+ protein_sequence = "".join(
519
+ [
520
+ x
521
+ for i, x in enumerate(protein.sequence)
522
+ if i not in protein.uncommon_index
523
+ ]
524
+ )
525
+ protein_dssp = "".join(
526
+ [
527
+ x
528
+ for i, x in enumerate(protein.dssp)
529
+ if i not in protein.uncommon_index
530
+ ]
531
+ )
532
+ # update start and stop indexes
533
+ start = start - (np.array(protein.uncommon_index) <= start).sum()
534
+ stop = stop - (np.array(protein.uncommon_index) <= stop).sum()
535
+ else:
536
+ protein_sequence = protein.sequence
537
+ protein_dssp = protein.dssp
538
+
539
+ # check length
540
+ if len(protein_sequence) != len(predicted_sequence):
541
+ # prediction is multimer-this is for compatibility with older EvoEF2 runs. Fixed now.
542
+ if len(predicted_sequence) % len(protein_sequence) == 0:
543
+ predicted_sequence = predicted_sequence[0 : len(protein_sequence)]
544
+ else:
545
+ failed.append(protein.PDB + protein.chain)
546
+ continue
547
+
548
+ if by_fragment:
549
+ protein_sequence = protein_sequence[start : stop + 1]
550
+ protein_dssp = protein_dssp[start : stop + 1]
551
+ predicted_sequence = predicted_sequence[start : stop + 1]
552
+
553
+ if len(protein_sequence) == len(predicted_sequence) and len(
554
+ protein_sequence
555
+ ) == len(protein_dssp):
556
+ sequence += protein_sequence
557
+ dssp += protein_dssp
558
+ prediction = np.concatenate(
559
+ [prediction, predicted_sequence], axis=0
560
+ )
561
+ else:
562
+ failed.append(protein.PDB + protein.chain)
563
+ # Get all failed structures.
564
+ if len(failed) > 0:
565
+ raise ValueError(
566
+ f"Sequence, predicted sequence and dssp length do not match for these structures: {*failed,}"
567
+ )
568
+
569
+ sequence = np.array(list(sequence))
570
+ dssp = np.array(list(dssp))
571
+ # format secondary structures
572
+ true_secondary = [[], [], [], []]
573
+ prediction_secondary = [[], [], [], []]
574
+ # combine secondary structures for simplicity.
575
+ assert len(dssp)==len(sequence) and len(dssp)==len(prediction), 'format_sequence failed; dssp, sequence and prediction have different lengths.'
576
+ for structure, truth, pred in zip(dssp, sequence, prediction):
577
+ if structure == "H" or structure == "I" or structure == "G":
578
+ true_secondary[0].append(truth)
579
+ prediction_secondary[0].append(pred)
580
+ elif structure == "E":
581
+ true_secondary[1].append(truth)
582
+ prediction_secondary[1].append(pred)
583
+ elif structure == "B" or structure == "T" or structure == "S":
584
+ true_secondary[2].append(truth)
585
+ prediction_secondary[2].append(pred)
586
+ else:
587
+ true_secondary[3].append(truth)
588
+ prediction_secondary[3].append(pred)
589
+ return sequence, prediction, dssp, true_secondary, prediction_secondary
590
+
591
+
592
+ def score(
593
+ df: pd.DataFrame,
594
+ predictions: dict,
595
+ by_fragment: bool = True,
596
+ ignore_uncommon=False,
597
+ ) -> Tuple[List[float], List[float], List[float], List[float], List[float]]:
598
+ """Concatenates and scores all predicted sequences in the DataFrame.
599
+
600
+ Parameters
601
+ ----------
602
+ df: pd.DataFrame
603
+ DataFrame with CATH fragment info. The frame must have predicted sequence, true sequence and start/stop index of CATH fragment.
604
+ predictions: dict
605
+ Dictionary with loaded predictions.
606
+ by_fragment: bool
607
+ If true scores only CATH fragments, if False, scores entire chain.
608
+ ignore_uncommon=True
609
+ If True, ignores uncommon residues in accuracy calculations.
610
+ score_sequence=False
611
+ True if dictionary contains sequences, False if probability matrices(matrix shape n,20).
612
+
613
+ Returns
614
+ --------
615
+ accuracy: List[float]
616
+ List with accuracy. Format: [overal,helices,sheets,loops,random].
617
+ top_three: List[float]
618
+ List with top_three accuracy. Same format.
619
+ similarity: List[float]
620
+ List with similarity scores.
621
+ recall: List[float]
622
+ List with macro average recall.
623
+ precision: List[float]
624
+ List with macro average precision."""
625
+ sequence, prediction, dssp, true_secondary, predicted_secondary = format_sequence(
626
+ df, predictions, by_fragment, ignore_uncommon,
627
+ )
628
+ accuracy = []
629
+ recall = []
630
+ similarity = []
631
+ top_three = []
632
+ precision = []
633
+
634
+ most_likely_seq = list(most_likely_sequence(prediction))
635
+ accuracy.append(metrics.accuracy_score(sequence, most_likely_seq))
636
+ recall.append(
637
+ metrics.recall_score(
638
+ sequence, most_likely_seq, average="macro", zero_division=0
639
+ )
640
+ )
641
+ precision.append(
642
+ metrics.precision_score(
643
+ sequence, most_likely_seq, average="macro", zero_division=0
644
+ )
645
+ )
646
+ assert len(sequence)==len(most_likely_seq), "Predicted and true sequence lengths do not match."
647
+ similarity_score = [
648
+ 1 if lookup_blosum62(a, b) > 0 else 0
649
+ for a, b in zip(sequence, most_likely_seq)
650
+ ]
651
+ if len(similarity_score)>0:
652
+ similarity.append(sum(similarity_score) / len(similarity_score))
653
+ else:
654
+ similarity.append(np.NaN)
655
+ #check if probabilities or encoded sequences, encoded sequence has 0 entropy.
656
+ is_prob=sum(entropy(prediction, base=2, axis=1))
657
+ if is_prob:
658
+ top_three.append(
659
+ metrics.top_k_accuracy_score(sequence, prediction, k=3, labels=config.acids)
660
+ )
661
+ else:
662
+ top_three.append(np.NaN)
663
+ for seq_type in range(len(true_secondary)):
664
+ # not all architectures have examples of all secondary structure types.
665
+ if len(true_secondary[seq_type]) > 0:
666
+ secondary_sequence = list(
667
+ most_likely_sequence(predicted_secondary[seq_type])
668
+ )
669
+ accuracy.append(
670
+ metrics.accuracy_score(true_secondary[seq_type], secondary_sequence)
671
+ )
672
+ recall.append(
673
+ metrics.recall_score(
674
+ true_secondary[seq_type],
675
+ secondary_sequence,
676
+ average="macro",
677
+ zero_division=0,
678
+ )
679
+ )
680
+ precision.append(
681
+ metrics.precision_score(
682
+ true_secondary[seq_type],
683
+ secondary_sequence,
684
+ average="macro",
685
+ zero_division=0,
686
+ )
687
+ )
688
+ assert len(true_secondary[seq_type])==len(secondary_sequence), "True and predicted lengths do not match"
689
+ similarity_score = [
690
+ 1 if lookup_blosum62(a, b) > 0 else 0
691
+ for a, b in zip(true_secondary[seq_type], secondary_sequence)
692
+ ]
693
+ if is_prob:
694
+ top_three.append(
695
+ metrics.top_k_accuracy_score(
696
+ true_secondary[seq_type],
697
+ predicted_secondary[seq_type],
698
+ k=3,
699
+ labels=config.acids,
700
+ )
701
+ )
702
+ else:
703
+ top_three.append(np.NaN)
704
+ similarity.append(sum(similarity_score) / len(similarity_score))
705
+ else:
706
+ accuracy.append(np.NaN)
707
+ top_three.append(np.NaN)
708
+ similarity.append(np.NaN)
709
+ recall.append(np.NaN)
710
+ precision.append(np.NaN)
711
+ return accuracy, top_three, similarity, recall, precision
712
+
713
+
714
+ def score_by_architecture(
715
+ df: pd.DataFrame,
716
+ predictions: dict,
717
+ by_fragment: bool = True,
718
+ ignore_uncommon: bool = False,
719
+ ) -> pd.DataFrame:
720
+ """Groups predictions by architecture and scores each separately.
721
+
722
+ Parameters
723
+ ----------
724
+ df:pd.DataFrame
725
+ DataFrame containing predictions, cath codes and true sequences.
726
+ predictions: dict,
727
+ Dictionary with predictions, key is PDB+chain.
728
+ by_fragment: bool =True
729
+ If true scores only CATH fragments, if False, scores entire chain.
730
+ ignore_uncommon:bool=False
731
+ If true, skips uncommon amino acids when formating true sequence.
732
+ score_sequence:bool =False
733
+ Set to True if scoring a sequence, False if scoring a probability array.
734
+
735
+ Returns
736
+ -------
737
+ DataFrame with accuracy, similarity, recall and precision for each architecture type."""
738
+
739
+ architectures = df.drop_duplicates(subset=["class", "architecture"])[
740
+ "architecture"
741
+ ].values
742
+ classes = df.drop_duplicates(subset=["class", "architecture"])["class"].values
743
+ scores = []
744
+ names = []
745
+ assert len(classes)==len(architectures), "Number of entries in classes and architectures do not match, this is impossible."
746
+ for cls, arch in zip(classes, architectures):
747
+ accuracy, top_three, similarity, recall, precision = score(
748
+ get_pdbs(df, cls, arch),
749
+ predictions,
750
+ by_fragment,
751
+ ignore_uncommon,
752
+ )
753
+ scores.append(
754
+ [accuracy[0], top_three[0], similarity[0], recall[0], precision[0]]
755
+ )
756
+ # lookup normal names
757
+ names.append(config.architectures[f"{cls}.{arch}"])
758
+ score_frame = pd.DataFrame(
759
+ scores,
760
+ columns=["accuracy", "top3_accuracy", "similarity", "recall", "precision"],
761
+ index=[classes, architectures],
762
+ )
763
+ score_frame["name"] = names
764
+ return score_frame
765
+
766
+
767
+ def score_each(
768
+ df: pd.DataFrame,
769
+ predictions: dict,
770
+ by_fragment: bool = True,
771
+ ignore_uncommon=False,
772
+ ) -> Tuple[List[float], List[float]]:
773
+ """Calculates accuracy and recall for each protein in DataFrame separately.
774
+
775
+ Parameters
776
+ ----------
777
+ df: pd.DataFrame
778
+ DataFrame with CATH fragment info. The frame must have predicted sequence, true sequence and start/stop index of CATH fragment.
779
+ predictions: dict
780
+ Dictionary with loaded predictions.
781
+ by_fragment: bool
782
+ If true scores only CATH fragments, if False, scores entire chain.
783
+ ignore_uncommon=True
784
+ If True, ignores uncommon residues in accuracy calculations.
785
+ score_sequence=False
786
+ True if dictionary contains sequences, False if probability matrices(matrix shape n,20).
787
+
788
+ Returns
789
+ --------
790
+ accuracy: List[float]
791
+ List with accuracy for each protein in DataFrame
792
+ recall: List[float]
793
+ List with macro average recall for each protein in Dataframe."""
794
+
795
+ accuracy = []
796
+ recall = []
797
+ for i, protein in df.iterrows():
798
+ if protein.PDB + protein.chain in predictions:
799
+ start = protein.start
800
+ stop = protein.stop
801
+ predicted_sequence = predictions[protein.PDB + protein.chain]
802
+
803
+ # remove uncommon acids
804
+ if ignore_uncommon and type(protein.uncommon_index)==list:
805
+ protein_sequence = "".join(
806
+ [
807
+ x
808
+ for i, x in enumerate(protein.sequence)
809
+ if i not in protein.uncommon_index
810
+ ]
811
+ )
812
+ start = start - (np.array(protein.uncommon_index) <= start).sum()
813
+ stop = stop - (np.array(protein.uncommon_index) <= stop).sum()
814
+ else:
815
+ protein_sequence = protein.sequence
816
+
817
+ # check length
818
+ if len(protein_sequence) != len(predicted_sequence):
819
+ # prediction is multimer
820
+ if len(predicted_sequence) % len(protein_sequence) == 0:
821
+ predicted_sequence = predicted_sequence[0 : len(protein_sequence)]
822
+ else:
823
+ print(
824
+ f"{protein.PDB}{protein.chain} sequence, predicted sequence and dssp length do not match."
825
+ )
826
+ accuracy.append(np.NaN)
827
+ recall.append(np.NaN)
828
+ continue
829
+ if by_fragment:
830
+ protein_sequence = protein_sequence[start : stop + 1]
831
+ predicted_sequence = predicted_sequence[start : stop + 1]
832
+
833
+ accuracy.append(
834
+ metrics.accuracy_score(
835
+ list(protein_sequence),
836
+ list(most_likely_sequence(predicted_sequence)),
837
+ )
838
+ )
839
+ recall.append(
840
+ metrics.recall_score(
841
+ list(protein_sequence),
842
+ list(most_likely_sequence(predicted_sequence)),
843
+ average="macro",
844
+ zero_division=0,
845
+ )
846
+ )
847
+ else:
848
+ accuracy.append(np.NaN)
849
+ recall.append(np.NaN)
850
+
851
+ return accuracy, recall
852
+
853
+
854
+ def get_by_residue_metrics(
855
+ sequence: np.array, prediction: np.array,
856
+ ) -> pd.DataFrame:
857
+ """Calculates recall,precision and f1 for each amino acid.
858
+ Parameters
859
+ ----------
860
+ sequence:np.array
861
+ True sequence array with characters.
862
+ prediction:np.array
863
+ Predicted sequence, array with characters or probability matrix.
864
+
865
+ Returns
866
+ -------
867
+ entropy_frame:pd.DataFrame
868
+ DataFrame with recall, precision, f1 score, entropy and AUC for each amino acids.
869
+ """
870
+
871
+ entropy_arr = entropy(prediction, base=2, axis=1)
872
+ # calculate auc values
873
+ labels = LabelBinarizer().fit(config.acids).transform(sequence)
874
+ roc_auc = []
875
+ for i in range(len(config.acids)):
876
+ fpr, tpr, _ = metrics.roc_curve(labels[:, i], prediction[:, i])
877
+ roc_auc.append(metrics.auc(fpr, tpr))
878
+ prediction = list(most_likely_sequence(prediction))
879
+
880
+ # prevents crashing when not all amino acids are predicted
881
+ entropy_frame = pd.DataFrame(index=config.acids)
882
+ entropy_frame = entropy_frame.join(
883
+ pd.DataFrame({"sequence": prediction, "entropy": entropy_arr})
884
+ .groupby(by="sequence")
885
+ .mean()
886
+ )
887
+ prec, rec, f1, sup = metrics.precision_recall_fscore_support(sequence, prediction)
888
+
889
+ entropy_frame.loc[:, "recall"] = rec
890
+ entropy_frame.loc[:, "precision"] = prec
891
+ entropy_frame.loc[:, "f1"] = f1
892
+ entropy_frame.loc[:, "auc"] = roc_auc
893
+ return entropy_frame
894
+
895
+
896
+ def get_angles(protein: pd.Series, path_to_assemblies: Path) -> np.array:
897
+ """Gets backbone torsion angles for protein.
898
+
899
+ Parameters
900
+ ----------
901
+ protein: pd.Series
902
+ Series containing protein info.
903
+ path_to_assemblies: Path
904
+ Path to the directory with biological assemblies.
905
+ Returns
906
+ -------
907
+ torsion_angles: np.array
908
+ Array with torsion angles."""
909
+
910
+ path = path_to_assemblies / protein.PDB[1:3] / f"pdb{protein.PDB}.ent.gz"
911
+ if path.exists():
912
+ with gzip.open(path, "rb") as file:
913
+ assembly = ampal.load_pdb(file.read().decode(), path=False)
914
+ # check is assembly has multiple states, pick the first
915
+ if isinstance(assembly, ampal.AmpalContainer):
916
+ assembly = assembly[0]
917
+ chain = assembly[protein.chain]
918
+ torsion_angles = ampal.analyse_protein.measure_torsion_angles(chain)
919
+ return torsion_angles
920
+
921
+
922
+ def format_angle_sequence(
923
+ df: pd.DataFrame,
924
+ predictions: dict,
925
+ path_to_assemblies: Path,
926
+ by_fragment: bool = False,
927
+ ignore_uncommon=False,
928
+ ) -> Tuple[str, Iterable, str, List[List[float]]]:
929
+ """Gets Psi and Phi angles for all residues in predictions, can skip uncommon acids.
930
+
931
+
932
+ Parameters
933
+ ----------
934
+ df: pd.DataFrame
935
+ DataFrame with CATH fragment info. The frame must have predicted sequence, true sequence and start/stop index of CATH fragment.
936
+ predictions: dict
937
+ Dictionary with loaded predictions.
938
+ path_to_assemblies: Path
939
+ Path to the directory with biological assemblies.
940
+ by_fragment: bool
941
+ If true scores only CATH fragments, if False, scores entire chain.
942
+ ignore_uncommon=True
943
+ If True, ignores uncommon residues in accuracy calculations.
944
+
945
+ Returns
946
+ -------
947
+ sequece:str
948
+ Protein sequence.
949
+ prediction: str or np.array
950
+ Predicted protein sequence or probability matrix.
951
+ dssp: str
952
+ String with dssp data
953
+ torsion:List[List[float]]
954
+ List with torsion angles. Format:[[omega,phi,psi]].
955
+ """
956
+
957
+ sequence = ""
958
+ dssp = ""
959
+ torsion = []
960
+ prediction = np.empty([0, 20])
961
+ for i, protein in df.iterrows():
962
+ if protein.PDB + protein.chain in predictions:
963
+ start = protein.start
964
+ stop = protein.stop
965
+ predicted_sequence = predictions[protein.PDB + protein.chain]
966
+ protein_angle = get_angles(protein, path_to_assemblies)
967
+
968
+ # remove uncommon acids
969
+ if ignore_uncommon and type(protein.uncommon_index)==list:
970
+ protein_sequence = "".join(
971
+ [
972
+ x
973
+ for i, x in enumerate(protein.sequence)
974
+ if i not in protein.uncommon_index
975
+ ]
976
+ )
977
+ protein_dssp = "".join(
978
+ [
979
+ x
980
+ for i, x in enumerate(protein.dssp)
981
+ if i not in protein.uncommon_index
982
+ ]
983
+ )
984
+ protein_angle = [
985
+ x
986
+ for i, x in enumerate(protein_angle)
987
+ if i not in protein.uncommon_index
988
+ ]
989
+ # update start and stop indexes
990
+ start = start - (np.array(protein.uncommon_index) <= start).sum()
991
+ stop = stop - (np.array(protein.uncommon_index) <= stop).sum()
992
+ else:
993
+ protein_sequence = protein.sequence
994
+ protein_dssp = protein.dssp
995
+
996
+ # check length
997
+ if len(protein_sequence) != len(predicted_sequence):
998
+ # prediction is multimer
999
+ if len(predicted_sequence) % len(protein_sequence) == 0:
1000
+ predicted_sequence = predicted_sequence[0 : len(protein_sequence)]
1001
+ else:
1002
+ print(
1003
+ f"{protein.PDB}{protein.chain} sequence, predicted sequence and dssp length do not match."
1004
+ )
1005
+ continue
1006
+
1007
+ if by_fragment:
1008
+ protein_sequence = protein_sequence[start : stop + 1]
1009
+ protein_dssp = protein_dssp[start : stop + 1]
1010
+ predicted_sequence = predicted_sequence[start : stop + 1]
1011
+ protein_angle = protein_angle[start : stop + 1]
1012
+
1013
+ if (
1014
+ len(protein_sequence) == len(predicted_sequence)
1015
+ and len(protein_sequence) == len(protein_dssp)
1016
+ and len(protein_angle) == len(predicted_sequence)
1017
+ ):
1018
+ sequence += protein_sequence
1019
+ dssp += protein_dssp
1020
+ torsion += protein_angle
1021
+ prediction = np.concatenate(
1022
+ [prediction, predicted_sequence], axis=0
1023
+ )
1024
+ else:
1025
+ print(
1026
+ f"{protein.PDB}{protein.chain} sequence, predicted sequence and dssp length do not match."
1027
+ )
1028
+
1029
+ return sequence, prediction, dssp, torsion
data/benchmark/version.py ADDED
@@ -0,0 +1 @@
 
 
1
+ __version__ = "0.1_30d75dc"
data/benchmark/visualization.py ADDED
@@ -0,0 +1,1101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Functions for visualizing metrics and comparing different models"""
2
+
3
+ import pandas as pd
4
+ from benchmark import config
5
+ import ampal
6
+ from benchmark import get_cath
7
+ import gzip
8
+ from pathlib import Path
9
+ import numpy as np
10
+ import numpy as np
11
+ import matplotlib.pyplot as plt
12
+ import seaborn as sns
13
+ import matplotlib.patches as mpatches
14
+ from sklearn import metrics
15
+ import matplotlib.backends.backend_pdf
16
+ from scipy.stats import entropy
17
+ from typing import List
18
+ from benchmark import version
19
+ from scipy.stats import pearsonr
20
+
21
+ def _annotate_ampalobj_with_data_tag(
22
+ ampal_structure,
23
+ data_to_annotate,
24
+ tags,
25
+ ) -> ampal.assembly:
26
+ """
27
+ Assigns a data point to each residue equivalent to the prediction the
28
+ tag value. The original value of the tag will be reset to the minimum value
29
+ to allow for a more realistic color comparison.
30
+ Parameters
31
+ ----------
32
+ ampal_structure : ampal.Assembly or ampal.AmpalContainer
33
+ Ampal structure to be modified. If an ampal.AmpalContainer is passed,
34
+ this will take the first Assembly in the ampal.AmpalContainer `ampal_structure[0]`.
35
+ data_to_annotate : numpy.ndarray of numpy.ndarray of floats
36
+ Numpy array with data points to annotate (x, n) where x is the
37
+ numer of arrays with data points (eg, [ entropy, accuracy ] ,
38
+ x = 2n) and n is the number of residues in the structure.
39
+ tags : t.List[str]
40
+ List of string tags of the pdb object (eg. "b-factor")
41
+ Returns
42
+ -------
43
+ ampal_structure : Assembly
44
+ Ampal structure with modified B-factor and occupancy values.
45
+
46
+ Notes
47
+ -----
48
+ Leo's code.
49
+ Same as _annotate_ampalobj_with_data_tag from TIMED but can deal with missing unnatural amino acids for compatibility with EvoEF2."""
50
+
51
+ assert len(tags) == len(
52
+ data_to_annotate
53
+ ), "The number of tags to annotate and the type of data to annotate have different lengths."
54
+
55
+ if len(data_to_annotate) > 1:
56
+ assert len(data_to_annotate[0]) == len(data_to_annotate[1]), (
57
+ f"Data to annotatate has shape {len(data_to_annotate[0])} and "
58
+ f"{len(data_to_annotate[1])}. They should be the same."
59
+ )
60
+
61
+ for i, tag in enumerate(tags):
62
+ # Reset existing values:
63
+ for atom in ampal_structure.get_atoms(ligands=True, inc_alt_states=True):
64
+ atom.tags[tag] = np.min(data_to_annotate[i])
65
+
66
+ # Apply data as tag:
67
+ for i, tag in enumerate(tags):
68
+
69
+ # Check if chain is Polypeptide (it might be DNA for example...)
70
+ if isinstance(ampal_structure, ampal.Polypeptide):
71
+ if len(ampal_structure) != len(data_to_annotate[i]):
72
+ # EvoEF2 predictions drop uncommon amino acids
73
+ if len(ampal_structure) - ampal_structure.sequence.count("X") == len(
74
+ data_to_annotate[i]
75
+ ):
76
+ for residue in ampal_structure:
77
+ counter = 0
78
+ if ampal.amino_acids.get_aa_letter(residue) == "X":
79
+ continue
80
+ else:
81
+ for atom in residue:
82
+ atom.tags[tag] = data_to_annotate[i][counter]
83
+ counter += 1
84
+ else:
85
+ print("Length is not equal")
86
+ return
87
+ for residue, data_val in zip(ampal_structure, data_to_annotate[i]):
88
+ for atom in residue:
89
+ atom.tags[tag] = data_val
90
+
91
+ return ampal_structure
92
+
93
+
94
+ def show_accuracy(
95
+ df: pd.DataFrame,
96
+ pdb: str,
97
+ predictions: dict,
98
+ output: Path,
99
+ path_to_pdbs: Path,
100
+ ignore_uncommon: bool,
101
+ ) -> None:
102
+ """
103
+ Parameters
104
+ ----------
105
+ df: pd.DataFrame
106
+ CATH dataframe.
107
+ pdb: str
108
+ PDB code to visualize, format: pdb+CHAIN.
109
+ predictions: dict
110
+ Dictionary with predicted sequences, key is PDB+chain.
111
+ name: str
112
+ Location of the .pdf file, also title of the plot.
113
+ output: Path
114
+ Path to output directory.
115
+ path_to_pdbs: Path
116
+ Path to the directory with PDB files.
117
+ ignore_uncommon=True
118
+ If True, ignores uncommon residues in accuracy calculations.
119
+ score_sequence=False
120
+ True if dictionary contains sequences, False if probability matrices(matrix shape n,20)."""
121
+ accuracy = []
122
+ pdb_df = df[df.PDB == pdb]
123
+ sequence, prediction, _, _, _ = get_cath.format_sequence(
124
+ pdb_df, predictions, False, ignore_uncommon,
125
+ )
126
+
127
+ entropy_arr = entropy(prediction, base=2, axis=1)
128
+ prediction = list(get_cath.most_likely_sequence(prediction))
129
+ for resa, resb in zip(sequence, prediction):
130
+ """correct predictions are given constant score so they stand out in the figure.
131
+ e.g., spectrum q, blue_white_red, maximum=6,minimum=-6 gives nice plots. Bright red shows correct predictions
132
+ Red shades indicate substitutions with positive score, white=0, blue shades show substiutions with negative score.
133
+ cartoon putty shows nice entropy visualization."""
134
+
135
+ if resa == resb:
136
+ accuracy.append(6)
137
+ # incorrect predictions are coloured by blossum62 score.
138
+ else:
139
+ accuracy.append(get_cath.lookup_blosum62(resa, resb))
140
+ path_to_protein = path_to_pdbs / pdb[1:3] / f"pdb{pdb}.ent.gz"
141
+ with gzip.open(path_to_protein, "rb") as protein:
142
+ assembly = ampal.load_pdb(protein.read().decode(), path=False)
143
+
144
+ # Deals with structures from NMR as ampal returns Container of Assemblies
145
+ if isinstance(assembly, ampal.AmpalContainer):
146
+ warnings.warn(f"Selecting the first state from the NMR structure {assembly.id}")
147
+ assembly = assembly[0]
148
+ # select correct chain
149
+ assembly = assembly[pdb_df.chain.values[0]]
150
+
151
+ curr_annotated_structure = _annotate_ampalobj_with_data_tag(
152
+ assembly, [accuracy, entropy_arr], tags=["occupancy","bfactor"]
153
+ )
154
+ with open(output, "w") as f:
155
+ f.write(curr_annotated_structure.pdb)
156
+
157
+
158
+ def ramachandran_plot(
159
+ sequence: List[chr], prediction: List[chr], torsions: List[List[float]], name: str
160
+ ) -> None:
161
+ """Plots predicted and true Ramachandran plots for each amino acid. All plots are normalized by true residue count. Takes at least a minute to plot these, so don't plot if not neccessary.
162
+ Parameters
163
+ ----------
164
+ sequence: List[chr]
165
+ List with correctly formated (get_cath.format_format_angle_sequence()) sequence.
166
+ prediction: List[chr]
167
+ List with correctly formated predictions. Amino acid sequence, not arrays.
168
+ torsions: List[List[float]]
169
+ List wit correctly formated torsion angles.
170
+ name: str
171
+ Name and location of the figure."""
172
+
173
+ fig, ax = plt.subplots(20, 3, figsize=(15, 100))
174
+ plt.figtext(0.1, 0.99,s='Version: '+version.__version__,figure=fig,fontdict={"size": 12})
175
+ # get angles for each amino acids
176
+ for k, amino_acid in enumerate(config.acids):
177
+ predicted_angles = [
178
+ x for x, residue in zip(torsions, prediction) if residue == amino_acid
179
+ ]
180
+ predicted_psi = [
181
+ x[2] for x in predicted_angles if (x[2] != None) & (x[1] != None)
182
+ ]
183
+ predicted_phi = [
184
+ x[1] for x in predicted_angles if (x[1] != None) & (x[2] != None)
185
+ ]
186
+
187
+ true_angles = [
188
+ x for x, residue in zip(torsions, list(sequence)) if residue == amino_acid
189
+ ]
190
+ true_psi = [x[2] for x in true_angles if (x[2] != None) & (x[1] != None)]
191
+ true_phi = [x[1] for x in true_angles if (x[1] != None) & (x[2] != None)]
192
+
193
+ # make a histogram and normalize by residue count
194
+ array, xedges, yedges = [
195
+ x
196
+ for x in np.histogram2d(
197
+ predicted_psi, predicted_phi, bins=50, range=[[-180, 180], [-180, 180]]
198
+ )
199
+ ]
200
+ array = array / len(true_psi)
201
+ true_array, xedges, yedges = [
202
+ x
203
+ for x in np.histogram2d(
204
+ true_psi, true_phi, bins=50, range=[[-180, 180], [-180, 180]]
205
+ )
206
+ ]
207
+ true_array = true_array / len(true_psi)
208
+ difference = true_array - array
209
+ # get minimum and maximum counts for true and predicted sequences, use this to keep color maping in both plots identical. Easier to see overprediction.
210
+ minimum = np.amin([array, true_array])
211
+ maximum = np.amax([array, true_array])
212
+ # change 0 counts to NaN to show white space.
213
+ # make Ramachandran plot for predictions.
214
+ for i, rows in enumerate(array):
215
+ for j, cols in enumerate(rows):
216
+ if cols == 0.0:
217
+ array[i][j] = np.NaN
218
+
219
+ im = ax[k][0].imshow(
220
+ array,
221
+ interpolation="none",
222
+ origin='lower',
223
+ norm=None,
224
+ extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]],
225
+ cmap="viridis",
226
+ vmax=maximum,
227
+ vmin=minimum,
228
+ )
229
+ fig.colorbar(im, ax=ax[k][0], fraction=0.046)
230
+ ax[k][0].set_xlim(-180, 180)
231
+ ax[k][0].set_ylim(-180, 180)
232
+ ax[k][0].set_xticks(np.arange(-180, 220, 40))
233
+ ax[k][0].set_yticks(np.arange(-180, 220, 40))
234
+ ax[k][0].set_ylabel("Psi")
235
+ ax[k][0].set_xlabel("Phi")
236
+ ax[k][0].set_title(f"Predicted {amino_acid}")
237
+
238
+ # Make Ramachandran plot for true sequence.
239
+ for i, rows in enumerate(true_array):
240
+ for j, cols in enumerate(rows):
241
+ if cols == 0.0:
242
+ true_array[i][j] = np.NaN
243
+ im = ax[k][1].imshow(
244
+ true_array,
245
+ interpolation="none",
246
+ origin='lower',
247
+ norm=None,
248
+ extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]],
249
+ cmap="viridis",
250
+ vmax=maximum,
251
+ vmin=minimum,
252
+ )
253
+ fig.colorbar(im, ax=ax[k][1], fraction=0.046)
254
+ ax[k][1].set_xlim(-180, 180)
255
+ ax[k][1].set_ylim(-180, 180)
256
+ ax[k][1].set_xticks(np.arange(-180, 220, 40))
257
+ ax[k][1].set_yticks(np.arange(-180, 220, 40))
258
+ ax[k][1].set_ylabel("Psi")
259
+ ax[k][1].set_xlabel("Phi")
260
+ ax[k][1].set_title(f"True {amino_acid}")
261
+
262
+ # Make difference plots.
263
+ for i, rows in enumerate(difference):
264
+ for j, cols in enumerate(rows):
265
+ if cols == 0.0:
266
+ difference[i][j] = np.NaN
267
+
268
+ im = ax[k][2].imshow(
269
+ difference,
270
+ interpolation="none",
271
+ origin='lower',
272
+ norm=None,
273
+ extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]],
274
+ cmap="viridis",
275
+ )
276
+ fig.colorbar(im, ax=ax[k][2], fraction=0.046)
277
+ ax[k][2].set_xlim(-180, 180)
278
+ ax[k][2].set_ylim(-180, 180)
279
+ ax[k][2].set_xticks(np.arange(-180, 220, 40))
280
+ ax[k][2].set_yticks(np.arange(-180, 220, 40))
281
+ ax[k][2].set_ylabel("Psi")
282
+ ax[k][2].set_xlabel("Phi")
283
+ ax[k][2].set_title(f"True-Predicted {amino_acid}")
284
+
285
+ plt.tight_layout()
286
+ plt.savefig(name + "_Ramachandran_plot.pdf")
287
+ plt.close()
288
+
289
+
290
+ def append_zero_residues(arr: np.array) -> np.array:
291
+ """Sets missing residue count to 0. Needed for per residue metrics plot.
292
+ Parameters
293
+ ----------
294
+ arr:np.array
295
+ Array returned by np.unique() with residues and their counts.
296
+ Returns
297
+ -------
298
+ np.array with added mising residues and 0 counts."""
299
+ if len(arr[0]) != 20:
300
+ temp_dict = {res_code: res_count for res_code, res_count in zip(arr[0], arr[1])}
301
+ for residue in config.acids:
302
+ if residue not in temp_dict:
303
+ temp_dict[residue] = 0
304
+ arr = [[], []]
305
+ arr[1] = [x[1] for x in sorted(temp_dict.items())]
306
+ arr[0] = [x[0] for x in sorted(temp_dict.items())]
307
+ return arr
308
+
309
+
310
+ def make_model_summary(
311
+ df: pd.DataFrame,
312
+ predictions: dict,
313
+ name: str,
314
+ path_to_pdb: Path,
315
+ ignore_uncommon: bool = False,
316
+ ) -> None:
317
+ """
318
+ Makes a .pdf report whith model metrics.
319
+ Includes prediction bias, accuracy and macro recall for each secondary structure, accuracy and recall correlation with protein resolution, confusion matrices and accuracy, recall and f1 score for each resiude.
320
+
321
+ Parameters
322
+ ----------
323
+ df: pd.DataFrame
324
+ CATH dataframe.
325
+ predictions: dict
326
+ Dictionary with predicted sequences, key is PDB+chain.
327
+ name: str
328
+ Location of the .pdf file, also title of the plot.
329
+ path_to_pdb: Path
330
+ Path to the directory with PDB files.
331
+ ignore_uncommon=True
332
+ If True, ignores uncommon residues in accuracy calculations.
333
+ """
334
+
335
+ fig, ax = plt.subplots(ncols=5, nrows=5, figsize=(30, 40))
336
+ #print version
337
+ plt.figtext(0.1, 0.99,s='Version: '+version.__version__,figure=fig,fontdict={"size": 12})
338
+ # show residue distribution and confusion matrix
339
+ (
340
+ sequence,
341
+ prediction,
342
+ _,
343
+ true_secondary,
344
+ prediction_secondary,
345
+ ) = get_cath.format_sequence(
346
+ df,
347
+ predictions,
348
+ ignore_uncommon=ignore_uncommon,
349
+ by_fragment=False,
350
+ )
351
+ # get info about each residue
352
+ by_residue_frame = get_cath.get_by_residue_metrics(
353
+ sequence, prediction
354
+ )
355
+ # convert probability array into list of characters.
356
+ prediction = list(get_cath.most_likely_sequence(prediction))
357
+ prediction_secondary = [
358
+ list(get_cath.most_likely_sequence(ss_seq))
359
+ for ss_seq in prediction_secondary
360
+ ]
361
+
362
+ seq = append_zero_residues(np.unique(sequence, return_counts=True))
363
+
364
+ pred = append_zero_residues(np.unique(prediction, return_counts=True))
365
+ index = np.arange(len(seq[0]))
366
+ # calculate prediction bias
367
+ residue_bias = pred[1] / sum(pred[1]) - seq[1] / sum(seq[1])
368
+ #keep max bias to scale all graphs
369
+ max_bias=max(residue_bias)
370
+ ax[3][4].bar(x=index, height=residue_bias, width=0.8, align="center")
371
+ ax[3][4].set_ylabel("Prediction bias")
372
+ ax[3][4].set_xlabel("Amino acids")
373
+ for e, dif in enumerate(residue_bias):
374
+ if dif < 0:
375
+ y_coord = 0
376
+ else:
377
+ y_coord = dif
378
+ ax[3][4].text(
379
+ index[e],
380
+ y_coord*1.05,
381
+ f"{dif:.3f}",
382
+ ha="center",
383
+ va="bottom",
384
+ rotation="vertical",
385
+ )
386
+
387
+ ax[3][4].set_xticks(index)
388
+ ax[3][4].set_xticklabels(
389
+ pred[0], fontdict={"horizontalalignment": "center", "size": 12}
390
+ )
391
+ ax[3][4].set_ylabel("Prediction bias")
392
+ ax[3][4].set_xlabel("Amino acids")
393
+ ax[3][4].set_title("All structures")
394
+ ax[3][4].set_ylim(top=1.0)
395
+
396
+ cm = metrics.confusion_matrix(sequence, prediction, labels=seq[0])
397
+ cm = cm.astype("float") / cm.sum(axis=1)[:, np.newaxis]
398
+
399
+ im = ax[4][4].imshow(cm, vmin=0, vmax=1)
400
+ ax[4][4].set_xlabel("Predicted")
401
+ ax[4][4].set_xticks(range(20))
402
+ ax[4][4].set_xticklabels(config.acids)
403
+ ax[4][4].set_ylabel("True")
404
+ ax[4][4].set_yticks(range(20))
405
+ ax[4][4].set_yticklabels(config.acids)
406
+ # Plot Color Bar:
407
+ fig.colorbar(im, ax=ax[4][4], fraction=0.046)
408
+
409
+ # plot prediction bias
410
+ ss_names = ["Helices", "Sheets", "Structured loops", "Random"]
411
+ for i, ss in enumerate(ss_names):
412
+ seq = append_zero_residues(np.unique(true_secondary[i], return_counts=True))
413
+ pred = append_zero_residues(
414
+ np.unique(prediction_secondary[i], return_counts=True)
415
+ )
416
+ residue_bias = pred[1] / sum(pred[1]) - seq[1] / sum(seq[1])
417
+ if max(residue_bias)>max_bias:
418
+ max_bias=max(residue_bias)
419
+ ax[3][i].bar(x=index, height=residue_bias, width=0.8, align="center")
420
+ ax[3][i].set_xticks(index)
421
+ ax[3][i].set_xticklabels(
422
+ pred[0], fontdict={"horizontalalignment": "center", "size": 12}
423
+ )
424
+ ax[3][i].set_ylabel("Prediction bias")
425
+ ax[3][i].set_xlabel("Amino acids")
426
+ ax[3][i].set_title(ss)
427
+ ax[3][i].set_ylim(top=1.0)
428
+ for e, dif in enumerate(residue_bias):
429
+ if dif < 0:
430
+ y_coord = 0
431
+ else:
432
+ y_coord = dif
433
+ ax[3][i].text(
434
+ index[e],
435
+ y_coord*1.05,
436
+ f"{dif:.3f}",
437
+ ha="center",
438
+ va="bottom",
439
+ rotation="vertical",
440
+ )
441
+ #plot confusion matrix
442
+ cm = metrics.confusion_matrix(
443
+ true_secondary[i], prediction_secondary[i], labels=seq[0]
444
+ )
445
+ cm = cm.astype("float") / cm.sum(axis=1)[:, np.newaxis]
446
+ im = ax[4][i].imshow(cm, vmin=0, vmax=1)
447
+ ax[4][i].set_xlabel("Predicted")
448
+ ax[4][i].set_xticks(range(20))
449
+ ax[4][i].set_xticklabels(config.acids)
450
+ ax[4][i].set_ylabel("True")
451
+ ax[4][i].set_yticks(range(20))
452
+ ax[4][i].set_yticklabels(config.acids)
453
+ # Plot Color Bar:
454
+ fig.colorbar(im, ax=ax[4][i], fraction=0.046)
455
+
456
+ #scale all bias plots so that they have the same y-axis.
457
+ for i in range(5):
458
+ ax[3][i].set_ylim(ymax=max_bias*1.1)
459
+
460
+ # show accuracy,recall,similarity, precision and top3
461
+ index = np.array([0, 1, 2, 3, 4])
462
+
463
+ accuracy, top_three, similarity, recall, precision = get_cath.score(
464
+ df, predictions, False, ignore_uncommon,
465
+ )
466
+ # show accuracy
467
+ ax[0][0].bar(x=index, height=accuracy, width=0.8, align="center")
468
+
469
+ # show recall
470
+ ax[0][1].bar(x=index, height=recall, width=0.8, align="center")
471
+ ax[0][3].bar(x=index, height=precision, width=0.8, align="center")
472
+ ax[0][4].bar(x=index, height=similarity, width=0.8, align="center")
473
+ # add values to the plot
474
+ # show top_3 accuracy if available
475
+ if not np.isnan(top_three[0]):
476
+ ax[0][0].scatter(x=index, y=top_three, marker="_", s=50, color="blue")
477
+ ax[0][0].vlines(x=index, ymin=0, ymax=top_three, linewidth=2)
478
+ for e, value in enumerate(accuracy):
479
+ ax[0][0].text(
480
+ index[e],
481
+ top_three[e]+0.01,
482
+ f"{value:.3f}",
483
+ ha="center",
484
+ va="bottom",
485
+ rotation="vertical",
486
+ )
487
+ else:
488
+ for e, value in enumerate(accuracy):
489
+ ax[0][0].text(
490
+ index[e],
491
+ value+0.01,
492
+ f"{value:.3f}",
493
+ ha="center",
494
+ va="bottom",
495
+ rotation="vertical",
496
+ )
497
+ for e, value in enumerate(recall):
498
+ ax[0][1].text(
499
+ index[e],
500
+ value+0.01,
501
+ f"{value:.3f}",
502
+ ha="center",
503
+ va="bottom",
504
+ rotation="vertical",
505
+ )
506
+ for e, value in enumerate(precision):
507
+ ax[0][3].text(
508
+ index[e],
509
+ value * 1.05,
510
+ f"{value:.3f}",
511
+ ha="center",
512
+ va="bottom",
513
+ rotation="vertical",
514
+ )
515
+ for e, value in enumerate(similarity):
516
+ ax[0][4].text(
517
+ index[e],
518
+ value+0.01,
519
+ f"{value:.3f}",
520
+ ha="center",
521
+ va="bottom",
522
+ rotation="vertical",
523
+ )
524
+ # show difference
525
+
526
+ difference = np.array(accuracy) - np.array(recall)
527
+ maximum = np.amax(difference)
528
+ ax[0][2].bar(x=index, height=difference, width=0.8, align="center")
529
+ for e, dif in enumerate(difference):
530
+ if dif < 0:
531
+ y_coord = 0
532
+ else:
533
+ y_coord = dif
534
+ ax[0][2].text(
535
+ index[e],
536
+ y_coord+0.01,
537
+ f"{dif:.3f}",
538
+ ha="center",
539
+ va="bottom",
540
+ rotation="vertical",
541
+ )
542
+ # Title, label, ticks and limits
543
+ ax[0][0].set_ylabel("Accuracy")
544
+ ax[0][0].set_xticks(index)
545
+ ax[0][0].set_xticklabels(
546
+ ["All structures", "Helices", "Sheets", "Structured loops", "Random"],
547
+ rotation=90,
548
+ fontdict={"horizontalalignment": "center", "size": 12},
549
+ )
550
+ ax[0][0].set_ylim(0, 1)
551
+ ax[0][0].set_xlim(-0.7, index[-1] + 1)
552
+
553
+ ax[0][1].set_ylabel("MacroRecall")
554
+ ax[0][1].set_xticks(index)
555
+ ax[0][1].set_xticklabels(
556
+ ["All structures", "Helices", "Sheets", "Structured loops", "Random"],
557
+ rotation=90,
558
+ fontdict={"horizontalalignment": "center", "size": 12},
559
+ )
560
+ ax[0][1].set_ylim(0, 1)
561
+ ax[0][1].set_xlim(-0.7, index[-1] + 1)
562
+
563
+ ax[0][2].set_ylabel("Accuracy-MacroRecall")
564
+ ax[0][2].set_xticks(index)
565
+ ax[0][2].set_xticklabels(
566
+ ["All structures", "Helices", "Sheets", "Structured loops", "Random"],
567
+ rotation=90,
568
+ fontdict={"horizontalalignment": "center", "size": 12},
569
+ )
570
+ ax[0][2].set_xlim(-0.7, index[-1] + 1)
571
+ ax[0][2].axhline(0, -0.3, index[-1] + 1, color="k", lw=1)
572
+ ax[0][2].set_ylim(ymax=maximum * 1.2)
573
+
574
+ ax[0][3].set_ylabel("MacroPrecision")
575
+ ax[0][3].set_xticks(index)
576
+ ax[0][3].set_xticklabels(
577
+ ["All structures", "Helices", "Sheets", "Structured loops", "Random"],
578
+ rotation=90,
579
+ fontdict={"horizontalalignment": "center", "size": 12},
580
+ )
581
+ ax[0][3].set_ylim(0, 1)
582
+ ax[0][3].set_xlim(-0.7, index[-1] + 1)
583
+
584
+ ax[0][4].set_ylabel("Similarity")
585
+ ax[0][4].set_xticks(index)
586
+ ax[0][4].set_xticklabels(
587
+ ["All structures", "Helices", "Sheets", "Structured loops", "Random"],
588
+ rotation=90,
589
+ fontdict={"horizontalalignment": "center", "size": 12},
590
+ )
591
+ ax[0][4].set_ylim(0, 1)
592
+ ax[0][4].set_xlim(-0.7, index[-1] + 1)
593
+
594
+ colors = sns.color_palette("viridis", 4)
595
+ # combine classes 4 and 6 to simplify the graph
596
+ colors = {1: colors[0], 2: colors[1], 3: colors[2], 4: colors[3], 6: colors[3]}
597
+ class_color = [colors[x] for x in df["class"].values]
598
+ # show accuracy and macro recall resolution distribution
599
+ accuracy, recall = get_cath.score_each(
600
+ df,
601
+ predictions,
602
+ ignore_uncommon=ignore_uncommon,
603
+ by_fragment=True,
604
+ )
605
+ #this is [nan,nan,...] if NMR.
606
+ resolution = get_cath.get_resolution(df, path_to_pdb)
607
+ #NMR does not have resolution, full NMR set would crash np.polyfit.
608
+ if not np.isnan(resolution).all():
609
+
610
+ # calculate Pearson correlation between accuracy/recall and resolution.
611
+ res_df = pd.DataFrame({'res': resolution, 'recall': recall, 'accuracy': accuracy}).dropna()
612
+ corr=res_df.corr().to_numpy()
613
+ #linear fit
614
+ m, b = np.polyfit(res_df['res'], res_df['accuracy'], 1)
615
+ ax[1][3].plot(res_df['res'], m*res_df['res'] + b, color='r')
616
+ ax[1][3].scatter(resolution, accuracy, color=class_color, alpha=0.7)
617
+ # Title, label, ticks and limits
618
+ ax[1][3].set_xlabel("Resolution, A")
619
+ ax[1][3].set_ylabel("Accuracy")
620
+ ax[1][3].set_title(f"Pearson correlation: {corr[0][2]:.3f}")
621
+ m, b = np.polyfit(res_df['res'], res_df['recall'], 1)
622
+ ax[1][4].plot(res_df['res'], m*res_df['res'] + b, color='r')
623
+ ax[1][4].scatter(resolution, recall, color=class_color, alpha=0.7)
624
+ ax[1][4].set_title(f"Pearson correlation: {corr[0][1]:.3f}")
625
+ ax[1][4].set_ylabel("MacroRecall")
626
+ ax[1][4].set_xlabel("Resolution, A")
627
+ # make a legend
628
+ patches = [
629
+ mpatches.Patch(color=colors[x], label=config.classes[x]) for x in config.classes
630
+ ]
631
+ ax[1][4].legend(loc=1, handles=patches, prop={"size": 9})
632
+ ax[1][3].legend(loc=1, handles=patches, prop={"size": 9})
633
+
634
+ # show per residue metrics about the model
635
+ gs = ax[0, 0].get_gridspec()
636
+ # show per residue entropy
637
+ ax[2][0].bar(by_residue_frame.index, by_residue_frame.entropy)
638
+ ax[2][0].set_ylabel("Entropy")
639
+ ax[2][0].set_xlabel("Amino acids")
640
+
641
+ # make one big subplot
642
+ for a in ax[2, 1:]:
643
+ a.remove()
644
+ ax_right = fig.add_subplot(gs[2, 1:])
645
+ index = np.arange(len(by_residue_frame.index))
646
+ # show recall,precision and f1
647
+ for i, metric in enumerate(["recall", "precision", "f1"]):
648
+ ax_right.bar(
649
+ index + i * 0.3, height=by_residue_frame[metric], width=0.3, label=metric
650
+ )
651
+ # add values to the plot
652
+ for j, value in enumerate(by_residue_frame[metric]):
653
+ ax_right.text(
654
+ index[j] + i * 0.3,
655
+ value + 0.05,
656
+ f"{value:.3f}",
657
+ ha="center",
658
+ va="bottom",
659
+ rotation="vertical",
660
+ )
661
+ ax_right.legend()
662
+ ax_right.set_xticks(index + 0.3)
663
+ ax_right.set_xticklabels(
664
+ by_residue_frame.index, fontdict={"horizontalalignment": "center", "size": 12}
665
+ )
666
+ ax_right.set_xlim(index[0] - 0.3, index[-1] + 1)
667
+ ax_right.set_ylim(0, 1)
668
+
669
+ #show auc values
670
+ ax[1][0].bar(by_residue_frame.index, by_residue_frame.auc)
671
+ ax[1][0].set_ylabel("AUC")
672
+ ax[1][0].set_xlabel("Amino acids")
673
+ ax[1][0].set_ylim(0, 1)
674
+ #Remove empty subplots.
675
+ ax[1][1].remove()
676
+ ax[1][2].remove()
677
+
678
+
679
+
680
+ plt.suptitle(name, fontsize="xx-large")
681
+ fig.tight_layout(rect=[0, 0.03, 1, 0.98])
682
+ fig.savefig(name + ".pdf")
683
+ plt.close()
684
+
685
+
686
+ def compare_model_accuracy(
687
+ df: pd.DataFrame,
688
+ model_scores: List[dict],
689
+ model_labels: List[str],
690
+ location: Path,
691
+ ignore_uncommon: List[bool],
692
+ ) -> None:
693
+ """
694
+ Compares all the models in model_scores.
695
+ .pdf report contains accuracy, macro average and similarity scores for each CATH architecture and secondary structure type.
696
+
697
+ Parameters
698
+ ----------
699
+
700
+ df: pd.DataFrame
701
+ CATH dataframe.
702
+ model_scores: List[dict]
703
+ List with dictionary with predicted sequences.
704
+ model_labels: List[str]
705
+ List with model names corresponding to dictionaries in model_scores.
706
+ location:Path
707
+ Location where to store the .pdf file.
708
+ ignore_uncommon=List[bool]
709
+ If True, ignores uncommon residues in accuracy calculations. Required for EvoEF2."""
710
+
711
+ models = []
712
+
713
+ #remove .csv extenstion from labels
714
+ model_labels=[x[:-4] for x in model_labels]
715
+
716
+ for model, ignore in zip(model_scores, ignore_uncommon):
717
+ models.append(
718
+ get_cath.score_by_architecture(
719
+ df,
720
+ model,
721
+ ignore_uncommon=ignore,
722
+ by_fragment=True,
723
+ )
724
+ )
725
+
726
+ # Plot CATH architectures
727
+ minimum = 0
728
+ maximum = 0
729
+ colors = sns.color_palette()
730
+ # combine classes 4 and 6 to make plots nicer. Works with any number of CATH classes.
731
+ class_key = [x[0] for x in models[0].index]
732
+ class_key = list(dict.fromkeys(class_key))
733
+ if 4 in class_key and 6 in class_key:
734
+ class_key = [x for x in class_key if x != 4 and x != 6]
735
+ class_key.append([4, 6])
736
+ # calculate subplot ratios so that classes with more architectures have more space.
737
+ ratios = [models[0].loc[class_key[i]].shape[0] for i in range(len(class_key))]
738
+ fig, ax = plt.subplots(
739
+ 5,
740
+ len(class_key),
741
+ figsize=(12 * len(class_key), 20),
742
+ gridspec_kw={"width_ratios": ratios},
743
+ squeeze=False,
744
+ )
745
+ plt.figtext(0.1, 0.99,s='Version: '+version.__version__,figure=fig,fontdict={"size": 12})
746
+ width=0.8/len(models)
747
+ for i in range(len(class_key)):
748
+ index = np.arange(0, models[0].loc[class_key[i]].shape[0])
749
+ for j, frame in enumerate(models):
750
+ value_accuracy = frame.loc[class_key[i]].accuracy.values
751
+ value_recall = frame.loc[class_key[i]].recall.values
752
+ value_similarity = frame.loc[class_key[i]].similarity.values
753
+ value_top3=frame.loc[class_key[i]].top3_accuracy.values
754
+ # show accuracy
755
+ ax[0][i].bar(
756
+ x=index + j * width,
757
+ height=value_accuracy,
758
+ width=width,
759
+ align="center",
760
+ color=colors[j],
761
+ label=model_labels[j],
762
+ )
763
+ # show top3 accuracy if it exists
764
+ if not np.isnan(value_top3[0]):
765
+ ax[0][i].scatter(
766
+ x=index + j * width,
767
+ y=value_top3,
768
+ marker="_",
769
+ s=50,
770
+ color=colors[j],
771
+ )
772
+ ax[0][i].vlines(
773
+ x=index + j * width,
774
+ ymin=0,
775
+ ymax=value_top3,
776
+ color=colors[j],
777
+ linewidth=2,
778
+ )
779
+ for e, accuracy in enumerate(value_accuracy):
780
+ ax[0][i].text(
781
+ index[e] + j * width,
782
+ value_top3[e] + 0.01,
783
+ f"{accuracy:.3f}",
784
+ ha="center",
785
+ va="bottom",
786
+ rotation="vertical",
787
+ fontdict={"size": 7},
788
+ )
789
+ else:
790
+ for e, accuracy in enumerate(value_accuracy):
791
+ ax[0][i].text(
792
+ index[e] + j * width,
793
+ accuracy + 0.01,
794
+ f"{accuracy:.3f}",
795
+ ha="center",
796
+ va="bottom",
797
+ rotation="vertical",
798
+ fontdict={"size": 7},
799
+ )
800
+ # show recall
801
+ ax[1][i].bar(
802
+ x=index + j * width,
803
+ height=value_recall,
804
+ width=width,
805
+ align="center",
806
+ color=colors[j],
807
+ )
808
+ for e, recall in enumerate(value_recall):
809
+ ax[1][i].text(
810
+ index[e] + j * width,
811
+ recall+0.01,
812
+ f"{recall:.3f}",
813
+ ha="center",
814
+ va="bottom",
815
+ rotation="vertical",
816
+ fontdict={"size": 7},
817
+ )
818
+
819
+
820
+
821
+ # show similarity scores
822
+ ax[2][i].bar(
823
+ x=index + j * width,
824
+ height=value_similarity,
825
+ width=width,
826
+ align="center",
827
+ color=colors[j],
828
+ )
829
+ for e, similarity in enumerate(value_similarity):
830
+ ax[2][i].text(
831
+ index[e] + j * width,
832
+ similarity+0.01,
833
+ f"{similarity:.3f}",
834
+ ha="center",
835
+ va="bottom",
836
+ rotation="vertical",
837
+ fontdict={"size": 7},
838
+ )
839
+ # show accuracy-macro recall
840
+ difference = value_accuracy - value_recall
841
+ if np.amin(difference) < minimum:
842
+ minimum = np.amin(difference)
843
+ if np.amax(difference) > maximum:
844
+ maximum = np.amax(difference)
845
+ ax[3][i].bar(
846
+ x=index + j * width,
847
+ height=difference,
848
+ width=width,
849
+ align="center",
850
+ color=colors[j],
851
+ )
852
+ for e, dif in enumerate(difference):
853
+ if dif < 0:
854
+ y_coord = 0
855
+ else:
856
+ y_coord = dif
857
+ ax[3][i].text(
858
+ index[e] + j * width,
859
+ y_coord + 0.01,
860
+ f"{dif:.3f}",
861
+ ha="center",
862
+ va="bottom",
863
+ rotation="vertical",
864
+ fontdict={"size": 7},
865
+ )
866
+
867
+ # Title, Label, Ticks and Ylim
868
+ ax[0][i].set_title(config.classes[i + 1], fontdict={"size": 22})
869
+ ax[1][i].set_title(config.classes[i + 1], fontdict={"size": 22})
870
+ ax[2][i].set_title(config.classes[i + 1], fontdict={"size": 22})
871
+ ax[3][i].set_title(config.classes[i + 1], fontdict={"size": 22})
872
+ ax[0][i].set_ylabel("Accuracy")
873
+ ax[1][i].set_ylabel("MacroRecall")
874
+ ax[2][i].set_ylabel("Similarity")
875
+ ax[3][i].set_ylabel("Accuracy-MacroRecall")
876
+ ax[0][i].set_xticks(index)
877
+ ax[0][i].set_xticklabels(
878
+ frame.loc[class_key[i]].name,
879
+ rotation=90,
880
+ fontdict={"horizontalalignment": "center", "size": 12},
881
+ )
882
+ ax[0][i].set_ylim(0, 1)
883
+ ax[0][i].set_xlim(-0.3, index[-1] + 1)
884
+ ax[1][i].set_xticks(index)
885
+ ax[1][i].set_xticklabels(
886
+ frame.loc[class_key[i]].name,
887
+ rotation=90,
888
+ fontdict={"horizontalalignment": "center", "size": 12},
889
+ )
890
+ ax[1][i].set_ylim(0, 1)
891
+ ax[1][i].set_xlim(-0.3, index[-1] + 1)
892
+ ax[2][i].set_xticks(index)
893
+ ax[2][i].set_xticklabels(
894
+ frame.loc[class_key[i]].name,
895
+ rotation=90,
896
+ fontdict={"horizontalalignment": "center", "size": 12},
897
+ )
898
+ ax[2][i].set_ylim(0, 1)
899
+ ax[2][i].set_xlim(-0.3, index[-1] + 1)
900
+ ax[3][i].set_xticks(index)
901
+ ax[3][i].set_xticklabels(
902
+ frame.loc[class_key[i]].name,
903
+ rotation=90,
904
+ fontdict={"horizontalalignment": "center", "size": 12},
905
+ )
906
+ ax[3][i].hlines(0, -0.3, index[-1] + 1, colors="k", lw=1)
907
+ ax[3][i].set_xlim(-0.3, index[-1] + 1)
908
+ # Make yaxis in difference plots equal to get a nice graph.
909
+ for x in range(len(ax[3])):
910
+ ax[3][x].set_ylim(minimum * 1.2, maximum * 1.2)
911
+ handles, labels = ax[0][0].get_legend_handles_labels()
912
+ ax[4][0].legend(handles, labels, loc=1, prop={"size": 12},ncol=len(labels))
913
+ ax[4][0].set_axis_off()
914
+ for x in range(1, len(class_key)):
915
+ ax[4][x].remove()
916
+ fig.tight_layout()
917
+
918
+ # Plot secondary structures
919
+ maximum = 0
920
+ minimum = 0
921
+ fig_secondary, ax_secondary = plt.subplots(2, 2, figsize=(24,12))
922
+ index = np.array([0, 1, 2, 3, 4])
923
+ for j, model in enumerate(model_scores):
924
+ accuracy, top_three, similarity, recall, precision = get_cath.score(
925
+ df, model, False, ignore_uncommon[j],
926
+ )
927
+ # show accuracy
928
+ ax_secondary[0][0].bar(
929
+ x=index + j * width,
930
+ height=accuracy,
931
+ width=width,
932
+ align="center",
933
+ color=colors[j],
934
+ label=model_labels[j],
935
+ )
936
+
937
+ # show recall
938
+ ax_secondary[0][1].bar(
939
+ x=index + j * width,
940
+ height=recall,
941
+ width=width,
942
+ align="center",
943
+ color=colors[j],
944
+ label=model_labels[j],
945
+ )
946
+ # show similarity score
947
+ ax_secondary[1][1].bar(
948
+ x=index + j * width,
949
+ height=similarity,
950
+ width=width,
951
+ align="center",
952
+ color=colors[j],
953
+ label=model_labels[j],
954
+ )
955
+ # show top three accuracy if exists
956
+ if not np.isnan(top_three[0]):
957
+ ax_secondary[0][0].scatter(
958
+ x=index + j * width, y=top_three, marker="_", s=50, color=colors[j]
959
+ )
960
+ ax_secondary[0][0].vlines(
961
+ x=index + j * width, ymin=0, ymax=top_three, color=colors[j], linewidth=2
962
+ )
963
+ # add accuracy values to the plot
964
+ for e, value in enumerate(accuracy):
965
+ ax_secondary[0][0].text(
966
+ index[e] + j * width,
967
+ top_three[e] + 0.01,
968
+ f"{value:.3f}",
969
+ ha="center",
970
+ va="bottom",
971
+ rotation="vertical",
972
+ fontdict={"size": 12},
973
+ )
974
+ else:
975
+ for e, value in enumerate(accuracy):
976
+ ax_secondary[0][0].text(
977
+ index[e] + j * width,
978
+ value + 0.01,
979
+ f"{value:.3f}",
980
+ ha="center",
981
+ va="bottom",
982
+ rotation="vertical",
983
+ fontdict={"size": 12},
984
+ )
985
+ #add other values to the plots
986
+ for e, value in enumerate(recall):
987
+ ax_secondary[0][1].text(
988
+ index[e] + j * width,
989
+ value+0.01,
990
+ f"{value:.3f}",
991
+ ha="center",
992
+ va="bottom",
993
+ rotation="vertical",
994
+ fontdict={"size": 12},
995
+ )
996
+ for e, value in enumerate(similarity):
997
+ ax_secondary[1][1].text(
998
+ index[e] + j * width,
999
+ value+0.01,
1000
+ f"{value:.3f}",
1001
+ ha="center",
1002
+ va="bottom",
1003
+ rotation="vertical",
1004
+ fontdict={"size": 12},
1005
+ )
1006
+ # show difference
1007
+ difference = np.array(accuracy) - np.array(recall)
1008
+ if np.amin(difference) < minimum:
1009
+ minimum = np.amin(difference)
1010
+ if np.amax(difference) > maximum:
1011
+ maximum = np.amax(difference)
1012
+ ax_secondary[1][0].bar(
1013
+ x=index + j * width,
1014
+ height=difference,
1015
+ width=width,
1016
+ align="center",
1017
+ color=colors[j],
1018
+ )
1019
+ for e, dif in enumerate(difference):
1020
+ if dif < 0:
1021
+ y_coord = 0
1022
+ else:
1023
+ y_coord = dif
1024
+ ax_secondary[1][0].text(
1025
+ e + j * width,
1026
+ y_coord + 0.01,
1027
+ f"{dif:.3f}",
1028
+ ha="center",
1029
+ va="bottom",
1030
+ rotation="vertical",
1031
+ fontdict={"size": 12},
1032
+ )
1033
+ # Title, labels, ticks and limits
1034
+ fig_secondary.suptitle("Secondary structure", fontdict={"size": 22})
1035
+ ax_secondary[0][0].set_ylabel("Accuracy")
1036
+ ax_secondary[0][0].set_xticks([0, 1, 2, 3, 4])
1037
+ ax_secondary[0][0].set_xticklabels(
1038
+ ["All structures", "Helices", "Sheets", "Structured loops", "Random"],
1039
+ rotation=90,
1040
+ fontdict={"horizontalalignment": "center", "size": 12},
1041
+ )
1042
+ ax_secondary[0][0].set_ylim(0, 1)
1043
+ # leave some space from the sides to make it look nicer.
1044
+ ax_secondary[0][0].set_xlim(-0.3, 5)
1045
+
1046
+ ax_secondary[0][1].set_ylabel("MacroRecall")
1047
+ ax_secondary[0][1].set_xticks([0, 1, 2, 3, 4])
1048
+ ax_secondary[0][1].set_xticklabels(
1049
+ ["All structures", "Helices", "Sheets", "Structured loops", "Random"],
1050
+ rotation=90,
1051
+ fontdict={"horizontalalignment": "center", "size": 12},
1052
+ )
1053
+ ax_secondary[0][1].set_ylim(0, 1)
1054
+ ax_secondary[0][1].set_xlim(-0.3, 5)
1055
+
1056
+ ax_secondary[1][1].set_ylabel("Similarity")
1057
+ ax_secondary[1][1].set_xticks([0, 1, 2, 3, 4])
1058
+ ax_secondary[1][1].set_xticklabels(
1059
+ ["All structures", "Helices", "Sheets", "Structured loops", "Random"],
1060
+ rotation=90,
1061
+ fontdict={"horizontalalignment": "center", "size": 12},
1062
+ )
1063
+ ax_secondary[1][1].set_ylim(0, 1)
1064
+ ax_secondary[1][1].set_xlim(-0.3, 5)
1065
+
1066
+ ax_secondary[1][0].set_ylabel("Accuracy-MacroRecall")
1067
+ ax_secondary[1][0].set_xticks([0, 1, 2, 3, 4])
1068
+ ax_secondary[1][0].set_xticklabels(
1069
+ ["All structures", "Helices", "Sheets", "Structured loops", "Random"],
1070
+ rotation=90,
1071
+ fontdict={"horizontalalignment": "center", "size": 12},
1072
+ )
1073
+ ax_secondary[1][0].set_xlim(-0.3, 5)
1074
+ ax_secondary[1][0].axhline(0, -0.3, index[-1] + 1, color="k", lw=1)
1075
+ # make y axis in difference plots equal to get nicer graphs.
1076
+ ax_secondary[1][0].set_ylim(ymax=maximum * 1.2)
1077
+ fig_secondary.tight_layout()
1078
+
1079
+ fig_corr,ax_corr=plt.subplots(figsize=(8.27,8.27))
1080
+ #plot covarience between models
1081
+ cov=pd.concat([x['accuracy'] for x in models], axis=1)
1082
+ corr=cov.corr().to_numpy()
1083
+ im = ax_corr.imshow(corr)
1084
+ ax_corr.set_yticks(range(len(models)))
1085
+ ax_corr.set_yticklabels(model_labels,)
1086
+ ax_corr.set_xticks(range(len(models)))
1087
+ ax_corr.set_xticklabels(model_labels,rotation = 90)
1088
+ fig_corr.colorbar(im, ax=ax_corr, fraction=0.046)
1089
+ #add text
1090
+ for i in range(len(models)):
1091
+ for j in range(len(models)):
1092
+ text = ax_corr.text(j, i, f"{corr[i, j]:.2f}",ha="center", va="center", color="w")
1093
+ fig_corr.tight_layout()
1094
+ pdf = matplotlib.backends.backend_pdf.PdfPages(location / "Comparison_summary.pdf")
1095
+
1096
+ pdf.savefig(fig)
1097
+ pdf.savefig(fig_secondary)
1098
+ pdf.savefig(fig_corr)
1099
+ pdf.close()
1100
+ plt.close()
1101
+
data/dataset_visualization/crystal_structure_set.pdf ADDED
Binary file (31.2 kB). View file
 
data/dataset_visualization/crystal_structure_set.txt ADDED
@@ -0,0 +1,595 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 1xg0C
2
+ 3g3zA
3
+ 3rf0A
4
+ 4i5jA
5
+ 2ptrA
6
+ 3f0cA
7
+ 4a5uB
8
+ 2p57A
9
+ 2q0oC
10
+ 6er6A
11
+ 1h32A
12
+ 3e3vA
13
+ 3cxbA
14
+ 1dvoA
15
+ 5dicA
16
+ 2bnmA
17
+ 4pfoA
18
+ 2ebfX
19
+ 3giaA
20
+ 1a41A
21
+ 3cexA
22
+ 4ebbA
23
+ 3jrtA
24
+ 3wfdB
25
+ 4v1gA
26
+ 3qb9A
27
+ 3abhA
28
+ 3nvoA
29
+ 2o1kA
30
+ 5x56A
31
+ 2ra1A
32
+ 4adzA
33
+ 2p6vA
34
+ 3k4iA
35
+ 4lctA
36
+ 4adyA
37
+ 4zhbA
38
+ 4p6zG
39
+ 4nq0A
40
+ 3dadA
41
+ 2vq2A
42
+ 4dloA
43
+ 2of3A
44
+ 4y5jA
45
+ 2pm7A
46
+ 2hr2A
47
+ 3ro3A
48
+ 3bqoA
49
+ 3ut4A
50
+ 2yhcA
51
+ 4k6jA
52
+ 3iisM
53
+ 5agdA
54
+ 2fbaA
55
+ 3e7jA
56
+ 1v7wA
57
+ 3a0oA
58
+ 4wu0A
59
+ 4ozwA
60
+ 4cj0A
61
+ 1gxmA
62
+ 5m7yA
63
+ 4fnvA
64
+ 5gzkA
65
+ 4ayoA
66
+ 3wkgA
67
+ 3vsnA
68
+ 2jg0A
69
+ 4j5tA
70
+ 4ktpA
71
+ 4mqwA
72
+ 5lf2A
73
+ 5mriA
74
+ 5ol4B
75
+ 1bx7A
76
+ 3ca7A
77
+ 3tvjA
78
+ 3tbdA
79
+ 1uzkA
80
+ 5bq8A
81
+ 3klkA
82
+ 1b8kA
83
+ 1v6pA
84
+ 4hquA
85
+ 4k8wA
86
+ 6a2qA
87
+ 1lpbA
88
+ 3hrzB
89
+ 6fmeB
90
+ 2aydA
91
+ 2ra8A
92
+ 4fzqA
93
+ 3d4uB
94
+ 3wwlA
95
+ 2r01A
96
+ 1lslA
97
+ 3f3fC
98
+ 2q4zA
99
+ 2de6A
100
+ 3d9xA
101
+ 2hjeA
102
+ 3mcbB
103
+ 2y8nB
104
+ 3witA
105
+ 1ya5T
106
+ 2dyiA
107
+ 3kyfA
108
+ 2v76A
109
+ 2e12A
110
+ 1g3pA
111
+ 4o06A
112
+ 3fb9A
113
+ 2p38A
114
+ 1igqA
115
+ 4hhvA
116
+ 3teeA
117
+ 5j3tA
118
+ 5h3xA
119
+ 3zbdA
120
+ 5d7uA
121
+ 5zcjC
122
+ 5u1mA
123
+ 1wthD
124
+ 4rg1A
125
+ 1kt6A
126
+ 2ja9A
127
+ 1i4uA
128
+ 4i86A
129
+ 1o7iA
130
+ 1x8qA
131
+ 2ichA
132
+ 3dzmA
133
+ 3n91A
134
+ 1luzA
135
+ 4lqzA
136
+ 4i1kA
137
+ 5xlyB
138
+ 3a35A
139
+ 3tdqA
140
+ 4mxtA
141
+ 3wjtA
142
+ 3buuA
143
+ 3ksnA
144
+ 2w7qA
145
+ 2yzyA
146
+ 4z48A
147
+ 3bk5A
148
+ 4qa8A
149
+ 2byoA
150
+ 3bmzA
151
+ 4egdA
152
+ 4joxA
153
+ 3h6jA
154
+ 2bhuA
155
+ 1pmhX
156
+ 6ggrA
157
+ 4dqaA
158
+ 4v2bA
159
+ 4weeA
160
+ 2w07B
161
+ 4r9pA
162
+ 2r2cA
163
+ 2r0hA
164
+ 4aqoA
165
+ 4luqC
166
+ 3iagC
167
+ 1k5nA
168
+ 2ygnA
169
+ 3bwzA
170
+ 4fmrA
171
+ 1njhA
172
+ 4hi6A
173
+ 1pkhA
174
+ 1gp0A
175
+ 3q1nA
176
+ 2ag4A
177
+ 2v3iA
178
+ 3ty1A
179
+ 1gprA
180
+ 3aihA
181
+ 4c4aA
182
+ 1tulA
183
+ 4a02A
184
+ 4c08A
185
+ 4maiA
186
+ 1jovA
187
+ 3wmvA
188
+ 2fdbM
189
+ 1dqgA
190
+ 1xzzA
191
+ 6i18A
192
+ 4i4oA
193
+ 4efpA
194
+ 5yh4A
195
+ 3h6qA
196
+ 5bowA
197
+ 5vi4A
198
+ 2vxtI
199
+ 3vwcA
200
+ 4lo0C
201
+ 1sr4C
202
+ 2dpfA
203
+ 3dzwA
204
+ 3a0eA
205
+ 1xd5A
206
+ 4h3oA
207
+ 4tkcA
208
+ 5j76A
209
+ 3mezC
210
+ 4gc1A
211
+ 1b2pA
212
+ 4le7A
213
+ 4oitA
214
+ 6b0gE
215
+ 1z1yB
216
+ 1vmoA
217
+ 2gudA
218
+ 4r6rE
219
+ 5krpC
220
+ 5v6fA
221
+ 4pitA
222
+ 6flwA
223
+ 4ddnD
224
+ 3apaA
225
+ 5gvyA
226
+ 1c3mA
227
+ 4mq0A
228
+ 3wocA
229
+ 3aqgA
230
+ 3towA
231
+ 2qp2A
232
+ 1nykA
233
+ 2bmoA
234
+ 2gbwA
235
+ 1rfsA
236
+ 4aivA
237
+ 3gkeA
238
+ 2nwfA
239
+ 1jm1A
240
+ 2qpzA
241
+ 5cxmB
242
+ 3dqyA
243
+ 3d89A
244
+ 2b1xA
245
+ 4qdcA
246
+ 2q3wA
247
+ 3c7xA
248
+ 1genA
249
+ 1itvA
250
+ 3s18A
251
+ 4rt6B
252
+ 3cu9A
253
+ 3wasA
254
+ 6ms3B
255
+ 6frwA
256
+ 3k1uA
257
+ 5aycA
258
+ 5c0pA
259
+ 4n1iA
260
+ 3r4zA
261
+ 1tl2A
262
+ 4u6dA
263
+ 1oygA
264
+ 4qqsA
265
+ 3qz4A
266
+ 5a8cA
267
+ 4pvaA
268
+ 3kstA
269
+ 5flwA
270
+ 6gy5A
271
+ 1cruA
272
+ 1suuA
273
+ 3o4pA
274
+ 2p4oA
275
+ 4mzaA
276
+ 5gtqA
277
+ 3dr2A
278
+ 3dasA
279
+ 3g4eA
280
+ 2fp8A
281
+ 5hx0B
282
+ 1npeA
283
+ 1s1dA
284
+ 2zwaA
285
+ 3a72A
286
+ 2zb6A
287
+ 3scyA
288
+ 3b7fA
289
+ 3al9A
290
+ 3o4hA
291
+ 4pxwA
292
+ 4wk0A
293
+ 2w18A
294
+ 5em2A
295
+ 1sq9A
296
+ 1xipA
297
+ 4h5iA
298
+ 1jofA
299
+ 5ic7A
300
+ 5k19A
301
+ 6e1zA
302
+ 2z2nA
303
+ 6e4lA
304
+ 6fkwA
305
+ 6damA
306
+ 1flgA
307
+ 4cvbA
308
+ 4mh1A
309
+ 1z68A
310
+ 2z3zA
311
+ 4q1vA
312
+ 1xfdA
313
+ 5d7wA
314
+ 1kapP
315
+ 3laaA
316
+ 1p9hA
317
+ 3ultA
318
+ 3s6lA
319
+ 2xqhA
320
+ 4dt5A
321
+ 5m5zA
322
+ 5lw3A
323
+ 1k5cA
324
+ 1k4zA
325
+ 2ntpA
326
+ 3bh7B
327
+ 2j8kA
328
+ 2vfoA
329
+ 3n6zA
330
+ 1hf2A
331
+ 2x3hB
332
+ 1rmgA
333
+ 6mfkA
334
+ 1l0sA
335
+ 2xt2A
336
+ 5nzgA
337
+ 3kweA
338
+ 2w7zA
339
+ 1lktA
340
+ 3facA
341
+ 3pyiB
342
+ 2casA
343
+ 1gppA
344
+ 3maoA
345
+ 1ut7A
346
+ 1hxrA
347
+ 1t61A
348
+ 4qjvA
349
+ 3lywA
350
+ 3dalA
351
+ 5hqhA
352
+ 3u7zA
353
+ 3r90A
354
+ 1tp6A
355
+ 3s9xA
356
+ 2ex5A
357
+ 3gbyA
358
+ 5kvbA
359
+ 2cu3A
360
+ 1c1yB
361
+ 5f6rA
362
+ 4a6qA
363
+ 2w56A
364
+ 4lqbA
365
+ 4oobA
366
+ 3oajA
367
+ 3n8bA
368
+ 3jumA
369
+ 2prxA
370
+ 5b1rA
371
+ 1ewfA
372
+ 4m4dA
373
+ 2obdA
374
+ 6baqA
375
+ 1usuB
376
+ 3e8tA
377
+ 3aotA
378
+ 2rckA
379
+ 3l6iA
380
+ 3uv1A
381
+ 3bqwA
382
+ 5mprA
383
+ 1kkoA
384
+ 4cd8A
385
+ 1vd6A
386
+ 2g0wA
387
+ 4lanA
388
+ 3s83A
389
+ 2v3gA
390
+ 3fkrA
391
+ 4z0gA
392
+ 3sggA
393
+ 5zjbA
394
+ 2xfrA
395
+ 4g8tA
396
+ 5n6fA
397
+ 1muwA
398
+ 2qhqA
399
+ 3h35A
400
+ 3kluA
401
+ 3fn2A
402
+ 2od6A
403
+ 1kcfA
404
+ 3nlcA
405
+ 2zw2A
406
+ 4ftxA
407
+ 3u2aA
408
+ 2hiqA
409
+ 1xkpC
410
+ 6ih0A
411
+ 5c12A
412
+ 1w4rA
413
+ 3c0fB
414
+ 3nbmA
415
+ 2r6zA
416
+ 5hxdA
417
+ 1chdA
418
+ 3do8A
419
+ 3gohA
420
+ 1n0eA
421
+ 2q82A
422
+ 5kxhA
423
+ 3oqiA
424
+ 2x4lA
425
+ 3d3kA
426
+ 3l46A
427
+ 2fkcA
428
+ 5jphA
429
+ 3nytA
430
+ 3rhtA
431
+ 3dkrA
432
+ 2psbA
433
+ 1tc5A
434
+ 3vrdB
435
+ 2je3A
436
+ 3g5sA
437
+ 1jkeA
438
+ 4at0A
439
+ 1vi4A
440
+ 4u8pC
441
+ 4ntcA
442
+ 5ipyA
443
+ 5nakA
444
+ 4z24B
445
+ 4opcA
446
+ 5cdkA
447
+ 2b0aA
448
+ 4n2pA
449
+ 1j5uA
450
+ 1vzyB
451
+ 1vq0A
452
+ 4ipuA
453
+ 4dq9A
454
+ 4jtmA
455
+ 3gs9A
456
+ 3adyA
457
+ 3mi0A
458
+ 3ib7A
459
+ 3g91A
460
+ 1vr7A
461
+ 4zx2A
462
+ 1ds1A
463
+ 3zwfA
464
+ 1hq0A
465
+ 3hbcA
466
+ 3p8kA
467
+ 1wraA
468
+ 3t91A
469
+ 3c9fA
470
+ 2imhA
471
+ 1um0A
472
+ 5y0mA
473
+ 5u4hA
474
+ 3zh4A
475
+ 3swgA
476
+ 5ujsA
477
+ 3nvsA
478
+ 2o0bA
479
+ 2pqcA
480
+ 3slhA
481
+ 1rf6A
482
+ 4n3pA
483
+ 5bufA
484
+ 3rmtA
485
+ 4fqdA
486
+ 1ud9A
487
+ 1t6lA
488
+ 1rwzA
489
+ 3ifvA
490
+ 1iz5A
491
+ 3lx2A
492
+ 1u7bA
493
+ 5tupA
494
+ 5h0tA
495
+ 5v7mA
496
+ 3fdsC
497
+ 3aizA
498
+ 1b77A
499
+ 3p91A
500
+ 1dmlA
501
+ 3hslX
502
+ 2z0lA
503
+ 6nibA
504
+ 2jerA
505
+ 1xknA
506
+ 1zbrA
507
+ 3hvmA
508
+ 1jdwA
509
+ 5wpiA
510
+ 1g61A
511
+ 1h70A
512
+ 5m3qA
513
+ 1ynfA
514
+ 3wn4A
515
+ 1io0A
516
+ 4rcaB
517
+ 4fcgA
518
+ 4ecoA
519
+ 3wpcA
520
+ 4im6A
521
+ 4cnmA
522
+ 5hzlB
523
+ 4fs7A
524
+ 2xwtC
525
+ 3e4gA
526
+ 4wp6A
527
+ 5il7A
528
+ 1z7xW
529
+ 4u7lA
530
+ 6fg8A
531
+ 2wfhA
532
+ 2fy7A
533
+ 5wwdA
534
+ 1j3aA
535
+ 1omzA
536
+ 3emfA
537
+ 1xw3A
538
+ 3h4rA
539
+ 3essA
540
+ 1o22A
541
+ 4ktbA
542
+ 1jh6A
543
+ 3n08A
544
+ 5tsqA
545
+ 3e9vA
546
+ 4j7hA
547
+ 1i4jA
548
+ 2wnfA
549
+ 3v1aA
550
+ 3coqA
551
+ 2f60K
552
+ 4zgmA
553
+ 1i7wB
554
+ 6g6kA
555
+ 1pbyC
556
+ 1a92A
557
+ 3alrA
558
+ 2wjvD
559
+ 2a26A
560
+ 1devB
561
+ 4l0nA
562
+ 4ayaA
563
+ 3zxcA
564
+ 4pkfB
565
+ 2b1yA
566
+ 4dncD
567
+ 4jpnA
568
+ 4e18B
569
+ 3vepX
570
+ 3v4yB
571
+ 1xawA
572
+ 1ykhA
573
+ 2p64A
574
+ 6bscB
575
+ 2z3xA
576
+ 4uzzB
577
+ 3thfA
578
+ 1wq6A
579
+ 4ke2A
580
+ 4lhfA
581
+ 2v66B
582
+ 3lczA
583
+ 2h4oA
584
+ 4wjwA
585
+ 3kvpA
586
+ 3e56A
587
+ 3bk3C
588
+ 2ds5A
589
+ 3zoqB
590
+ 3nfgB
591
+ 4ksnA
592
+ 3ua0A
593
+ 3nrtA
594
+ 4a9aC
595
+ 6hikL
data/dataset_visualization/dataset_visualization.py ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from benchmark import get_cath
2
+ from benchmark import config
3
+ import pandas as pd
4
+ import matplotlib.pyplot as plt
5
+ from pathlib import Path
6
+ import numpy as np
7
+ import seaborn as sns
8
+ import matplotlib
9
+ matplotlib.use('Agg')
10
+
11
+ def format_secondary(df):
12
+ secondary=[[],[],[],[]]
13
+ for i,chain in df.iterrows():
14
+ for structure, residue in zip(list(chain.dssp), list(chain.sequence)):
15
+ if structure == "H" or structure == "I" or structure == "G":
16
+ secondary[0].append(residue)
17
+ elif structure == "E":
18
+ secondary[1].append(residue)
19
+ elif structure == "B" or structure == "T" or structure == "S":
20
+ secondary[2].append(residue)
21
+ else:
22
+ secondary[3].append(residue)
23
+ return secondary
24
+
25
+
26
+ def describe_set(dataset,path_to_pdb):
27
+ plt.ioff()
28
+ df = get_cath.read_data("cath-domain-description-file.txt")
29
+ filtered_df = get_cath.filter_with_user_list(df, Path(dataset))
30
+ df_with_sequence = get_cath.append_sequence(filtered_df, Path(path_to_pdb))
31
+ #testing set has multiple chains from the same PDB, need to drop repeats for resolution plots.
32
+ resolution=df_with_sequence.drop_duplicates(subset=['PDB']).resolution.values
33
+
34
+ fig,ax=plt.subplots(2,5,figsize=(25,10))
35
+ hist=np.histogram(resolution,bins=6,range=(0,3))
36
+ counts=hist[0]/len(resolution)
37
+
38
+ ax[0][0].bar(range(len(counts)),counts)
39
+ ax[0][0].set_xlabel(r'Resolution, $\AA$')
40
+ ax[0][0].set_ylabel('Fraction of structures')
41
+ ax[0][0].set_xticks([0,1,2,3,4,5])
42
+ ax[0][0].set_xticklabels(['[0, 0.5)','[0.5, 1)','[1, 1.5)','[1.5, 2)','[2, 2.5)','[2.5, 3]'])
43
+
44
+ colors = sns.color_palette()
45
+ arch=filtered_df.drop_duplicates(subset=['class'])['class'].values
46
+ grouped=filtered_df.groupby(by=['class','architecture']).count()
47
+
48
+ previous_position=0
49
+ gs = ax[0, 0].get_gridspec()
50
+ for a in ax[0, 1:]:
51
+ a.remove()
52
+ ax_big = fig.add_subplot(gs[0, 1:])
53
+ for x in arch:
54
+ if x==1 or x==2 or x==3 or x==4:
55
+ architectures=grouped.loc[x]
56
+ ax_big.bar(range(previous_position,previous_position+architectures.shape[0]),architectures.PDB.values/filtered_df.shape[0],color=colors[x],label=config.classes[x])
57
+ previous_position+=architectures.shape[0]
58
+ #combine 4 and 6 for siplicity
59
+ if x==6:
60
+ architectures=grouped.loc[6]
61
+ ax_big.bar(range(previous_position,previous_position+architectures.shape[0]),architectures.PDB.values/filtered_df.shape[0],color=colors[4])
62
+
63
+
64
+ #get names
65
+ cls_arch=[f"{x[0]}.{x[1]}" for x in grouped.index]
66
+ names=[config.architectures[label] for label in cls_arch]
67
+
68
+ ax_big.set_xticks(range(grouped.shape[0]))
69
+ ax_big.set_xticklabels(names, rotation=90, fontdict={"horizontalalignment": "center", "size": 12})
70
+ ax_big.set_ylabel('Fraction of structures')
71
+ ax_big.set_title('CATH architectures')
72
+ #make space for legend
73
+ ax_big.set_xlim(-0.8,grouped.shape[0]+4)
74
+ ax_big.legend()
75
+
76
+ #get secondary structures, filtering with training set will get multiple CATH entries for the same chain.
77
+ secondary=format_secondary(df_with_sequence)
78
+ #plot residue distribution
79
+ ss_types=["Helices", "Sheets", "Structured loops", "Random"]
80
+ for x in range(len(secondary)):
81
+ ax[1][x].bar(config.acids,np.unique(secondary[x],return_counts=True)[1]/len(secondary[x]))
82
+ ax[1][x].set_ylabel('Fraction of structures')
83
+ ax[1][x].set_xlabel('Amino acids')
84
+ ax[1][x].set_title(ss_types[x])
85
+ #flatten the list
86
+ all_structures=[x for y in secondary for x in y]
87
+ ax[1][4].bar(config.acids,np.unique(all_structures,return_counts=True)[1]/len(all_structures))
88
+ ax[1][4].set_ylabel('Fraction of structures')
89
+ ax[1][4].set_xlabel('Amino acids')
90
+ ax[1][4].set_title('All structures')
91
+ plt.tight_layout()
92
+ plt.savefig(dataset+'.pdf')
93
+
94
+ describe_set("/home/s1706179/project/sequence-recovery-benchmark/nmr_benchmark.txt","/home/shared/datasets/pdb/")
data/dataset_visualization/nmr_benchmark.txt ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 1hp8A
2
+ 1j2mA
3
+ 2kxeA
4
+ 2knjA
5
+ 2kp7A
6
+ 2k53A
7
+ 1wh6A
8
+ 2l2oA
9
+ 2lo0A
10
+ 2lznA
11
+ 1aq5A
12
+ 1pzqA
13
+ 2yufA
14
+ 2ksfA
15
+ 1ehsA
16
+ 1yycA
17
+ 2l81A
18
+ 1eq1A
19
+ 2dnxA
20
+ 2lhrA
21
+ 1zu2A
22
+ 2kc7A
23
+ 2katA
24
+ 2l0tB
25
+ 2l9bA
26
+ 2lniA
27
+ 2kckA
28
+ 2dcpA
29
+ 1rw2A
30
+ 2laiA
31
+ 2lckA
32
+ 1emnA
33
+ 1z6cA
34
+ 1lmjA
35
+ 1x6aA
36
+ 1bf9A
37
+ 2rtsA
38
+ 1apoA
39
+ 2jyeA
40
+ 1bi6H
41
+ 1a7iA
42
+ 2k2dA
43
+ 2mhgA
44
+ 2g2kA
45
+ 2rprA
46
+ 2l0zA
47
+ 1b8wA
48
+ 2dk7A
49
+ 2jr3A
50
+ 2jubA
51
+ 1dl6A
52
+ 2a7yA
53
+ 2kigA
54
+ 4csqA
55
+ 4a54A
56
+ 1yduA
57
+ 1kg1A
58
+ 2akkA
59
+ 2m9uA
60
+ 2kkuA
61
+ 1qw1A
62
+ 2mhdA
63
+ 2m9vA
64
+ 2k5dA
65
+ 2kz4A
66
+ 1j6qA
67
+ 2kd2A
68
+ 1oh1A
69
+ 2jn4A
70
+ 2lzjA
71
+ 1uapA
72
+ 2lgnA
73
+ 1wh0A
74
+ 2mctA
75
+ 2llgA
76
+ 2lv4A
77
+ 2joxA
78
+ 1so9A
79
+ 1exgA
80
+ 2jwyA
81
+ 1op4A
82
+ 2jooA
83
+ 5kqbA
84
+ 5kvpA
85
+ 2l2gA
86
+ 2llaA
87
+ 2l21A
88
+ 2kvaA
89
+ 2kijA
90
+ 1fmmS
91
+ 1irpA
92
+ 1hcdA
93
+ 2yugA
94
+ 2jz4A
95
+ 2jzaA
96
+ 2jo6A
97
+ 2jxyA
98
+ 2yuhA
99
+ 2kv1A
100
+ 2jnqA
101
+ 2kq1A
102
+ 2lwyA
103
+ 2kwbA
104
+ 2l3uA
105
+ 1h6qA
106
+ 2lcjA
107
+ 1jbiA
108
+ 2lvlA
109
+ 2m0aA
110
+ 2m7oA
111
+ 1wjnA
112
+ 2jovA
113
+ 2k0mA
114
+ 1xeeA
115
+ 2k89A
116
+ 2mjkA
117
+ 2kaaA
118
+ 2lyxA
119
+ 3zpmA
120
+ 2govA
121
+ 4aogA
122
+ 4bwhA
123
+ 2fmcA
124
+ 2kt9A
125
+ 2m3kA
126
+ 2mqdA
127
+ 1bbgA
128
+ 1nxiA
129
+ 2konA
130
+ 2m3dA
131
+ 2yreA
132
+ 2joeA
133
+ 1zwtA
134
+ 1adnA
135
+ 2mr6A
136
+ 2jzcA
137
+ 2k87A
138
+ 2kafA
139
+ 1x67A
140
+ 2dcqA
141
+ 2ov6A
142
+ 2kdpA
143
+ 2k4mA
144
+ 2ll3A
145
+ 2j8jA
146
+ 1hkyA
147
+ 1yxeA
148
+ 2k13X
149
+ 2hi6A
150
+ 2kl5A
151
+ 1jw3A
152
+ 2knqA
153
+ 2a02A
154
+ 2kknA
155
+ 2ellA
156
+ 2jqdA
157
+ 2krxA
158
+ 2memA
159
+ 1ksqA
160
+ 3zuaA
161
+ 1y6uA
162
+ 2j4mA
163
+ 2ejeA
164
+ 2lfcA
165
+ 1o8rA
166
+ 1wloA
167
+ 1y7jA
168
+ 1wfeA
169
+ 1gp8A
170
+ 2jryA
171
+ 1d6gA
172
+ 2m2fA
173
+ 2li8A
174
+ 2m13A
175
+ 1wvkA
176
+ 1hy9A
177
+ 2l2lA
178
+ 2kuyA
179
+ 2c55A
180
+ 2kwzA
181
+ 2lxwA
182
+ 2kesA
183
+ 1v65A
184
+ 2kj1A
185
+ 2rp4A
186
+ 2kktA
187
+ 2k4xA
188
+ 2lotA
189
+ 2conA
data/dataset_visualization/nmr_set.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ebb9d071e4864e19f3726a06b54eed8170559eacc88c74f8bfb8c23351c1f357
3
+ size 482121
data/dataset_visualization/trainingset_pisces_expanded.pdf ADDED
Binary file (31.7 kB). View file
 
data/examples/Comparison_summary.pdf ADDED
Binary file (84.5 kB). View file
 
data/examples/ProDcoNN.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bded015b2e600cab32b7cfaebf2bbdcf449200f233032a0ee46f4298efe76316
3
+ size 56699674
data/examples/ProDcoNN.csv.pdf ADDED
Binary file (80.5 kB). View file
 
data/examples/ProDcoNN.txt ADDED
@@ -0,0 +1,615 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ignore_uncommon False
2
+ include_pdbs
3
+ ##########
4
+ 1a41A 221
5
+ 1a92A 50
6
+ 1b2pA 119
7
+ 1b77A 228
8
+ 1b8kA 90
9
+ 1bx7A 51
10
+ 1c1yB 77
11
+ 1c3mA 145
12
+ 1chdA 198
13
+ 1cruA 448
14
+ 1devB 41
15
+ 1dmlA 267
16
+ 1dqgA 134
17
+ 1ds1A 323
18
+ 1dvoA 152
19
+ 1ejdA 419
20
+ 1ewfA 456
21
+ 1flgA 582
22
+ 1g3pA 192
23
+ 1g61A 225
24
+ 1genA 200
25
+ 1gp0A 133
26
+ 1gppA 217
27
+ 1gprA 158
28
+ 1gxmA 324
29
+ 1h32A 261
30
+ 1h70A 255
31
+ 1hf2A 196
32
+ 1hq0A 295
33
+ 1hxrA 107
34
+ 1i4jA 110
35
+ 1i4uA 181
36
+ 1i7wB 51
37
+ 1igqA 54
38
+ 1io0A 166
39
+ 1itvA 195
40
+ 1iz5A 240
41
+ 1j3aA 129
42
+ 1j5uA 127
43
+ 1jdwA 360
44
+ 1jh6A 181
45
+ 1jkeA 145
46
+ 1jm1A 202
47
+ 1jofA 365
48
+ 1jovA 269
49
+ 1k4zA 157
50
+ 1k5cA 333
51
+ 1k5nA 276
52
+ 1kapP 470
53
+ 1kcfA 240
54
+ 1kkoA 411
55
+ 1kt6A 175
56
+ 1l0sA 88
57
+ 1lktA 104
58
+ 1lpbA 85
59
+ 1lslA 113
60
+ 1luzA 85
61
+ 1muwA 386
62
+ 1n0eA 141
63
+ 1njhA 108
64
+ 1npeA 263
65
+ 1nykA 156
66
+ 1o22A 149
67
+ 1o7iA 115
68
+ 1omzA 253
69
+ 1ouwA 149
70
+ 1oygA 440
71
+ 1p2xA 159
72
+ 1p9hA 179
73
+ 1pbyC 79
74
+ 1pexA 192
75
+ 1pkhA 182
76
+ 1pmhX 183
77
+ 1rf6A 427
78
+ 1rfsA 127
79
+ 1rmgA 422
80
+ 1rwzA 244
81
+ 1s1dA 317
82
+ 1sq9A 378
83
+ 1sr4C 154
84
+ 1suuA 293
85
+ 1t61A 223
86
+ 1t6lA 249
87
+ 1tc5A 187
88
+ 1tl2A 235
89
+ 1tp6A 126
90
+ 1tulA 102
91
+ 1u7bA 251
92
+ 1ud9A 242
93
+ 1um0A 365
94
+ 1usuB 132
95
+ 1ut7A 147
96
+ 1uzkA 152
97
+ 1v6pA 62
98
+ 1v7wA 779
99
+ 1vd6A 218
100
+ 1vi4A 162
101
+ 1vmoA 163
102
+ 1vq0A 290
103
+ 1vr7A 120
104
+ 1vzyB 286
105
+ 1w4rA 174
106
+ 1wq6A 59
107
+ 1wraA 305
108
+ 1wthD 361
109
+ 1x8qA 184
110
+ 1xawA 107
111
+ 1xd5A 112
112
+ 1xfdA 723
113
+ 1xg0C 174
114
+ 1xipA 367
115
+ 1xknA 353
116
+ 1xkpC 126
117
+ 1xksA 374
118
+ 1xw3A 110
119
+ 1xzzA 216
120
+ 1ya5T 89
121
+ 1ykhA 95
122
+ 1ynfA 429
123
+ 1z1yB 175
124
+ 1z68A 719
125
+ 1z7xW 460
126
+ 1zbrA 339
127
+ 2a26A 48
128
+ 2ag4A 164
129
+ 2aydA 76
130
+ 2b0aA 186
131
+ 2b1xA 441
132
+ 2b1yA 101
133
+ 2bhuA 580
134
+ 2bmoA 437
135
+ 2bnmA 194
136
+ 2byoA 183
137
+ 2casA 548
138
+ 2cu3A 63
139
+ 2de6A 389
140
+ 2dpfA 111
141
+ 2ds5A 43
142
+ 2dyiA 162
143
+ 2e12A 93
144
+ 2ebfX 711
145
+ 2ex5A 207
146
+ 2f60K 60
147
+ 2fbaA 492
148
+ 2fdbM 149
149
+ 2fkcA 247
150
+ 2fp8A 302
151
+ 2fy7A 268
152
+ 2g0wA 275
153
+ 2gbwA 449
154
+ 2gudA 121
155
+ 2h4oA 62
156
+ 2hiqA 96
157
+ 2hjeA 210
158
+ 2hr2A 156
159
+ 2ichA 320
160
+ 2imhA 226
161
+ 2j8kA 181
162
+ 2ja9A 175
163
+ 2je3A 157
164
+ 2jerA 366
165
+ 2jg0A 507
166
+ 2ntpA 342
167
+ 2nwfA 141
168
+ 2o0bA 424
169
+ 2o1kA 43
170
+ 2obdA 472
171
+ 2od6A 110
172
+ 2of3A 266
173
+ 2p38A 155
174
+ 2p4oA 302
175
+ 2p57A 124
176
+ 2p64A 51
177
+ 2p6vA 97
178
+ 2pm7A 345
179
+ 2pqcA 445
180
+ 2prxA 114
181
+ 2psbA 290
182
+ 2ptrA 454
183
+ 2q0oC 86
184
+ 2q3wA 109
185
+ 2q4zA 307
186
+ 2q82A 114
187
+ 2qhqA 120
188
+ 2qp2A 498
189
+ 2qpzA 103
190
+ 2r01A 195
191
+ 2r0hA 160
192
+ 2r2cA 121
193
+ 2r6zA 225
194
+ 2ra1A 412
195
+ 2ra8A 351
196
+ 2rckA 221
197
+ 2v3gA 273
198
+ 2v3iA 434
199
+ 2v66B 111
200
+ 2v76A 99
201
+ 2vfoA 555
202
+ 2vq2A 220
203
+ 2vxtI 156
204
+ 2w07B 121
205
+ 2w18A 306
206
+ 2w56A 143
207
+ 2w7qA 192
208
+ 2w7zA 207
209
+ 2wfhA 181
210
+ 2wjvD 54
211
+ 2wnfA 272
212
+ 2x3hB 498
213
+ 2x4lA 298
214
+ 2xfrA 487
215
+ 2xqhA 258
216
+ 2xt2A 197
217
+ 2xwtC 234
218
+ 2y8nB 86
219
+ 2ygnA 146
220
+ 2yhcA 209
221
+ 2yzyA 163
222
+ 2z0lA 299
223
+ 2z2nA 293
224
+ 2z3xA 56
225
+ 2z3zA 651
226
+ 2zb6A 427
227
+ 2zw2A 85
228
+ 2zwaA 673
229
+ 3a0eA 110
230
+ 3a0oA 764
231
+ 3a35A 184
232
+ 3a72A 353
233
+ 3abhA 288
234
+ 3adyA 102
235
+ 3aihA 110
236
+ 3aizA 248
237
+ 3al9A 516
238
+ 3alrA 63
239
+ 3aotA 203
240
+ 3apaA 138
241
+ 3aqgA 133
242
+ 3ayjA 685
243
+ 3b7fA 368
244
+ 3bh7B 314
245
+ 3bk3C 67
246
+ 3bk5A 235
247
+ 3bmzA 185
248
+ 3bqoA 202
249
+ 3bqwA 347
250
+ 3buuA 224
251
+ 3bwzA 171
252
+ 3c0fB 85
253
+ 3c7xA 196
254
+ 3c9fA 531
255
+ 3ca7A 50
256
+ 3cexA 170
257
+ 3coqA 89
258
+ 3cu9A 314
259
+ 3cxbA 302
260
+ 3d3kA 233
261
+ 3d4uB 74
262
+ 3d89A 136
263
+ 3d9xA 114
264
+ 3dadA 324
265
+ 3dalA 179
266
+ 3dasA 334
267
+ 3dkrA 241
268
+ 3do8A 135
269
+ 3dqyA 106
270
+ 3dr2A 299
271
+ 3dzmA 208
272
+ 3dzwA 109
273
+ 3e3vA 154
274
+ 3e4gA 176
275
+ 3e56A 75
276
+ 3e7jA 743
277
+ 3e8tA 216
278
+ 3e9vA 120
279
+ 3emfA 113
280
+ 3essA 199
281
+ 3eunA 81
282
+ 3f0cA 193
283
+ 3f3fC 475
284
+ 3facA 109
285
+ 3fb9A 89
286
+ 3fdsC 249
287
+ 3fkrA 304
288
+ 3fn2A 97
289
+ 3g3zA 142
290
+ 3g4eA 297
291
+ 3g5sA 424
292
+ 3g91A 260
293
+ 3gbyA 127
294
+ 3giaA 433
295
+ 3gkeA 340
296
+ 3gohA 297
297
+ 3gs9A 326
298
+ 3gzxA 440
299
+ 3h35A 144
300
+ 3h4rA 219
301
+ 3h6jA 438
302
+ 3h6qA 168
303
+ 3hbcA 309
304
+ 3hrzB 233
305
+ 3hslX 287
306
+ 3hvmA 330
307
+ 3iagC 422
308
+ 3ib7A 295
309
+ 3ifvA 216
310
+ 3iisM 151
311
+ 3jrtA 166
312
+ 3jumA 157
313
+ 3k1uA 314
314
+ 3k4iA 202
315
+ 3klkA 1006
316
+ 3kluA 119
317
+ 3ksnA 177
318
+ 3kstA 291
319
+ 3kvpA 43
320
+ 3kw0A 190
321
+ 3kweA 166
322
+ 3kyfA 231
323
+ 3l46A 90
324
+ 3l6iA 171
325
+ 3laaA 169
326
+ 3lczA 53
327
+ 3lx2A 247
328
+ 3lywA 86
329
+ 3maoA 105
330
+ 3mcbB 58
331
+ 3mezC 110
332
+ 3mi0A 215
333
+ 3n08A 151
334
+ 3n6zA 339
335
+ 3n8bA 75
336
+ 3n91A 315
337
+ 3nbmA 104
338
+ 3nfgB 120
339
+ 3ng9A 520
340
+ 3nlcA 534
341
+ 3nrtA 93
342
+ 3nvoA 250
343
+ 3nvsA 426
344
+ 3nytA 359
345
+ 3o4hA 576
346
+ 3o4pA 314
347
+ 3oajA 310
348
+ 3oqiA 222
349
+ 3p8kA 268
350
+ 3p91A 245
351
+ 3pyiB 143
352
+ 3q1nA 294
353
+ 3qb9A 159
354
+ 3qz4A 306
355
+ 3r4zA 358
356
+ 3r90A 185
357
+ 3rf0A 199
358
+ 3rhtA 252
359
+ 3rmtA 432
360
+ 3ro3A 159
361
+ 3s18A 224
362
+ 3s6lA 155
363
+ 3s83A 256
364
+ 3s9xA 159
365
+ 3scyA 356
366
+ 3sggA 512
367
+ 3slhA 436
368
+ 3swgA 417
369
+ 3t91A 210
370
+ 3tbdA 331
371
+ 3tdqA 86
372
+ 3teeA 206
373
+ 3thfA 175
374
+ 3towA 152
375
+ 3tvjA 83
376
+ 3ty1A 384
377
+ 3u2aA 112
378
+ 3u7zA 97
379
+ 3ua0A 79
380
+ 3ultA 114
381
+ 3ut4A 128
382
+ 3uv1A 190
383
+ 3v1aA 48
384
+ 3v4yB 41
385
+ 3vcaA 398
386
+ 3vepX 46
387
+ 3vrdB 400
388
+ 3vsnA 632
389
+ 3vwcA 146
390
+ 3wasA 389
391
+ 3wfdB 449
392
+ 3witA 64
393
+ 3wjtA 178
394
+ 3wkgA 410
395
+ 3wmvA 150
396
+ 3wn4A 747
397
+ 3wocA 138
398
+ 3wpcA 747
399
+ 3wwlA 54
400
+ 3zbdA 110
401
+ 3zh4A 411
402
+ 3zoqB 48
403
+ 3zwfA 259
404
+ 3zxcA 71
405
+ 4a02A 166
406
+ 4a5uB 80
407
+ 4a6qA 143
408
+ 4a9aC 106
409
+ 4adyA 849
410
+ 4adzA 90
411
+ 4aivA 113
412
+ 4aqoA 86
413
+ 4at0A 483
414
+ 4ayaA 59
415
+ 4ayoA 434
416
+ 4c08A 325
417
+ 4c4aA 642
418
+ 4cd8A 313
419
+ 4cj0A 534
420
+ 4cnmA 283
421
+ 4cvbA 562
422
+ 4ddnD 154
423
+ 4dloA 351
424
+ 4dncD 42
425
+ 4dq9A 149
426
+ 4dqaA 349
427
+ 4dt5A 143
428
+ 4e18B 46
429
+ 4ebbA 450
430
+ 4ecoA 620
431
+ 4efpA 235
432
+ 4egdA 221
433
+ 4fcgA 296
434
+ 4fmrA 234
435
+ 4fnvA 659
436
+ 4fqdA 436
437
+ 4fs7A 383
438
+ 4ftxA 158
439
+ 4fzqA 79
440
+ 4g8tA 441
441
+ 4gc1A 275
442
+ 4h3oA 105
443
+ 4h5iA 344
444
+ 4hhvA 103
445
+ 4hi6A 138
446
+ 4hquA 95
447
+ 4i1kA 118
448
+ 4i4oA 146
449
+ 4i5jA 266
450
+ 4i86A 102
451
+ 4im6A 198
452
+ 4ipuA 137
453
+ 4j5tA 788
454
+ 4j7hA 446
455
+ 4joxA 118
456
+ 4jpnA 75
457
+ 4jtmA 81
458
+ 4jzzA 336
459
+ 4k6jA 497
460
+ 4k8wA 118
461
+ 4ke2A 196
462
+ 4ksnA 65
463
+ 4ktbA 160
464
+ 4ktpA 767
465
+ 4l0nA 51
466
+ 4lanA 370
467
+ 4lctA 318
468
+ 4le7A 254
469
+ 4lhfA 79
470
+ 4lo0C 144
471
+ 4lqbA 130
472
+ 4lqzA 131
473
+ 4luqC 123
474
+ 4m4dA 448
475
+ 4maiA 187
476
+ 4mh1A 509
477
+ 4mq0A 438
478
+ 4mqwA 88
479
+ 4mxtA 187
480
+ 4mzaA 432
481
+ 4n1iA 312
482
+ 4n2pA 143
483
+ 4n3pA 424
484
+ 4nq0A 254
485
+ 4ntcA 325
486
+ 4o06A 102
487
+ 4oitA 106
488
+ 4oobA 245
489
+ 4opcA 452
490
+ 4ozwA 334
491
+ 4p6zG 587
492
+ 4pfoA 755
493
+ 4pitA 140
494
+ 4pkfB 69
495
+ 4pvaA 328
496
+ 4pxwA 292
497
+ 4q1vA 707
498
+ 4qa8A 210
499
+ 4qdcA 369
500
+ 4qjvA 259
501
+ 4qqsA 312
502
+ 4r6rE 133
503
+ 4r9pA 210
504
+ 4rcaB 241
505
+ 4rg1A 286
506
+ 4rt6B 172
507
+ 4tkcA 118
508
+ 4u6dA 382
509
+ 4u7lA 455
510
+ 4u8pC 505
511
+ 4uzzB 65
512
+ 4v1gA 85
513
+ 4v2bA 106
514
+ 4weeA 135
515
+ 4wjwA 68
516
+ 4wk0A 449
517
+ 4wp6A 151
518
+ 4wu0A 360
519
+ 4y5jA 227
520
+ 4ya2H 222
521
+ 4ytbA 424
522
+ 4z0gA 384
523
+ 4z24B 649
524
+ 4z48A 240
525
+ 4zgmA 100
526
+ 4zhbA 104
527
+ 4zx2A 325
528
+ 5a8cA 299
529
+ 5agdA 333
530
+ 5aycA 386
531
+ 5b1rA 116
532
+ 5bowA 151
533
+ 5bq8A 104
534
+ 5bufA 445
535
+ 5c0pA 284
536
+ 5c12A 230
537
+ 5cdkA 181
538
+ 5cxmB 99
539
+ 5d7uA 53
540
+ 5d7wA 469
541
+ 5dicA 115
542
+ 5em2A 357
543
+ 5f6rA 173
544
+ 5flwA 302
545
+ 5gtqA 307
546
+ 5gvyA 145
547
+ 5gzkA 418
548
+ 5h0tA 248
549
+ 5h3xA 267
550
+ 5hqhA 96
551
+ 5hx0B 364
552
+ 5hxdA 237
553
+ 5hzlB 280
554
+ 5ic7A 340
555
+ 5il7A 440
556
+ 5ipyA 445
557
+ 5j3tA 126
558
+ 5j76A 109
559
+ 5jphA 142
560
+ 5k19A 376
561
+ 5krpC 150
562
+ 5kvbA 146
563
+ 5kxhA 350
564
+ 5lf2A 302
565
+ 5lw3A 381
566
+ 5m3qA 224
567
+ 5m5zA 755
568
+ 5m7yA 425
569
+ 5mprA 364
570
+ 5mriA 662
571
+ 5n6fA 365
572
+ 5nakA 452
573
+ 5nzgA 482
574
+ 5ol4B 122
575
+ 5tsqA 312
576
+ 5tupA 254
577
+ 5u1mA 105
578
+ 5u4hA 420
579
+ 5ujsA 417
580
+ 5v6fA 137
581
+ 5v7mA 255
582
+ 5vi4A 146
583
+ 5wpiA 364
584
+ 5wwdA 139
585
+ 5x56A 103
586
+ 5xlyB 121
587
+ 5y0mA 329
588
+ 5y5sQ 57
589
+ 5yh4A 179
590
+ 5zcjC 121
591
+ 5zjbA 232
592
+ 6a2qA 98
593
+ 6b0gE 154
594
+ 6baqA 196
595
+ 6bscB 48
596
+ 6damA 563
597
+ 6e1zA 307
598
+ 6e4lA 358
599
+ 6er6A 88
600
+ 6fg8A 188
601
+ 6fkwA 576
602
+ 6flwA 144
603
+ 6fmeB 505
604
+ 6frwA 411
605
+ 6g6kA 89
606
+ 6ggrA 168
607
+ 6gy5A 285
608
+ 6hcwA 502
609
+ 6hikL 40
610
+ 6i18A 484
611
+ 6ih0A 267
612
+ 6mfkA 210
613
+ 6ms3B 511
614
+ 6nibA 345
615
+ 6nkjA 412
data/examples/Rosetta.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:89a8192da88f7f230068ba20d071d00397e2fe4808869e940ecb96ed8f22021c
3
+ size 11926960
data/examples/Rosetta.csv.pdf ADDED
Binary file (80.1 kB). View file
 
data/examples/Rosetta.txt ADDED
@@ -0,0 +1,600 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ignore_uncommon False
2
+ include_pdbs
3
+ ##########
4
+ 1xg0C 174
5
+ 3g3zA 142
6
+ 3rf0A 199
7
+ 4i5jA 266
8
+ 2ptrA 454
9
+ 3f0cA 193
10
+ 4a5uB 80
11
+ 2p57A 124
12
+ 2q0oC 86
13
+ 6er6A 88
14
+ 1h32A 261
15
+ 3e3vA 154
16
+ 3cxbA 302
17
+ 1dvoA 152
18
+ 5dicA 115
19
+ 2bnmA 194
20
+ 4pfoA 755
21
+ 2ebfX 711
22
+ 3giaA 433
23
+ 1a41A 221
24
+ 3cexA 170
25
+ 4ebbA 450
26
+ 3jrtA 166
27
+ 3wfdB 449
28
+ 4v1gA 85
29
+ 3qb9A 159
30
+ 3abhA 288
31
+ 3nvoA 250
32
+ 2o1kA 43
33
+ 5x56A 103
34
+ 2ra1A 412
35
+ 4adzA 90
36
+ 2p6vA 97
37
+ 3k4iA 202
38
+ 4lctA 318
39
+ 4adyA 849
40
+ 4zhbA 104
41
+ 4p6zG 587
42
+ 4nq0A 254
43
+ 3dadA 324
44
+ 2vq2A 220
45
+ 4dloA 351
46
+ 2of3A 266
47
+ 4y5jA 227
48
+ 2pm7A 345
49
+ 2hr2A 156
50
+ 3ro3A 159
51
+ 3bqoA 202
52
+ 3ut4A 128
53
+ 2yhcA 209
54
+ 4k6jA 497
55
+ 3iisM 151
56
+ 5agdA 333
57
+ 2fbaA 492
58
+ 3e7jA 743
59
+ 1v7wA 779
60
+ 3a0oA 764
61
+ 4wu0A 360
62
+ 4ozwA 334
63
+ 4cj0A 534
64
+ 1gxmA 324
65
+ 5m7yA 425
66
+ 4fnvA 659
67
+ 5gzkA 418
68
+ 4ayoA 434
69
+ 3wkgA 410
70
+ 3vsnA 632
71
+ 2jg0A 507
72
+ 4j5tA 788
73
+ 4ktpA 767
74
+ 4mqwA 88
75
+ 5lf2A 302
76
+ 5mriA 662
77
+ 5ol4B 122
78
+ 1bx7A 51
79
+ 3ca7A 50
80
+ 3tvjA 83
81
+ 3tbdA 331
82
+ 1uzkA 152
83
+ 5bq8A 104
84
+ 3klkA 1006
85
+ 1b8kA 90
86
+ 1v6pA 62
87
+ 4hquA 95
88
+ 4k8wA 118
89
+ 6a2qA 98
90
+ 1lpbA 85
91
+ 3hrzB 233
92
+ 6fmeB 505
93
+ 2aydA 76
94
+ 2ra8A 351
95
+ 4fzqA 79
96
+ 3d4uB 74
97
+ 3wwlA 54
98
+ 2r01A 195
99
+ 1lslA 113
100
+ 3f3fC 475
101
+ 2q4zA 307
102
+ 2de6A 389
103
+ 3d9xA 114
104
+ 2hjeA 210
105
+ 3mcbB 58
106
+ 2y8nB 86
107
+ 3witA 64
108
+ 1ya5T 89
109
+ 2dyiA 162
110
+ 3kyfA 231
111
+ 2v76A 99
112
+ 2e12A 93
113
+ 1g3pA 192
114
+ 4o06A 102
115
+ 3fb9A 89
116
+ 2p38A 155
117
+ 1igqA 54
118
+ 4hhvA 103
119
+ 3teeA 206
120
+ 5j3tA 126
121
+ 5h3xA 267
122
+ 3zbdA 110
123
+ 5d7uA 53
124
+ 5zcjC 121
125
+ 5u1mA 105
126
+ 1wthD 361
127
+ 4rg1A 286
128
+ 1kt6A 175
129
+ 2ja9A 175
130
+ 1i4uA 181
131
+ 4i86A 102
132
+ 1o7iA 115
133
+ 1x8qA 184
134
+ 2ichA 320
135
+ 3dzmA 208
136
+ 3n91A 315
137
+ 1luzA 85
138
+ 4lqzA 131
139
+ 4i1kA 118
140
+ 5xlyB 121
141
+ 3a35A 184
142
+ 3tdqA 86
143
+ 4mxtA 187
144
+ 3wjtA 178
145
+ 3buuA 224
146
+ 3ksnA 177
147
+ 2w7qA 192
148
+ 2yzyA 163
149
+ 4z48A 240
150
+ 3bk5A 235
151
+ 4qa8A 210
152
+ 2byoA 183
153
+ 3bmzA 185
154
+ 4egdA 221
155
+ 4joxA 118
156
+ 3h6jA 438
157
+ 2bhuA 580
158
+ 1pmhX 183
159
+ 6ggrA 168
160
+ 4dqaA 349
161
+ 4v2bA 106
162
+ 4weeA 135
163
+ 2w07B 121
164
+ 4r9pA 210
165
+ 2r2cA 121
166
+ 2r0hA 160
167
+ 4aqoA 86
168
+ 4luqC 123
169
+ 3iagC 422
170
+ 1k5nA 276
171
+ 2ygnA 146
172
+ 3bwzA 171
173
+ 4fmrA 234
174
+ 1njhA 108
175
+ 4hi6A 138
176
+ 1pkhA 182
177
+ 1gp0A 133
178
+ 3q1nA 294
179
+ 2ag4A 164
180
+ 2v3iA 434
181
+ 3ty1A 384
182
+ 1gprA 158
183
+ 3aihA 110
184
+ 4c4aA 642
185
+ 1tulA 102
186
+ 4a02A 166
187
+ 4c08A 325
188
+ 4maiA 187
189
+ 1jovA 269
190
+ 3wmvA 150
191
+ 2fdbM 149
192
+ 1dqgA 134
193
+ 1xzzA 216
194
+ 6i18A 484
195
+ 4i4oA 146
196
+ 4efpA 235
197
+ 5yh4A 179
198
+ 3h6qA 168
199
+ 5bowA 151
200
+ 5vi4A 146
201
+ 2vxtI 156
202
+ 3vwcA 146
203
+ 4lo0C 144
204
+ 1sr4C 154
205
+ 2dpfA 111
206
+ 3dzwA 109
207
+ 3a0eA 110
208
+ 1xd5A 112
209
+ 4h3oA 105
210
+ 4tkcA 118
211
+ 5j76A 109
212
+ 3mezC 110
213
+ 4gc1A 275
214
+ 1b2pA 119
215
+ 4le7A 254
216
+ 4oitA 106
217
+ 6b0gE 154
218
+ 1z1yB 175
219
+ 1vmoA 163
220
+ 2gudA 121
221
+ 4r6rE 133
222
+ 5krpC 150
223
+ 5v6fA 137
224
+ 4pitA 140
225
+ 6flwA 144
226
+ 4ddnD 154
227
+ 3apaA 138
228
+ 5gvyA 145
229
+ 1c3mA 145
230
+ 4mq0A 438
231
+ 3wocA 138
232
+ 3aqgA 133
233
+ 3towA 152
234
+ 2qp2A 498
235
+ 1nykA 156
236
+ 2bmoA 437
237
+ 2gbwA 449
238
+ 1rfsA 127
239
+ 4aivA 113
240
+ 3gkeA 340
241
+ 2nwfA 141
242
+ 1jm1A 202
243
+ 2qpzA 103
244
+ 5cxmB 99
245
+ 3dqyA 106
246
+ 3d89A 136
247
+ 2b1xA 441
248
+ 4qdcA 369
249
+ 2q3wA 109
250
+ 3c7xA 196
251
+ 1genA 200
252
+ 1itvA 195
253
+ 3s18A 224
254
+ 4rt6B 172
255
+ 3cu9A 314
256
+ 3wasA 389
257
+ 6ms3B 511
258
+ 6frwA 411
259
+ 3k1uA 314
260
+ 5aycA 386
261
+ 5c0pA 284
262
+ 4n1iA 312
263
+ 3r4zA 358
264
+ 1tl2A 235
265
+ 4u6dA 382
266
+ 1oygA 440
267
+ 4qqsA 312
268
+ 3qz4A 306
269
+ 5a8cA 299
270
+ 4pvaA 328
271
+ 3kstA 291
272
+ 5flwA 302
273
+ 6gy5A 285
274
+ 1cruA 448
275
+ 1suuA 293
276
+ 3o4pA 314
277
+ 2p4oA 302
278
+ 4mzaA 432
279
+ 5gtqA 307
280
+ 3dr2A 299
281
+ 3dasA 334
282
+ 3g4eA 297
283
+ 2fp8A 302
284
+ 5hx0B 364
285
+ 1npeA 263
286
+ 1s1dA 317
287
+ 2zwaA 673
288
+ 3a72A 353
289
+ 2zb6A 427
290
+ 3scyA 356
291
+ 3b7fA 368
292
+ 3al9A 516
293
+ 3o4hA 576
294
+ 4pxwA 292
295
+ 4wk0A 449
296
+ 2w18A 306
297
+ 5em2A 357
298
+ 1sq9A 378
299
+ 1xipA 367
300
+ 4h5iA 344
301
+ 1jofA 365
302
+ 5ic7A 340
303
+ 5k19A 376
304
+ 6e1zA 307
305
+ 2z2nA 293
306
+ 6e4lA 358
307
+ 6fkwA 576
308
+ 6damA 563
309
+ 1flgA 582
310
+ 4cvbA 562
311
+ 4mh1A 509
312
+ 1z68A 719
313
+ 2z3zA 651
314
+ 4q1vA 707
315
+ 1xfdA 723
316
+ 5d7wA 469
317
+ 1kapP 470
318
+ 3laaA 169
319
+ 1p9hA 179
320
+ 3ultA 114
321
+ 3s6lA 155
322
+ 2xqhA 258
323
+ 4dt5A 143
324
+ 5m5zA 755
325
+ 5lw3A 381
326
+ 1k5cA 333
327
+ 1k4zA 157
328
+ 2ntpA 342
329
+ 3bh7B 314
330
+ 2j8kA 181
331
+ 2vfoA 555
332
+ 3n6zA 339
333
+ 1hf2A 196
334
+ 2x3hB 498
335
+ 1rmgA 422
336
+ 6mfkA 210
337
+ 1l0sA 88
338
+ 2xt2A 197
339
+ 5nzgA 482
340
+ 3kweA 166
341
+ 2w7zA 207
342
+ 3ng9A 520
343
+ 1lktA 104
344
+ 3facA 109
345
+ 3pyiB 143
346
+ 2casA 548
347
+ 1gppA 217
348
+ 3maoA 105
349
+ 1ut7A 147
350
+ 1hxrA 107
351
+ 1t61A 223
352
+ 4qjvA 259
353
+ 3lywA 86
354
+ 3dalA 179
355
+ 5hqhA 96
356
+ 3u7zA 97
357
+ 3r90A 185
358
+ 1tp6A 126
359
+ 3s9xA 159
360
+ 2ex5A 207
361
+ 3gbyA 127
362
+ 5kvbA 146
363
+ 2cu3A 63
364
+ 1c1yB 77
365
+ 5f6rA 173
366
+ 4a6qA 143
367
+ 2w56A 143
368
+ 4lqbA 130
369
+ 4oobA 245
370
+ 3oajA 310
371
+ 3n8bA 75
372
+ 3jumA 157
373
+ 2prxA 114
374
+ 5b1rA 116
375
+ 1ewfA 456
376
+ 4m4dA 448
377
+ 2obdA 472
378
+ 6baqA 196
379
+ 1usuB 132
380
+ 3e8tA 216
381
+ 3aotA 203
382
+ 2rckA 221
383
+ 3l6iA 171
384
+ 3uv1A 190
385
+ 3bqwA 347
386
+ 5mprA 364
387
+ 1kkoA 411
388
+ 4cd8A 313
389
+ 1vd6A 218
390
+ 2g0wA 275
391
+ 4lanA 370
392
+ 3s83A 256
393
+ 2v3gA 273
394
+ 3fkrA 304
395
+ 4z0gA 384
396
+ 3sggA 512
397
+ 5zjbA 232
398
+ 2xfrA 487
399
+ 4g8tA 441
400
+ 5n6fA 365
401
+ 1muwA 386
402
+ 2qhqA 120
403
+ 3h35A 144
404
+ 3kluA 119
405
+ 3fn2A 97
406
+ 2od6A 110
407
+ 1kcfA 240
408
+ 3nlcA 534
409
+ 2zw2A 85
410
+ 4ftxA 158
411
+ 3u2aA 112
412
+ 2hiqA 96
413
+ 1xkpC 126
414
+ 6ih0A 267
415
+ 5c12A 230
416
+ 1w4rA 174
417
+ 3c0fB 85
418
+ 3nbmA 104
419
+ 2r6zA 225
420
+ 5hxdA 237
421
+ 1chdA 198
422
+ 3do8A 135
423
+ 3gohA 297
424
+ 1n0eA 141
425
+ 2q82A 114
426
+ 5kxhA 350
427
+ 3oqiA 222
428
+ 2x4lA 298
429
+ 3d3kA 233
430
+ 3l46A 90
431
+ 2fkcA 247
432
+ 5jphA 142
433
+ 3nytA 359
434
+ 3rhtA 252
435
+ 3dkrA 241
436
+ 2psbA 290
437
+ 1tc5A 187
438
+ 3vrdB 400
439
+ 2je3A 157
440
+ 3g5sA 424
441
+ 1jkeA 145
442
+ 4at0A 483
443
+ 1vi4A 162
444
+ 4u8pC 505
445
+ 4ntcA 325
446
+ 5ipyA 445
447
+ 5nakA 452
448
+ 4z24B 649
449
+ 4opcA 452
450
+ 5cdkA 181
451
+ 2b0aA 186
452
+ 4n2pA 143
453
+ 1j5uA 127
454
+ 1vzyB 286
455
+ 1vq0A 290
456
+ 4ipuA 137
457
+ 4dq9A 149
458
+ 4jtmA 81
459
+ 3gs9A 326
460
+ 3adyA 102
461
+ 3mi0A 215
462
+ 3ib7A 295
463
+ 3g91A 260
464
+ 1vr7A 120
465
+ 4zx2A 325
466
+ 1ds1A 323
467
+ 3zwfA 259
468
+ 1hq0A 295
469
+ 3hbcA 309
470
+ 3p8kA 268
471
+ 1wraA 305
472
+ 3t91A 210
473
+ 3c9fA 531
474
+ 2imhA 226
475
+ 1um0A 365
476
+ 5y0mA 329
477
+ 5u4hA 420
478
+ 1ejdA 419
479
+ 3zh4A 411
480
+ 3swgA 417
481
+ 5ujsA 417
482
+ 3nvsA 426
483
+ 2o0bA 424
484
+ 2pqcA 445
485
+ 3slhA 436
486
+ 1rf6A 427
487
+ 4n3pA 424
488
+ 5bufA 445
489
+ 3rmtA 432
490
+ 4fqdA 436
491
+ 1ud9A 242
492
+ 1t6lA 249
493
+ 1rwzA 244
494
+ 3ifvA 216
495
+ 1iz5A 240
496
+ 3lx2A 247
497
+ 1u7bA 251
498
+ 5tupA 254
499
+ 5h0tA 248
500
+ 5v7mA 255
501
+ 3fdsC 249
502
+ 3aizA 248
503
+ 1b77A 228
504
+ 3p91A 245
505
+ 1dmlA 267
506
+ 3hslX 287
507
+ 2z0lA 299
508
+ 6nibA 345
509
+ 2jerA 366
510
+ 1xknA 353
511
+ 1zbrA 339
512
+ 3hvmA 330
513
+ 1jdwA 360
514
+ 5wpiA 364
515
+ 1g61A 225
516
+ 1h70A 255
517
+ 5m3qA 224
518
+ 1ynfA 429
519
+ 3wn4A 747
520
+ 1io0A 166
521
+ 4rcaB 241
522
+ 4fcgA 296
523
+ 4ecoA 620
524
+ 3wpcA 747
525
+ 4im6A 198
526
+ 4cnmA 283
527
+ 5hzlB 280
528
+ 4fs7A 383
529
+ 2xwtC 234
530
+ 3e4gA 176
531
+ 4wp6A 151
532
+ 5il7A 440
533
+ 1z7xW 460
534
+ 4u7lA 455
535
+ 6fg8A 188
536
+ 2wfhA 181
537
+ 2fy7A 268
538
+ 5wwdA 139
539
+ 1j3aA 129
540
+ 1omzA 253
541
+ 3emfA 113
542
+ 1xw3A 110
543
+ 3h4rA 219
544
+ 3essA 199
545
+ 1o22A 149
546
+ 4ktbA 160
547
+ 1jh6A 181
548
+ 3n08A 151
549
+ 5tsqA 312
550
+ 3e9vA 120
551
+ 4j7hA 446
552
+ 1i4jA 110
553
+ 2wnfA 272
554
+ 3v1aA 48
555
+ 3coqA 89
556
+ 2f60K 60
557
+ 4zgmA 100
558
+ 1i7wB 51
559
+ 6g6kA 89
560
+ 1pbyC 79
561
+ 1a92A 50
562
+ 3alrA 63
563
+ 2wjvD 54
564
+ 2a26A 48
565
+ 1devB 41
566
+ 4l0nA 51
567
+ 4ayaA 59
568
+ 3zxcA 71
569
+ 4pkfB 69
570
+ 2b1yA 101
571
+ 4dncD 42
572
+ 4jpnA 75
573
+ 4e18B 46
574
+ 3vepX 46
575
+ 3v4yB 41
576
+ 1xawA 107
577
+ 1ykhA 95
578
+ 2p64A 51
579
+ 6bscB 48
580
+ 2z3xA 56
581
+ 4uzzB 65
582
+ 3thfA 175
583
+ 1wq6A 59
584
+ 4ke2A 196
585
+ 4lhfA 79
586
+ 2v66B 111
587
+ 3lczA 53
588
+ 2h4oA 62
589
+ 4wjwA 68
590
+ 3kvpA 43
591
+ 3e56A 75
592
+ 3bk3C 67
593
+ 2ds5A 43
594
+ 3zoqB 48
595
+ 3nfgB 120
596
+ 4ksnA 65
597
+ 3ua0A 79
598
+ 3nrtA 93
599
+ 4a9aC 106
600
+ 6hikL 40
data/examples/TIMED.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c53c97b8e7b72035ab53b4d4e22d1184ee2e75290dfd249c8ee2136f92efa24
3
+ size 53412567
data/examples/TIMED.csv.pdf ADDED
Binary file (80.9 kB). View file
 
data/examples/TIMED.txt ADDED
@@ -0,0 +1,615 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ignore_uncommon False
2
+ include_pdbs 1a41
3
+ ##########
4
+ 1a41A 221
5
+ 1a92A 50
6
+ 1b2pA 119
7
+ 1b77A 228
8
+ 1b8kA 90
9
+ 1bx7A 51
10
+ 1c1yB 77
11
+ 1c3mA 145
12
+ 1chdA 198
13
+ 1cruA 448
14
+ 1devB 41
15
+ 1dmlA 267
16
+ 1dqgA 134
17
+ 1ds1A 323
18
+ 1dvoA 152
19
+ 1ejdA 419
20
+ 1ewfA 456
21
+ 1flgA 582
22
+ 1g3pA 192
23
+ 1g61A 225
24
+ 1genA 200
25
+ 1gp0A 133
26
+ 1gppA 217
27
+ 1gprA 158
28
+ 1gxmA 324
29
+ 1h32A 261
30
+ 1h70A 255
31
+ 1hf2A 196
32
+ 1hq0A 295
33
+ 1hxrA 107
34
+ 1i4jA 110
35
+ 1i4uA 181
36
+ 1i7wB 51
37
+ 1igqA 54
38
+ 1io0A 166
39
+ 1itvA 195
40
+ 1iz5A 240
41
+ 1j3aA 129
42
+ 1j5uA 127
43
+ 1jdwA 360
44
+ 1jh6A 181
45
+ 1jkeA 145
46
+ 1jm1A 202
47
+ 1jofA 365
48
+ 1jovA 269
49
+ 1k4zA 157
50
+ 1k5cA 333
51
+ 1k5nA 276
52
+ 1kapP 470
53
+ 1kcfA 240
54
+ 1kkoA 411
55
+ 1kt6A 175
56
+ 1l0sA 88
57
+ 1lktA 104
58
+ 1lpbA 85
59
+ 1lslA 113
60
+ 1luzA 85
61
+ 1muwA 386
62
+ 1n0eA 141
63
+ 1njhA 108
64
+ 1npeA 263
65
+ 1nykA 156
66
+ 1o22A 149
67
+ 1o7iA 115
68
+ 1omzA 253
69
+ 1ouwA 149
70
+ 1oygA 440
71
+ 1p2xA 159
72
+ 1p9hA 179
73
+ 1pbyC 79
74
+ 1pexA 192
75
+ 1pkhA 182
76
+ 1pmhX 183
77
+ 1rf6A 427
78
+ 1rfsA 127
79
+ 1rmgA 422
80
+ 1rwzA 244
81
+ 1s1dA 317
82
+ 1sq9A 378
83
+ 1sr4C 154
84
+ 1suuA 293
85
+ 1t61A 223
86
+ 1t6lA 249
87
+ 1tc5A 187
88
+ 1tl2A 235
89
+ 1tp6A 126
90
+ 1tulA 102
91
+ 1u7bA 251
92
+ 1ud9A 242
93
+ 1um0A 365
94
+ 1usuB 132
95
+ 1ut7A 147
96
+ 1uzkA 152
97
+ 1v6pA 62
98
+ 1v7wA 779
99
+ 1vd6A 218
100
+ 1vi4A 162
101
+ 1vmoA 163
102
+ 1vq0A 290
103
+ 1vr7A 120
104
+ 1vzyB 286
105
+ 1w4rA 174
106
+ 1wq6A 59
107
+ 1wraA 305
108
+ 1wthD 361
109
+ 1x8qA 184
110
+ 1xawA 107
111
+ 1xd5A 112
112
+ 1xfdA 723
113
+ 1xg0C 174
114
+ 1xipA 367
115
+ 1xknA 353
116
+ 1xkpC 126
117
+ 1xksA 374
118
+ 1xw3A 110
119
+ 1xzzA 216
120
+ 1ya5T 89
121
+ 1ykhA 95
122
+ 1ynfA 429
123
+ 1z1yB 175
124
+ 1z68A 719
125
+ 1z7xW 460
126
+ 1zbrA 339
127
+ 2a26A 48
128
+ 2ag4A 164
129
+ 2aydA 76
130
+ 2b0aA 186
131
+ 2b1xA 441
132
+ 2b1yA 101
133
+ 2bhuA 580
134
+ 2bmoA 437
135
+ 2bnmA 194
136
+ 2byoA 183
137
+ 2casA 548
138
+ 2cu3A 63
139
+ 2de6A 389
140
+ 2dpfA 111
141
+ 2ds5A 43
142
+ 2dyiA 162
143
+ 2e12A 93
144
+ 2ebfX 711
145
+ 2ex5A 207
146
+ 2f60K 60
147
+ 2fbaA 492
148
+ 2fdbM 149
149
+ 2fkcA 247
150
+ 2fp8A 302
151
+ 2fy7A 268
152
+ 2g0wA 275
153
+ 2gbwA 449
154
+ 2gudA 121
155
+ 2h4oA 62
156
+ 2hiqA 96
157
+ 2hjeA 210
158
+ 2hr2A 156
159
+ 2ichA 320
160
+ 2imhA 226
161
+ 2j8kA 181
162
+ 2ja9A 175
163
+ 2je3A 157
164
+ 2jerA 366
165
+ 2jg0A 507
166
+ 2ntpA 342
167
+ 2nwfA 141
168
+ 2o0bA 424
169
+ 2o1kA 43
170
+ 2obdA 472
171
+ 2od6A 110
172
+ 2of3A 266
173
+ 2p38A 155
174
+ 2p4oA 302
175
+ 2p57A 124
176
+ 2p64A 51
177
+ 2p6vA 97
178
+ 2pm7A 345
179
+ 2pqcA 445
180
+ 2prxA 114
181
+ 2psbA 290
182
+ 2ptrA 454
183
+ 2q0oC 86
184
+ 2q3wA 109
185
+ 2q4zA 307
186
+ 2q82A 114
187
+ 2qhqA 120
188
+ 2qp2A 498
189
+ 2qpzA 103
190
+ 2r01A 195
191
+ 2r0hA 160
192
+ 2r2cA 121
193
+ 2r6zA 225
194
+ 2ra1A 412
195
+ 2ra8A 351
196
+ 2rckA 221
197
+ 2v3gA 273
198
+ 2v3iA 434
199
+ 2v66B 111
200
+ 2v76A 99
201
+ 2vfoA 555
202
+ 2vq2A 220
203
+ 2vxtI 156
204
+ 2w07B 121
205
+ 2w18A 306
206
+ 2w56A 143
207
+ 2w7qA 192
208
+ 2w7zA 207
209
+ 2wfhA 181
210
+ 2wjvD 54
211
+ 2wnfA 272
212
+ 2x3hB 498
213
+ 2x4lA 298
214
+ 2xfrA 487
215
+ 2xqhA 258
216
+ 2xt2A 197
217
+ 2xwtC 234
218
+ 2y8nB 86
219
+ 2ygnA 146
220
+ 2yhcA 209
221
+ 2yzyA 163
222
+ 2z0lA 299
223
+ 2z2nA 293
224
+ 2z3xA 56
225
+ 2z3zA 651
226
+ 2zb6A 427
227
+ 2zw2A 85
228
+ 2zwaA 673
229
+ 3a0eA 110
230
+ 3a0oA 764
231
+ 3a35A 184
232
+ 3a72A 353
233
+ 3abhA 288
234
+ 3adyA 102
235
+ 3aihA 110
236
+ 3aizA 248
237
+ 3al9A 516
238
+ 3alrA 63
239
+ 3aotA 203
240
+ 3apaA 138
241
+ 3aqgA 133
242
+ 3ayjA 685
243
+ 3b7fA 368
244
+ 3bh7B 314
245
+ 3bk3C 67
246
+ 3bk5A 235
247
+ 3bmzA 185
248
+ 3bqoA 202
249
+ 3bqwA 347
250
+ 3buuA 224
251
+ 3bwzA 171
252
+ 3c0fB 85
253
+ 3c7xA 196
254
+ 3c9fA 531
255
+ 3ca7A 50
256
+ 3cexA 170
257
+ 3coqA 89
258
+ 3cu9A 314
259
+ 3cxbA 302
260
+ 3d3kA 233
261
+ 3d4uB 74
262
+ 3d89A 136
263
+ 3d9xA 114
264
+ 3dadA 324
265
+ 3dalA 179
266
+ 3dasA 334
267
+ 3dkrA 241
268
+ 3do8A 135
269
+ 3dqyA 106
270
+ 3dr2A 299
271
+ 3dzmA 208
272
+ 3dzwA 109
273
+ 3e3vA 154
274
+ 3e4gA 176
275
+ 3e56A 75
276
+ 3e7jA 743
277
+ 3e8tA 216
278
+ 3e9vA 120
279
+ 3emfA 113
280
+ 3essA 199
281
+ 3eunA 81
282
+ 3f0cA 193
283
+ 3f3fC 475
284
+ 3facA 109
285
+ 3fb9A 89
286
+ 3fdsC 249
287
+ 3fkrA 304
288
+ 3fn2A 97
289
+ 3g3zA 142
290
+ 3g4eA 297
291
+ 3g5sA 424
292
+ 3g91A 260
293
+ 3gbyA 127
294
+ 3giaA 433
295
+ 3gkeA 340
296
+ 3gohA 297
297
+ 3gs9A 326
298
+ 3gzxA 440
299
+ 3h35A 144
300
+ 3h4rA 219
301
+ 3h6jA 438
302
+ 3h6qA 168
303
+ 3hbcA 309
304
+ 3hrzB 233
305
+ 3hslX 287
306
+ 3hvmA 330
307
+ 3iagC 422
308
+ 3ib7A 295
309
+ 3ifvA 216
310
+ 3iisM 151
311
+ 3jrtA 166
312
+ 3jumA 157
313
+ 3k1uA 314
314
+ 3k4iA 202
315
+ 3klkA 1006
316
+ 3kluA 119
317
+ 3ksnA 177
318
+ 3kstA 291
319
+ 3kvpA 43
320
+ 3kw0A 190
321
+ 3kweA 166
322
+ 3kyfA 231
323
+ 3l46A 90
324
+ 3l6iA 171
325
+ 3laaA 169
326
+ 3lczA 53
327
+ 3lx2A 247
328
+ 3lywA 86
329
+ 3maoA 105
330
+ 3mcbB 58
331
+ 3mezC 110
332
+ 3mi0A 215
333
+ 3n08A 151
334
+ 3n6zA 339
335
+ 3n8bA 75
336
+ 3n91A 315
337
+ 3nbmA 104
338
+ 3nfgB 120
339
+ 3ng9A 520
340
+ 3nlcA 534
341
+ 3nrtA 93
342
+ 3nvoA 250
343
+ 3nvsA 426
344
+ 3nytA 359
345
+ 3o4hA 576
346
+ 3o4pA 314
347
+ 3oajA 310
348
+ 3oqiA 222
349
+ 3p8kA 268
350
+ 3p91A 245
351
+ 3pyiB 143
352
+ 3q1nA 294
353
+ 3qb9A 159
354
+ 3qz4A 306
355
+ 3r4zA 358
356
+ 3r90A 185
357
+ 3rf0A 199
358
+ 3rhtA 252
359
+ 3rmtA 432
360
+ 3ro3A 159
361
+ 3s18A 224
362
+ 3s6lA 155
363
+ 3s83A 256
364
+ 3s9xA 159
365
+ 3scyA 356
366
+ 3sggA 512
367
+ 3slhA 436
368
+ 3swgA 417
369
+ 3t91A 210
370
+ 3tbdA 331
371
+ 3tdqA 86
372
+ 3teeA 206
373
+ 3thfA 175
374
+ 3towA 152
375
+ 3tvjA 83
376
+ 3ty1A 384
377
+ 3u2aA 112
378
+ 3u7zA 97
379
+ 3ua0A 79
380
+ 3ultA 114
381
+ 3ut4A 128
382
+ 3uv1A 190
383
+ 3v1aA 48
384
+ 3v4yB 41
385
+ 3vcaA 398
386
+ 3vepX 46
387
+ 3vrdB 400
388
+ 3vsnA 632
389
+ 3vwcA 146
390
+ 3wasA 389
391
+ 3wfdB 449
392
+ 3witA 64
393
+ 3wjtA 178
394
+ 3wkgA 410
395
+ 3wmvA 150
396
+ 3wn4A 747
397
+ 3wocA 138
398
+ 3wpcA 747
399
+ 3wwlA 54
400
+ 3zbdA 110
401
+ 3zh4A 411
402
+ 3zoqB 48
403
+ 3zwfA 259
404
+ 3zxcA 71
405
+ 4a02A 166
406
+ 4a5uB 80
407
+ 4a6qA 143
408
+ 4a9aC 106
409
+ 4adyA 849
410
+ 4adzA 90
411
+ 4aivA 113
412
+ 4aqoA 86
413
+ 4at0A 483
414
+ 4ayaA 59
415
+ 4ayoA 434
416
+ 4c08A 325
417
+ 4c4aA 642
418
+ 4cd8A 313
419
+ 4cj0A 534
420
+ 4cnmA 283
421
+ 4cvbA 562
422
+ 4ddnD 154
423
+ 4dloA 351
424
+ 4dncD 42
425
+ 4dq9A 149
426
+ 4dqaA 349
427
+ 4dt5A 143
428
+ 4e18B 46
429
+ 4ebbA 450
430
+ 4ecoA 620
431
+ 4efpA 235
432
+ 4egdA 221
433
+ 4fcgA 296
434
+ 4fmrA 234
435
+ 4fnvA 659
436
+ 4fqdA 436
437
+ 4fs7A 383
438
+ 4ftxA 158
439
+ 4fzqA 79
440
+ 4g8tA 441
441
+ 4gc1A 275
442
+ 4h3oA 105
443
+ 4h5iA 344
444
+ 4hhvA 103
445
+ 4hi6A 138
446
+ 4hquA 95
447
+ 4i1kA 118
448
+ 4i4oA 146
449
+ 4i5jA 266
450
+ 4i86A 102
451
+ 4im6A 198
452
+ 4ipuA 137
453
+ 4j5tA 788
454
+ 4j7hA 446
455
+ 4joxA 118
456
+ 4jpnA 75
457
+ 4jtmA 81
458
+ 4jzzA 336
459
+ 4k6jA 497
460
+ 4k8wA 118
461
+ 4ke2A 196
462
+ 4ksnA 65
463
+ 4ktbA 160
464
+ 4ktpA 767
465
+ 4l0nA 51
466
+ 4lanA 370
467
+ 4lctA 318
468
+ 4le7A 254
469
+ 4lhfA 79
470
+ 4lo0C 144
471
+ 4lqbA 130
472
+ 4lqzA 131
473
+ 4luqC 123
474
+ 4m4dA 448
475
+ 4maiA 187
476
+ 4mh1A 509
477
+ 4mq0A 438
478
+ 4mqwA 88
479
+ 4mxtA 187
480
+ 4mzaA 432
481
+ 4n1iA 312
482
+ 4n2pA 143
483
+ 4n3pA 424
484
+ 4nq0A 254
485
+ 4ntcA 325
486
+ 4o06A 102
487
+ 4oitA 106
488
+ 4oobA 245
489
+ 4opcA 452
490
+ 4ozwA 334
491
+ 4p6zG 587
492
+ 4pfoA 755
493
+ 4pitA 140
494
+ 4pkfB 69
495
+ 4pvaA 328
496
+ 4pxwA 292
497
+ 4q1vA 707
498
+ 4qa8A 210
499
+ 4qdcA 369
500
+ 4qjvA 259
501
+ 4qqsA 312
502
+ 4r6rE 133
503
+ 4r9pA 210
504
+ 4rcaB 241
505
+ 4rg1A 286
506
+ 4rt6B 172
507
+ 4tkcA 118
508
+ 4u6dA 382
509
+ 4u7lA 455
510
+ 4u8pC 505
511
+ 4uzzB 65
512
+ 4v1gA 85
513
+ 4v2bA 106
514
+ 4weeA 135
515
+ 4wjwA 68
516
+ 4wk0A 449
517
+ 4wp6A 151
518
+ 4wu0A 360
519
+ 4y5jA 227
520
+ 4ya2H 222
521
+ 4ytbA 424
522
+ 4z0gA 384
523
+ 4z24B 649
524
+ 4z48A 240
525
+ 4zgmA 100
526
+ 4zhbA 104
527
+ 4zx2A 325
528
+ 5a8cA 299
529
+ 5agdA 333
530
+ 5aycA 386
531
+ 5b1rA 116
532
+ 5bowA 151
533
+ 5bq8A 104
534
+ 5bufA 445
535
+ 5c0pA 284
536
+ 5c12A 230
537
+ 5cdkA 181
538
+ 5cxmB 99
539
+ 5d7uA 53
540
+ 5d7wA 469
541
+ 5dicA 115
542
+ 5em2A 357
543
+ 5f6rA 173
544
+ 5flwA 302
545
+ 5gtqA 307
546
+ 5gvyA 145
547
+ 5gzkA 418
548
+ 5h0tA 248
549
+ 5h3xA 267
550
+ 5hqhA 96
551
+ 5hx0B 364
552
+ 5hxdA 237
553
+ 5hzlB 280
554
+ 5ic7A 340
555
+ 5il7A 440
556
+ 5ipyA 445
557
+ 5j3tA 126
558
+ 5j76A 109
559
+ 5jphA 142
560
+ 5k19A 376
561
+ 5krpC 150
562
+ 5kvbA 146
563
+ 5kxhA 350
564
+ 5lf2A 302
565
+ 5lw3A 381
566
+ 5m3qA 224
567
+ 5m5zA 755
568
+ 5m7yA 425
569
+ 5mprA 364
570
+ 5mriA 662
571
+ 5n6fA 365
572
+ 5nakA 452
573
+ 5nzgA 482
574
+ 5ol4B 122
575
+ 5tsqA 312
576
+ 5tupA 254
577
+ 5u1mA 105
578
+ 5u4hA 420
579
+ 5ujsA 417
580
+ 5v6fA 137
581
+ 5v7mA 255
582
+ 5vi4A 146
583
+ 5wpiA 364
584
+ 5wwdA 139
585
+ 5x56A 103
586
+ 5xlyB 121
587
+ 5y0mA 329
588
+ 5y5sQ 57
589
+ 5yh4A 179
590
+ 5zcjC 121
591
+ 5zjbA 232
592
+ 6a2qA 98
593
+ 6b0gE 154
594
+ 6baqA 196
595
+ 6bscB 48
596
+ 6damA 563
597
+ 6e1zA 307
598
+ 6e4lA 358
599
+ 6er6A 88
600
+ 6fg8A 188
601
+ 6fkwA 576
602
+ 6flwA 144
603
+ 6fmeB 505
604
+ 6frwA 411
605
+ 6g6kA 89
606
+ 6ggrA 168
607
+ 6gy5A 285
608
+ 6hcwA 502
609
+ 6hikL 40
610
+ 6i18A 484
611
+ 6ih0A 267
612
+ 6mfkA 210
613
+ 6ms3B 511
614
+ 6nibA 345
615
+ 6nkjA 412
data/examples/TIMED_1a41.pdb ADDED
The diff for this file is too large to render. See raw diff
 
data/examples/denseCPD.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd96d223f29ed356e1feed51f3651cade907a4bf3b4b20cfe1290a89fef8b330
3
+ size 75520000
data/examples/denseCPD.csv.pdf ADDED
Binary file (81.1 kB). View file
 
data/examples/denseCPD.txt ADDED
@@ -0,0 +1,609 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ignore_uncommon False
2
+ include_pdbs
3
+ ##########
4
+ 3kweA 166
5
+ 1devB 41
6
+ 1hf2A 196
7
+ 2p57A 124
8
+ 2qhqA 120
9
+ 2v3gA 273
10
+ 4h5iA 344
11
+ 4dt5A 143
12
+ 4wp6A 151
13
+ 3scyA 356
14
+ 2fdbM 149
15
+ 6flwA 144
16
+ 1tulA 102
17
+ 3thfA 175
18
+ 5zcjC 121
19
+ 2q0oC 86
20
+ 3nrtA 93
21
+ 3jumA 157
22
+ 4jpnA 75
23
+ 1chdA 198
24
+ 2r01A 195
25
+ 2e12A 93
26
+ 2yhcA 209
27
+ 5hqhA 96
28
+ 2casA 548
29
+ 4oitA 106
30
+ 4cj0A 534
31
+ 6e4lA 358
32
+ 3zwfA 259
33
+ 1i7wB 51
34
+ 4y5jA 227
35
+ 6nibA 345
36
+ 3coqA 89
37
+ 3tbdA 331
38
+ 2ebfX 711
39
+ 3n8bA 75
40
+ 1omzA 253
41
+ 3kyfA 231
42
+ 3fb9A 89
43
+ 3a0eA 110
44
+ 2b0aA 186
45
+ 1p2xA 159
46
+ 1x8qA 184
47
+ 2je3A 157
48
+ 2od6A 110
49
+ 3o4pA 314
50
+ 4k6jA 497
51
+ 4lqbA 130
52
+ 1ds1A 323
53
+ 1xd5A 112
54
+ 1k5cA 333
55
+ 2gudA 121
56
+ 1l0sA 88
57
+ 3ng9A 520
58
+ 4j7hA 446
59
+ 3cu9A 314
60
+ 4fqdA 436
61
+ 2f60K 60
62
+ 5hzlB 280
63
+ 5zjbA 232
64
+ 4p6zG 587
65
+ 2g0wA 275
66
+ 2dpfA 111
67
+ 2ptrA 454
68
+ 3zxcA 71
69
+ 3dkrA 241
70
+ 1b77A 228
71
+ 2w18A 306
72
+ 3h4rA 219
73
+ 4egdA 221
74
+ 3aihA 110
75
+ 4c4aA 642
76
+ 4ke2A 196
77
+ 3hbcA 309
78
+ 1gppA 217
79
+ 4mh1A 509
80
+ 3ua0A 79
81
+ 1t61A 223
82
+ 1sq9A 378
83
+ 3slhA 436
84
+ 3zbdA 110
85
+ 2w7zA 207
86
+ 4rcaB 241
87
+ 5ujsA 417
88
+ 1xksA 374
89
+ 4ebbA 450
90
+ 5y5sQ 0
91
+ 1kcfA 240
92
+ 3adyA 102
93
+ 1z7xW 460
94
+ 3h6jA 438
95
+ 3u7zA 97
96
+ 3oajA 310
97
+ 1oygA 440
98
+ 3hslX 287
99
+ 3a35A 184
100
+ 1o7iA 115
101
+ 1dqgA 134
102
+ 6ih0A 267
103
+ 5bq8A 104
104
+ 1h70A 255
105
+ 1dmlA 267
106
+ 5a8cA 299
107
+ 3e8tA 216
108
+ 6er6A 88
109
+ 5il7A 440
110
+ 2wjvD 54
111
+ 4uzzB 65
112
+ 3fkrA 304
113
+ 3gzxA 440
114
+ 2v66B 111
115
+ 1lslA 113
116
+ 5nakA 452
117
+ 3al9A 516
118
+ 2z0lA 299
119
+ 3dqyA 106
120
+ 4o06A 102
121
+ 2q4zA 307
122
+ 6fmeB 505
123
+ 1hq0A 295
124
+ 4qdcA 369
125
+ 3v4yB 41
126
+ 1flgA 582
127
+ 2nwfA 141
128
+ 1p9hA 179
129
+ 2qpzA 103
130
+ 3wasA 389
131
+ 4n2pA 143
132
+ 3o4hA 576
133
+ 4zhbA 104
134
+ 4lqzA 131
135
+ 5kxhA 350
136
+ 1k5nA 276
137
+ 4ozwA 334
138
+ 3g91A 260
139
+ 3lczA 53
140
+ 3tdqA 86
141
+ 3l46A 90
142
+ 5dicA 115
143
+ 3rhtA 252
144
+ 5nzgA 482
145
+ 3dadA 324
146
+ 2x4lA 298
147
+ 1z1yB 175
148
+ 5y0mA 329
149
+ 3wn4A 747
150
+ 3b7fA 368
151
+ 4wu0A 360
152
+ 4mq0A 438
153
+ 3wpcA 747
154
+ 1muwA 386
155
+ 3buuA 224
156
+ 5lw3A 381
157
+ 3lywA 86
158
+ 5aycA 386
159
+ 1vr7A 120
160
+ 5gvyA 145
161
+ 4fnvA 659
162
+ 5agdA 333
163
+ 3s18A 224
164
+ 1itvA 195
165
+ 3c9fA 531
166
+ 1lktA 104
167
+ 3ksnA 177
168
+ 4z48A 240
169
+ 4u7lA 455
170
+ 1sr4C 154
171
+ 5mprA 364
172
+ 1jofA 365
173
+ 1uzkA 152
174
+ 4adzA 90
175
+ 2z3xA 56
176
+ 1xfdA 723
177
+ 1jh6A 181
178
+ 1xzzA 216
179
+ 6g6kA 89
180
+ 1jm1A 202
181
+ 1o22A 149
182
+ 3d89A 136
183
+ 3sggA 512
184
+ 4a5uB 80
185
+ 3g3zA 142
186
+ 1s1dA 317
187
+ 1ejdA 419
188
+ 4u8pC 505
189
+ 3iagC 422
190
+ 2zwaA 673
191
+ 3pyiB 143
192
+ 4wk0A 449
193
+ 3rmtA 432
194
+ 3s9xA 159
195
+ 2vfoA 555
196
+ 3a0oA 764
197
+ 2bnmA 194
198
+ 3gs9A 326
199
+ 3eunA 81
200
+ 5flwA 302
201
+ 4hhvA 103
202
+ 4at0A 483
203
+ 5ipyA 445
204
+ 2bhuA 580
205
+ 1tp6A 126
206
+ 1kkoA 411
207
+ 2b1xA 441
208
+ 5d7wA 469
209
+ 4ecoA 620
210
+ 1jdwA 360
211
+ 3gbyA 127
212
+ 3oqiA 222
213
+ 1gxmA 324
214
+ 3kvpA 43
215
+ 4v2bA 106
216
+ 3nvsA 426
217
+ 2ra8A 351
218
+ 1k4zA 157
219
+ 3ut4A 128
220
+ 3q1nA 294
221
+ 2w7qA 192
222
+ 3teeA 206
223
+ 4qa8A 210
224
+ 3gohA 297
225
+ 4zgmA 100
226
+ 1wthD 361
227
+ 6gy5A 285
228
+ 4ayoA 434
229
+ 1u7bA 251
230
+ 2byoA 183
231
+ 3dzwA 109
232
+ 4cd8A 313
233
+ 6bscB 48
234
+ 1tc5A 187
235
+ 4n3pA 424
236
+ 4n1iA 312
237
+ 3k4iA 202
238
+ 3ib7A 295
239
+ 3facA 109
240
+ 1j3aA 129
241
+ 1xawA 107
242
+ 3jrtA 166
243
+ 3vepX 46
244
+ 4rg1A 286
245
+ 3lx2A 247
246
+ 2b1yA 101
247
+ 4cnmA 283
248
+ 1vq0A 290
249
+ 1ykhA 95
250
+ 3f3fC 475
251
+ 4i5jA 266
252
+ 3e3vA 154
253
+ 1rmgA 422
254
+ 2dyiA 162
255
+ 2qp2A 498
256
+ 3wmvA 150
257
+ 2xwtC 234
258
+ 1g3pA 192
259
+ 6frwA 411
260
+ 2cu3A 63
261
+ 5jphA 142
262
+ 5hx0B 364
263
+ 5tsqA 312
264
+ 4l0nA 51
265
+ 4i1kA 118
266
+ 2ja9A 175
267
+ 4weeA 135
268
+ 5u1mA 105
269
+ 2q3wA 109
270
+ 3d3kA 233
271
+ 4im6A 198
272
+ 4ntcA 325
273
+ 1t6lA 249
274
+ 1j5uA 127
275
+ 4luqC 123
276
+ 3d4uB 74
277
+ 5tupA 254
278
+ 4z24B 649
279
+ 3ca7A 50
280
+ 4tkcA 118
281
+ 3a72A 353
282
+ 3g4eA 297
283
+ 6fkwA 576
284
+ 5bowA 151
285
+ 4dloA 351
286
+ 3hvmA 330
287
+ 4ya2H 222
288
+ 4h3oA 105
289
+ 6damA 563
290
+ 2yzyA 163
291
+ 3gkeA 340
292
+ 5m7yA 425
293
+ 1ouwA 149
294
+ 4ipuA 137
295
+ 4k8wA 118
296
+ 2pm7A 345
297
+ 3bh7B 314
298
+ 2v76A 99
299
+ 3wocA 138
300
+ 4efpA 235
301
+ 4dncD 42
302
+ 4fcgA 296
303
+ 3tvjA 83
304
+ 4lctA 318
305
+ 3cexA 170
306
+ 5vi4A 146
307
+ 3v1aA 48
308
+ 4qqsA 312
309
+ 2prxA 114
310
+ 4le7A 254
311
+ 3aizA 248
312
+ 2o0bA 424
313
+ 4maiA 187
314
+ 2imhA 226
315
+ 4dq9A 149
316
+ 5ol4B 122
317
+ 3mcbB 58
318
+ 4g8tA 441
319
+ 2r6zA 225
320
+ 1xw3A 110
321
+ 4a9aC 106
322
+ 4mqwA 88
323
+ 2obdA 472
324
+ 3f0cA 193
325
+ 2ntpA 342
326
+ 5h3xA 267
327
+ 3nytA 359
328
+ 3mezC 110
329
+ 2de6A 389
330
+ 5j76A 109
331
+ 1c3mA 145
332
+ 3zh4A 411
333
+ 5b1rA 116
334
+ 1iz5A 240
335
+ 6i18A 484
336
+ 3wfdB 449
337
+ 3aotA 203
338
+ 3zoqB 48
339
+ 5yh4A 179
340
+ 5c0pA 284
341
+ 2z3zA 651
342
+ 6b0gE 154
343
+ 1vzyB 286
344
+ 5mriA 662
345
+ 1i4uA 181
346
+ 4fs7A 383
347
+ 1vmoA 163
348
+ 3e4gA 176
349
+ 4lanA 370
350
+ 5hxdA 237
351
+ 2fkcA 247
352
+ 3hrzB 233
353
+ 4m4dA 448
354
+ 1jkeA 145
355
+ 4ddnD 154
356
+ 2fp8A 302
357
+ 4dqaA 349
358
+ 3dzmA 208
359
+ 1genA 200
360
+ 3rf0A 199
361
+ 2q82A 114
362
+ 3abhA 288
363
+ 1bx7A 51
364
+ 3fn2A 97
365
+ 6baqA 196
366
+ 4nq0A 254
367
+ 2ygnA 146
368
+ 4lhfA 79
369
+ 3emfA 113
370
+ 2y8nB 86
371
+ 3r90A 185
372
+ 5kvbA 146
373
+ 3bqoA 202
374
+ 5d7uA 53
375
+ 4fmrA 234
376
+ 4fzqA 79
377
+ 5f6rA 173
378
+ 1pkhA 182
379
+ 1njhA 108
380
+ 2o1kA 43
381
+ 1ud9A 242
382
+ 1pbyC 79
383
+ 3nbmA 104
384
+ 3u2aA 112
385
+ 4a6qA 143
386
+ 5m5zA 755
387
+ 5ic7A 340
388
+ 3e56A 75
389
+ 6e1zA 307
390
+ 3witA 64
391
+ 4u6dA 382
392
+ 3alrA 63
393
+ 4i4oA 146
394
+ 2ichA 320
395
+ 4a02A 166
396
+ 3p91A 245
397
+ 2ag4A 164
398
+ 1kt6A 175
399
+ 1z68A 719
400
+ 4r6rE 133
401
+ 2zb6A 427
402
+ 2xt2A 197
403
+ 1xknA 353
404
+ 5u4hA 420
405
+ 5j3tA 126
406
+ 4pfoA 755
407
+ 3iisM 151
408
+ 1usuB 132
409
+ 1ewfA 456
410
+ 3fdsC 249
411
+ 3nlcA 534
412
+ 6mfkA 210
413
+ 2wfhA 181
414
+ 1rf6A 427
415
+ 4aqoA 86
416
+ 2p6vA 97
417
+ 2p4oA 302
418
+ 2r2cA 121
419
+ 5lf2A 302
420
+ 3kstA 291
421
+ 2of3A 266
422
+ 3vrdB 400
423
+ 1c1yB 77
424
+ 2h4oA 62
425
+ 3s83A 256
426
+ 3vwcA 146
427
+ 3bk3C 67
428
+ 2w07B 121
429
+ 1nykA 156
430
+ 4i86A 102
431
+ 1wq6A 59
432
+ 1a41A 221
433
+ 3r4zA 358
434
+ 5wpiA 364
435
+ 3kluA 119
436
+ 1vi4A 162
437
+ 4v1gA 85
438
+ 2aydA 76
439
+ 3apaA 138
440
+ 3do8A 135
441
+ 3e9vA 120
442
+ 6ggrA 168
443
+ 2a26A 48
444
+ 1w4rA 174
445
+ 3dalA 179
446
+ 3ifvA 216
447
+ 3cxbA 302
448
+ 3maoA 105
449
+ 5bufA 445
450
+ 3k1uA 314
451
+ 3aqgA 133
452
+ 2gbwA 449
453
+ 3bqwA 347
454
+ 6ms3B 511
455
+ 3qb9A 159
456
+ 4j5tA 788
457
+ 4ktbA 160
458
+ 4adyA 849
459
+ 1um0A 365
460
+ 1zbrA 339
461
+ 3l6iA 171
462
+ 2hjeA 210
463
+ 2p64A 51
464
+ 1lpbA 85
465
+ 6fg8A 188
466
+ 4wjwA 68
467
+ 4hquA 95
468
+ 1tl2A 235
469
+ 1hxrA 107
470
+ 2wnfA 272
471
+ 3bwzA 171
472
+ 1pmhX 183
473
+ 3vsnA 632
474
+ 1rwzA 244
475
+ 4pkfB 69
476
+ 4ayaA 59
477
+ 5n6fA 365
478
+ 1kapP 470
479
+ 4pitA 140
480
+ 3swgA 417
481
+ 2hiqA 96
482
+ 1b8kA 90
483
+ 4jtmA 81
484
+ 1v7wA 779
485
+ 5m3qA 224
486
+ 1io0A 166
487
+ 2r0hA 160
488
+ 6a2qA 98
489
+ 4zx2A 325
490
+ 3ultA 114
491
+ 2psbA 290
492
+ 2p38A 155
493
+ 1i4jA 110
494
+ 1ut7A 147
495
+ 4ftxA 158
496
+ 5x56A 103
497
+ 3n91A 315
498
+ 1b2pA 119
499
+ 2ex5A 207
500
+ 4lo0C 144
501
+ 3ty1A 384
502
+ 1xipA 367
503
+ 1gp0A 133
504
+ 5c12A 230
505
+ 5v6fA 137
506
+ 4joxA 118
507
+ 2rckA 221
508
+ 4cvbA 562
509
+ 4rt6B 172
510
+ 4gc1A 275
511
+ 1cruA 448
512
+ 5krpC 150
513
+ 1gprA 158
514
+ 5gtqA 307
515
+ 4hi6A 138
516
+ 4opcA 452
517
+ 3wwlA 54
518
+ 3qz4A 306
519
+ 1xkpC 126
520
+ 2fbaA 492
521
+ 2x3hB 498
522
+ 3n6zA 339
523
+ 3s6lA 155
524
+ 1vd6A 218
525
+ 3c0fB 85
526
+ 1pexA 192
527
+ 1rfsA 127
528
+ 3wjtA 178
529
+ 3dr2A 299
530
+ 4oobA 245
531
+ 2bmoA 437
532
+ 3c7xA 196
533
+ 3h35A 144
534
+ 5k19A 376
535
+ 4r9pA 210
536
+ 1dvoA 152
537
+ 1suuA 293
538
+ 3g5sA 424
539
+ 4ksnA 65
540
+ 5xlyB 121
541
+ 5em2A 357
542
+ 1ynfA 429
543
+ 4ktpA 767
544
+ 3wkgA 410
545
+ 5gzkA 418
546
+ 3klkA 1006
547
+ 2ds5A 43
548
+ 1h32A 261
549
+ 2v3iA 434
550
+ 1n0eA 141
551
+ 4qjvA 259
552
+ 5h0tA 248
553
+ 2zw2A 85
554
+ 5cdkA 181
555
+ 3uv1A 190
556
+ 4z0gA 384
557
+ 3nfgB 120
558
+ 4jzzA 336
559
+ 3nvoA 250
560
+ 2z2nA 293
561
+ 2hr2A 156
562
+ 4q1vA 707
563
+ 4mxtA 187
564
+ 1npeA 263
565
+ 1ya5T 89
566
+ 2xfrA 487
567
+ 2pqcA 445
568
+ 6hikL 40
569
+ 4e18B 46
570
+ 5v7mA 255
571
+ 3towA 152
572
+ 4pxwA 292
573
+ 3bmzA 185
574
+ 4c08A 325
575
+ 3n08A 151
576
+ 3mi0A 215
577
+ 1jovA 269
578
+ 1g61A 225
579
+ 2vxtI 156
580
+ 2ra1A 412
581
+ 3e7jA 743
582
+ 1igqA 54
583
+ 3ro3A 159
584
+ 5wwdA 139
585
+ 2xqhA 258
586
+ 4mzaA 432
587
+ 3t91A 210
588
+ 4aivA 113
589
+ 4pvaA 328
590
+ 1luzA 85
591
+ 3laaA 169
592
+ 3h6qA 168
593
+ 3d9xA 114
594
+ 3p8kA 268
595
+ 3essA 199
596
+ 1a92A 50
597
+ 1wraA 305
598
+ 3giaA 433
599
+ 2jerA 366
600
+ 2jg0A 507
601
+ 1v6pA 62
602
+ 3bk5A 235
603
+ 5cxmB 99
604
+ 2w56A 143
605
+ 3dasA 334
606
+ 2fy7A 268
607
+ 2j8kA 181
608
+ 1xg0C 174
609
+ 2vq2A 220
data/examples/evoEF2.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f18352b896da8d7361c3596e84b89a56d37004fe24640bf3bf408e226d25304d
3
+ size 12122480
data/examples/evoEF2.csv.pdf ADDED
Binary file (80.1 kB). View file
 
data/examples/evoEF2.txt ADDED
@@ -0,0 +1,609 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ignore_uncommon False
2
+ include_pdbs
3
+ ##########
4
+ 1p2xA 159
5
+ 1xg0C 174
6
+ 3g3zA 142
7
+ 3rf0A 199
8
+ 4i5jA 266
9
+ 2ptrA 454
10
+ 3f0cA 193
11
+ 4a5uB 80
12
+ 2p57A 124
13
+ 2q0oC 86
14
+ 6er6A 88
15
+ 1h32A 261
16
+ 3e3vA 154
17
+ 3cxbA 302
18
+ 1dvoA 152
19
+ 5dicA 115
20
+ 2bnmA 194
21
+ 4pfoA 755
22
+ 2ebfX 711
23
+ 3giaA 433
24
+ 1a41A 221
25
+ 3cexA 170
26
+ 4ebbA 450
27
+ 3jrtA 166
28
+ 3wfdB 449
29
+ 4v1gA 85
30
+ 3qb9A 159
31
+ 3abhA 288
32
+ 3nvoA 250
33
+ 2o1kA 43
34
+ 5x56A 103
35
+ 2ra1A 412
36
+ 4adzA 90
37
+ 2p6vA 97
38
+ 3k4iA 202
39
+ 4lctA 318
40
+ 4adyA 849
41
+ 4zhbA 104
42
+ 4p6zG 587
43
+ 4nq0A 254
44
+ 3dadA 324
45
+ 2vq2A 220
46
+ 4dloA 351
47
+ 2of3A 266
48
+ 4y5jA 227
49
+ 2pm7A 345
50
+ 2hr2A 156
51
+ 3ro3A 159
52
+ 3bqoA 202
53
+ 3ut4A 128
54
+ 2yhcA 209
55
+ 4k6jA 497
56
+ 3iisM 151
57
+ 5agdA 333
58
+ 2fbaA 492
59
+ 3e7jA 743
60
+ 1v7wA 779
61
+ 3a0oA 764
62
+ 4wu0A 360
63
+ 4ozwA 334
64
+ 4cj0A 534
65
+ 1gxmA 324
66
+ 5m7yA 425
67
+ 4fnvA 659
68
+ 5gzkA 418
69
+ 4ayoA 434
70
+ 3wkgA 410
71
+ 3vsnA 632
72
+ 2jg0A 507
73
+ 4j5tA 788
74
+ 4ktpA 767
75
+ 4mqwA 88
76
+ 5lf2A 302
77
+ 5mriA 662
78
+ 5ol4B 122
79
+ 1bx7A 51
80
+ 3ca7A 50
81
+ 3tvjA 83
82
+ 3tbdA 331
83
+ 1uzkA 152
84
+ 5bq8A 104
85
+ 3klkA 1006
86
+ 1b8kA 90
87
+ 1v6pA 62
88
+ 4hquA 95
89
+ 4k8wA 118
90
+ 6a2qA 98
91
+ 1lpbA 85
92
+ 3hrzB 233
93
+ 6fmeB 505
94
+ 2aydA 76
95
+ 2ra8A 351
96
+ 4fzqA 79
97
+ 3d4uB 74
98
+ 3wwlA 54
99
+ 2r01A 195
100
+ 1lslA 113
101
+ 3f3fC 475
102
+ 2q4zA 307
103
+ 2de6A 389
104
+ 3d9xA 114
105
+ 2hjeA 210
106
+ 3mcbB 58
107
+ 2y8nB 86
108
+ 3witA 64
109
+ 1ya5T 89
110
+ 2dyiA 162
111
+ 3kyfA 231
112
+ 2v76A 99
113
+ 2e12A 93
114
+ 1g3pA 192
115
+ 4o06A 102
116
+ 3fb9A 89
117
+ 2p38A 155
118
+ 1igqA 54
119
+ 4hhvA 103
120
+ 3teeA 206
121
+ 5j3tA 126
122
+ 5h3xA 267
123
+ 3zbdA 110
124
+ 5d7uA 53
125
+ 5zcjC 121
126
+ 5u1mA 105
127
+ 1wthD 361
128
+ 4rg1A 286
129
+ 1kt6A 175
130
+ 2ja9A 175
131
+ 1i4uA 181
132
+ 4i86A 102
133
+ 1o7iA 115
134
+ 1x8qA 184
135
+ 2ichA 320
136
+ 3dzmA 208
137
+ 3n91A 315
138
+ 1luzA 85
139
+ 4lqzA 131
140
+ 4i1kA 118
141
+ 5xlyB 121
142
+ 3a35A 184
143
+ 3tdqA 86
144
+ 4mxtA 187
145
+ 3wjtA 178
146
+ 3buuA 224
147
+ 3ksnA 177
148
+ 2w7qA 192
149
+ 2yzyA 163
150
+ 4z48A 240
151
+ 3bk5A 235
152
+ 4qa8A 210
153
+ 2byoA 183
154
+ 3bmzA 185
155
+ 4egdA 221
156
+ 4joxA 118
157
+ 3h6jA 438
158
+ 2bhuA 580
159
+ 1pmhX 183
160
+ 6ggrA 168
161
+ 4dqaA 349
162
+ 4v2bA 106
163
+ 4weeA 135
164
+ 2w07B 121
165
+ 4r9pA 210
166
+ 2r2cA 121
167
+ 2r0hA 160
168
+ 4aqoA 86
169
+ 4luqC 123
170
+ 3iagC 422
171
+ 1k5nA 276
172
+ 2ygnA 146
173
+ 3bwzA 171
174
+ 4fmrA 234
175
+ 1njhA 108
176
+ 4hi6A 138
177
+ 1pkhA 182
178
+ 1gp0A 133
179
+ 3q1nA 294
180
+ 2ag4A 164
181
+ 2v3iA 434
182
+ 3ty1A 384
183
+ 1gprA 158
184
+ 3aihA 110
185
+ 4c4aA 642
186
+ 1tulA 102
187
+ 4a02A 166
188
+ 4c08A 325
189
+ 4maiA 187
190
+ 1jovA 269
191
+ 3wmvA 150
192
+ 2fdbM 149
193
+ 1dqgA 134
194
+ 1xzzA 216
195
+ 6i18A 484
196
+ 4i4oA 146
197
+ 4efpA 235
198
+ 5yh4A 179
199
+ 3h6qA 168
200
+ 5bowA 151
201
+ 5vi4A 146
202
+ 2vxtI 156
203
+ 3vwcA 146
204
+ 4lo0C 144
205
+ 1sr4C 154
206
+ 2dpfA 111
207
+ 3dzwA 109
208
+ 3a0eA 110
209
+ 1xd5A 112
210
+ 4h3oA 105
211
+ 4tkcA 118
212
+ 5j76A 109
213
+ 3mezC 110
214
+ 4gc1A 275
215
+ 1b2pA 119
216
+ 4le7A 254
217
+ 4oitA 106
218
+ 6b0gE 154
219
+ 1z1yB 175
220
+ 1vmoA 163
221
+ 2gudA 121
222
+ 4r6rE 133
223
+ 5krpC 150
224
+ 5v6fA 137
225
+ 4pitA 140
226
+ 6flwA 144
227
+ 1ouwA 149
228
+ 4ddnD 154
229
+ 3apaA 138
230
+ 5gvyA 145
231
+ 1c3mA 145
232
+ 4mq0A 438
233
+ 3wocA 138
234
+ 3aqgA 133
235
+ 3towA 152
236
+ 2qp2A 498
237
+ 1nykA 156
238
+ 2bmoA 437
239
+ 2gbwA 449
240
+ 1rfsA 127
241
+ 4aivA 113
242
+ 3gkeA 340
243
+ 2nwfA 141
244
+ 1jm1A 202
245
+ 2qpzA 103
246
+ 5cxmB 99
247
+ 3gzxA 440
248
+ 3dqyA 106
249
+ 3d89A 136
250
+ 2b1xA 441
251
+ 4qdcA 369
252
+ 2q3wA 109
253
+ 3c7xA 196
254
+ 1genA 200
255
+ 1itvA 195
256
+ 1pexA 192
257
+ 3s18A 224
258
+ 4rt6B 172
259
+ 3cu9A 314
260
+ 3wasA 389
261
+ 6ms3B 511
262
+ 6frwA 411
263
+ 3k1uA 314
264
+ 5aycA 386
265
+ 5c0pA 284
266
+ 4n1iA 312
267
+ 3r4zA 358
268
+ 1tl2A 235
269
+ 4u6dA 382
270
+ 1oygA 440
271
+ 4qqsA 312
272
+ 3qz4A 306
273
+ 5a8cA 299
274
+ 4pvaA 328
275
+ 3kstA 291
276
+ 5flwA 302
277
+ 6gy5A 285
278
+ 1cruA 448
279
+ 1suuA 293
280
+ 3o4pA 314
281
+ 2p4oA 302
282
+ 4mzaA 432
283
+ 5gtqA 307
284
+ 3dr2A 299
285
+ 3dasA 334
286
+ 3g4eA 297
287
+ 2fp8A 302
288
+ 5hx0B 364
289
+ 1npeA 263
290
+ 1s1dA 317
291
+ 2zwaA 673
292
+ 3a72A 353
293
+ 2zb6A 427
294
+ 3scyA 356
295
+ 3b7fA 368
296
+ 3al9A 516
297
+ 3o4hA 576
298
+ 4pxwA 292
299
+ 4wk0A 449
300
+ 2w18A 306
301
+ 5em2A 357
302
+ 1sq9A 378
303
+ 1xipA 367
304
+ 4h5iA 344
305
+ 1jofA 365
306
+ 1xksA 374
307
+ 5ic7A 340
308
+ 5k19A 376
309
+ 6e1zA 307
310
+ 2z2nA 293
311
+ 6e4lA 358
312
+ 6fkwA 576
313
+ 6damA 563
314
+ 1flgA 582
315
+ 4cvbA 562
316
+ 4mh1A 509
317
+ 1z68A 719
318
+ 2z3zA 651
319
+ 4q1vA 707
320
+ 1xfdA 723
321
+ 5d7wA 469
322
+ 1kapP 470
323
+ 3laaA 169
324
+ 1p9hA 179
325
+ 3ultA 114
326
+ 3s6lA 155
327
+ 2xqhA 258
328
+ 4dt5A 143
329
+ 5m5zA 755
330
+ 5lw3A 381
331
+ 1k5cA 333
332
+ 1k4zA 157
333
+ 2ntpA 342
334
+ 3bh7B 314
335
+ 2j8kA 181
336
+ 2vfoA 555
337
+ 3n6zA 339
338
+ 1hf2A 196
339
+ 2x3hB 498
340
+ 1rmgA 422
341
+ 6mfkA 210
342
+ 1l0sA 88
343
+ 2xt2A 197
344
+ 5nzgA 482
345
+ 3kweA 166
346
+ 2w7zA 207
347
+ 3ng9A 520
348
+ 1lktA 104
349
+ 3facA 109
350
+ 3pyiB 143
351
+ 2casA 548
352
+ 1gppA 217
353
+ 3maoA 105
354
+ 1ut7A 147
355
+ 4jzzA 336
356
+ 1hxrA 107
357
+ 1t61A 223
358
+ 4qjvA 259
359
+ 3lywA 86
360
+ 3dalA 179
361
+ 5hqhA 96
362
+ 3u7zA 97
363
+ 3r90A 185
364
+ 1tp6A 126
365
+ 3s9xA 159
366
+ 2ex5A 207
367
+ 3gbyA 127
368
+ 5kvbA 146
369
+ 2cu3A 63
370
+ 1c1yB 77
371
+ 5f6rA 173
372
+ 4a6qA 143
373
+ 2w56A 143
374
+ 4lqbA 130
375
+ 4oobA 245
376
+ 3oajA 310
377
+ 3n8bA 75
378
+ 3jumA 157
379
+ 2prxA 114
380
+ 5b1rA 116
381
+ 1ewfA 456
382
+ 4m4dA 448
383
+ 2obdA 472
384
+ 6baqA 196
385
+ 1usuB 132
386
+ 3e8tA 216
387
+ 3aotA 203
388
+ 2rckA 221
389
+ 3l6iA 171
390
+ 3uv1A 190
391
+ 3bqwA 347
392
+ 5mprA 364
393
+ 1kkoA 411
394
+ 4cd8A 313
395
+ 1vd6A 218
396
+ 2g0wA 275
397
+ 4lanA 370
398
+ 3s83A 256
399
+ 2v3gA 273
400
+ 3fkrA 304
401
+ 4z0gA 384
402
+ 3sggA 512
403
+ 5zjbA 232
404
+ 2xfrA 487
405
+ 4g8tA 441
406
+ 5n6fA 365
407
+ 1muwA 386
408
+ 2qhqA 120
409
+ 3eunA 81
410
+ 3h35A 144
411
+ 3kluA 119
412
+ 3fn2A 97
413
+ 2od6A 110
414
+ 1kcfA 240
415
+ 3nlcA 534
416
+ 2zw2A 85
417
+ 4ftxA 158
418
+ 3u2aA 112
419
+ 2hiqA 96
420
+ 1xkpC 126
421
+ 6ih0A 267
422
+ 5c12A 230
423
+ 1w4rA 174
424
+ 3c0fB 85
425
+ 3nbmA 104
426
+ 2r6zA 225
427
+ 5hxdA 237
428
+ 1chdA 198
429
+ 3do8A 135
430
+ 3gohA 297
431
+ 1n0eA 141
432
+ 2q82A 114
433
+ 5kxhA 350
434
+ 3oqiA 222
435
+ 2x4lA 298
436
+ 3d3kA 233
437
+ 3l46A 90
438
+ 2fkcA 247
439
+ 5jphA 142
440
+ 3nytA 359
441
+ 3rhtA 252
442
+ 3dkrA 241
443
+ 2psbA 290
444
+ 1tc5A 187
445
+ 3vrdB 400
446
+ 2je3A 157
447
+ 3g5sA 424
448
+ 1jkeA 145
449
+ 4at0A 483
450
+ 1vi4A 162
451
+ 4u8pC 505
452
+ 4ntcA 325
453
+ 5ipyA 445
454
+ 5nakA 452
455
+ 4z24B 649
456
+ 4opcA 452
457
+ 5cdkA 181
458
+ 2b0aA 186
459
+ 4n2pA 143
460
+ 1j5uA 127
461
+ 1vzyB 286
462
+ 1vq0A 290
463
+ 4ipuA 137
464
+ 4dq9A 149
465
+ 4jtmA 81
466
+ 3gs9A 326
467
+ 3adyA 102
468
+ 3mi0A 215
469
+ 3ib7A 295
470
+ 3g91A 260
471
+ 1vr7A 120
472
+ 4zx2A 325
473
+ 1ds1A 323
474
+ 3zwfA 259
475
+ 1hq0A 295
476
+ 3hbcA 309
477
+ 3p8kA 268
478
+ 4ya2H 222
479
+ 1wraA 305
480
+ 3t91A 210
481
+ 3c9fA 531
482
+ 2imhA 226
483
+ 1um0A 365
484
+ 5y0mA 329
485
+ 5u4hA 420
486
+ 1ejdA 419
487
+ 3zh4A 411
488
+ 3swgA 417
489
+ 5ujsA 417
490
+ 3nvsA 426
491
+ 2o0bA 424
492
+ 2pqcA 445
493
+ 3slhA 436
494
+ 1rf6A 427
495
+ 4n3pA 424
496
+ 5bufA 445
497
+ 3rmtA 432
498
+ 4fqdA 436
499
+ 1ud9A 242
500
+ 1t6lA 249
501
+ 1rwzA 244
502
+ 3ifvA 216
503
+ 1iz5A 240
504
+ 3lx2A 247
505
+ 1u7bA 251
506
+ 5tupA 254
507
+ 5h0tA 248
508
+ 5v7mA 255
509
+ 3fdsC 249
510
+ 3aizA 248
511
+ 1b77A 228
512
+ 3p91A 245
513
+ 1dmlA 267
514
+ 3hslX 287
515
+ 2z0lA 299
516
+ 6nibA 345
517
+ 2jerA 366
518
+ 1xknA 353
519
+ 1zbrA 339
520
+ 3hvmA 330
521
+ 1jdwA 360
522
+ 5wpiA 364
523
+ 1g61A 225
524
+ 1h70A 255
525
+ 5m3qA 224
526
+ 1ynfA 429
527
+ 3wn4A 747
528
+ 1io0A 166
529
+ 4rcaB 241
530
+ 4fcgA 296
531
+ 4ecoA 620
532
+ 3wpcA 747
533
+ 4im6A 198
534
+ 4cnmA 283
535
+ 5hzlB 280
536
+ 4fs7A 383
537
+ 2xwtC 234
538
+ 3e4gA 176
539
+ 4wp6A 151
540
+ 5il7A 440
541
+ 1z7xW 460
542
+ 4u7lA 455
543
+ 6fg8A 188
544
+ 2wfhA 181
545
+ 2fy7A 268
546
+ 5wwdA 139
547
+ 1j3aA 129
548
+ 1omzA 253
549
+ 3emfA 113
550
+ 1xw3A 110
551
+ 3h4rA 219
552
+ 3essA 199
553
+ 1o22A 149
554
+ 4ktbA 160
555
+ 1jh6A 181
556
+ 3n08A 151
557
+ 5tsqA 312
558
+ 3e9vA 120
559
+ 4j7hA 446
560
+ 1i4jA 110
561
+ 2wnfA 272
562
+ 3v1aA 48
563
+ 3coqA 89
564
+ 2f60K 60
565
+ 4zgmA 100
566
+ 1i7wB 51
567
+ 6g6kA 89
568
+ 1pbyC 79
569
+ 1a92A 50
570
+ 3alrA 63
571
+ 2wjvD 54
572
+ 2a26A 48
573
+ 1devB 41
574
+ 4l0nA 51
575
+ 4ayaA 59
576
+ 3zxcA 71
577
+ 4pkfB 69
578
+ 2b1yA 101
579
+ 5y5sQ 491
580
+ 4dncD 42
581
+ 4jpnA 75
582
+ 4e18B 46
583
+ 3vepX 46
584
+ 3v4yB 41
585
+ 1xawA 107
586
+ 1ykhA 95
587
+ 2p64A 51
588
+ 6bscB 48
589
+ 2z3xA 56
590
+ 4uzzB 65
591
+ 3thfA 175
592
+ 1wq6A 59
593
+ 4ke2A 196
594
+ 4lhfA 79
595
+ 2v66B 111
596
+ 3lczA 53
597
+ 2h4oA 62
598
+ 4wjwA 68
599
+ 3kvpA 43
600
+ 3e56A 75
601
+ 3bk3C 67
602
+ 2ds5A 43
603
+ 3zoqB 48
604
+ 3nfgB 120
605
+ 4ksnA 65
606
+ 3ua0A 79
607
+ 3nrtA 93
608
+ 4a9aC 106
609
+ 6hikL 40
data/requirements.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ wget
2
+ Cython
3
+ numpy==1.19.5
4
+ pandas==1.2.0
5
+ AMPAL==1.4.0
6
+ scikit-learn==0.24.1
7
+ pathlib==1.0.1
8
+ matplotlib==3.3.3
9
+ click==7.1.2
10
+ scipy==1.6.0
data/run_benchmark.py ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Runs model comparison"
2
+
3
+ from benchmark import visualization
4
+ from benchmark import get_cath
5
+ from pathlib import Path
6
+ import click
7
+ import os
8
+ import sys
9
+
10
+
11
+ def check_sets(dataset: Path, training_set: Path):
12
+ """Compares training and testing sets, warns if they overlap.
13
+ Parameters
14
+ ----------
15
+ dataset:Path
16
+ Path to .txt file with the dataset.
17
+ training_set:Path
18
+ Path to a file with the training set, can be PISCES, pdb code or pdb+chain.
19
+ """
20
+
21
+ with open(training_set) as file:
22
+ training_chains = [x.split()[0][:4].upper() for x in file.readlines()]
23
+ # check for pisces
24
+ if len(training_chains[0]) != 5:
25
+ training_chains = training_chains[1:]
26
+ # check only pdb codes, not chains
27
+ with open(dataset) as file:
28
+ testing_chains = [x.split()[0][:4].upper() for x in file.readlines()]
29
+
30
+ repeated_chains = set(testing_chains).intersection(set(training_chains))
31
+
32
+ if len(repeated_chains) > 0:
33
+ print(f"{len(repeated_chains)} chains are in both sets:")
34
+ for chain in repeated_chains:
35
+ print(chain)
36
+
37
+ print("\n")
38
+ print("Suggested benchmarking set:")
39
+ for chain in testing_chains:
40
+ if chain not in repeated_chains:
41
+ print(chain)
42
+ if click.confirm(
43
+ "Model evaluation might not be valid. Do you want to continue?"
44
+ ):
45
+ click.echo("Continuing!")
46
+ else:
47
+ exit()
48
+ else:
49
+ print("There is no overlap between sets.")
50
+
51
+
52
+ @click.command("compare")
53
+ @click.option(
54
+ "--dataset",
55
+ help="Path to .txt file with dataset list (PDB+chain, e.g., 1a2bA).",
56
+ type=click.Path(exists=True),
57
+ required=True,
58
+ )
59
+ @click.option(
60
+ "--training_set",
61
+ default=False,
62
+ help="Path to .txt file with the training set.",
63
+ )
64
+ @click.option(
65
+ "--path_to_pdb",
66
+ help="Path to the directory with PDB files.",
67
+ type=click.Path(exists=True),
68
+ required=True,
69
+ )
70
+ @click.option(
71
+ "--path_to_models",
72
+ help="Path to the directory with .csv prediction files.",
73
+ type=click.Path(exists=True),
74
+ required=True,
75
+ )
76
+ @click.option(
77
+ "--include",
78
+ help="Path to .txt file with a list of models to be included in comparison. If not provided, 8 models with the best accuracy are compared.",
79
+ type=click.Path(exists=True),
80
+ )
81
+ @click.option(
82
+ "--torsions",
83
+ is_flag=True,
84
+ help="Produces predicted and true Ramachandran plots for each model.",
85
+ )
86
+ def compare_models(
87
+ dataset: str,
88
+ path_to_pdb: str,
89
+ path_to_models: str,
90
+ training_set: str,
91
+ include: str = False,
92
+ torsions: bool = False,
93
+ ) -> None:
94
+ """Generates model summary and comparison plots.
95
+ \f
96
+ Parameters
97
+ ---------
98
+ dataset: str
99
+ Path to .txt file with dataset list (PDB+chain, e.g., 1a2bA).
100
+ path_to_pdb: str
101
+ Path to the directory with PDB files.
102
+ path_to_models: str.
103
+ Path to the directory with .csv prediction files.
104
+ include: str = False
105
+ Path to .txt file with a list of models to be included in comparison. If not provided, 8 models with the best accuracy are compared.
106
+ torsions: bool = False
107
+ Produces predicted and true Ramachandran plots for each model.
108
+ training_set:Path
109
+ Path to a file with the training set, can be PISCES, pdb code or pdb+chain.
110
+ """
111
+
112
+ # check training and testing sets
113
+ if training_set:
114
+ check_sets(Path(dataset), Path(training_set))
115
+ else:
116
+ # Warn and ask for confirmation to continue.
117
+ if click.confirm(
118
+ "Cannot compare training and testing sets. YOUR COMPARISON MIGHT NOT BE STATISTICALLY MEANINGFUL. Do you want to continue?"
119
+ ):
120
+ click.echo("Continuing!")
121
+ else:
122
+ exit
123
+
124
+ # get model labels to include in comparison
125
+ if include:
126
+ with open(include) as file:
127
+ models_to_include = [x.strip("\n") for x in file.readlines()]
128
+ df = get_cath.read_data(f"{Path(os.path.dirname(sys.argv[0]))/'cath-domain-description-file.txt'}")
129
+ filtered_df = get_cath.filter_with_user_list(df, dataset)
130
+ df_with_sequence = get_cath.append_sequence(
131
+ filtered_df, Path(path_to_pdb)
132
+ )
133
+
134
+ accuracy = []
135
+ # load predictions
136
+ list_of_models = {}
137
+ for name in os.listdir(path_to_models):
138
+ if name.split(".")[-1] == "csv":
139
+ path_to_file=Path(path_to_models)/name
140
+ with open(path_to_file.with_suffix('.txt')) as datasetmap:
141
+ model= get_cath.load_prediction_matrix(df_with_sequence, path_to_file.with_suffix('.txt'), path_to_file)
142
+ ignore_uncommon=eval(datasetmap.readline().split()[1])
143
+ pdbs=datasetmap.readline().split()
144
+ if len(pdbs)>1:
145
+ #visualize accuracy and entropy on pdb files
146
+ for protein in pdbs[1:]:
147
+ visualization.show_accuracy(
148
+ df_with_sequence,
149
+ protein[:4],
150
+ model,
151
+ Path(path_to_models) / f"{name.strip('.csv')}_{protein}.pdb",
152
+ Path(path_to_pdb),
153
+ ignore_uncommon,
154
+ )
155
+ list_of_models[name]=(model,ignore_uncommon)
156
+
157
+ for model in list_of_models:
158
+ # make model summary
159
+ visualization.make_model_summary(
160
+ df_with_sequence,
161
+ list_of_models[model][0],
162
+ str(Path(path_to_models) / model),
163
+ Path(path_to_pdb),
164
+ list_of_models[model][1],
165
+ )
166
+ # get overall accuracy
167
+ accuracy.append(
168
+ [
169
+ get_cath.score(
170
+ df_with_sequence,
171
+ list_of_models[model][0],
172
+ ignore_uncommon=list_of_models[model][1],
173
+ )[0][0],
174
+ model,
175
+ ]
176
+ )
177
+ # make Ramachandran plots
178
+ if torsions:
179
+ sequence, prediction, _, angle = get_cath.format_angle_sequence(
180
+ df_with_sequence,
181
+ list_of_models[model][0],
182
+ Path(path_to_pdb),
183
+ ignore_uncommon=list_of_models[model][1],
184
+ )
185
+ visualization.ramachandran_plot(
186
+ sequence,
187
+ list(get_cath.most_likely_sequence(prediction)),
188
+ angle,
189
+ str(Path(path_to_models) / model),
190
+ )
191
+ accuracy = sorted(accuracy)
192
+ # pick 8 best models
193
+ filtered_models = [list_of_models[model[1]][0] for model in accuracy[-8:]]
194
+ ignore_list= [list_of_models[model[1]][1] for model in accuracy[-8:]]
195
+ filtered_labels = [model[1] for model in accuracy[-8:]]
196
+ # include specified models
197
+ if include:
198
+ if len(models_to_include) <= 8:
199
+ for index, model_name in enumerate(models_to_include):
200
+ if model_name not in filtered_labels:
201
+ filtered_models[index] = list_of_models[model_name][0]
202
+ ignore_list[index]=list_of_models[model_name][1]
203
+ filtered_labels[index] = model_name
204
+ else:
205
+ raise ValueError(
206
+ "Too many models are give to plot, select no more than 8 models."
207
+ )
208
+
209
+ visualization.compare_model_accuracy(
210
+ df_with_sequence,
211
+ filtered_models,
212
+ filtered_labels,
213
+ Path(path_to_models),
214
+ ignore_list,
215
+ )
216
+
217
+ if __name__=="__main__":
218
+ compare_models()
data/run_predictions/make_empty_backbone_set.py ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ampal
2
+ import gzip
3
+ from pathlib import Path
4
+ import string
5
+ import urllib
6
+
7
+ def gly_resid(pdb: Path, chain:chr):
8
+ """Rewrite PDB,change all amino acids to Glycine.
9
+ Parameters
10
+ ----------
11
+ pdb: Path
12
+ Location of pdb file
13
+ chain: chr
14
+ Chain identifier, only this chain will be changed to polyG."""
15
+
16
+ with open(pdb,'r') as file:
17
+ text=file.readlines()
18
+ for i,line in enumerate(text):
19
+ if line[21]==chain:
20
+ text[i]='ATOM '+text[i][6:17]+'GLY'+text[i][20:]
21
+ with open(pdb,'w') as file:
22
+ file.writelines(text)
23
+
24
+ def fetch_pdb(
25
+ pdb_code: str,
26
+ output_folder:Path,
27
+ pdb_request_url: str = "https://files.rcsb.org/download/" ,
28
+ is_pdb:bool=False,
29
+ ) -> None:
30
+ """
31
+ Downloads a specific pdb file into a specific folder.
32
+ Parameters
33
+ ----------
34
+ pdb_code : str
35
+ Code of the PDB file to be downloaded.
36
+ output_folder : Path
37
+ Output path to save the PDB file.
38
+ pdb_request_url : str
39
+ Base URL to download the PDB files.
40
+ is_pdb:bool=False
41
+ If True, get .pdb, else get biological assembly.
42
+ """
43
+ if is_pdb:
44
+ pdb_code_with_extension = f"{pdb_code[:4]}.pdb.gz"
45
+ else:
46
+ pdb_code_with_extension = f"{pdb_code[:4]}.pdb1.gz"
47
+ print(f'{pdb_code_with_extension} is missing and will be downloaded!')
48
+ urllib.request.urlretrieve(pdb_request_url + pdb_code_with_extension,filename=output_folder / pdb_code_with_extension)
49
+
50
+ def polyglycine(dataset:Path,path_to_assemblies:Path,working_dir:Path,is_pdb:bool=False):
51
+ """Converts protein chains into polyglycine chains.
52
+ Parameters
53
+ -----------
54
+ dataset:Path
55
+ Path to the dataset list containing PDB+chain info (e.g. 1a2bA)
56
+ path_to_assemblies:Path
57
+ Path to the directory with protein structure files; missing files will be downloaded automatically.
58
+ working_dir:Path
59
+ Path to the directory where polyglycine structures will be saved.
60
+ is_pdb:bool
61
+ If True, expects and downloads PDBs. If False, expects/downloads biological assembly."""
62
+
63
+ with open(dataset,'r') as file:
64
+ structures = [x.strip("\n") for x in file.readlines()]
65
+ if is_pdb:
66
+ suffix='.pdb.gz'
67
+ else:
68
+ suffix='.pdb1.gz'
69
+ for protein in structures:
70
+ if not Path(path_to_assemblies / (protein[:4]+suffix)).exists():
71
+ fetch_pdb(protein,path_to_assemblies,is_pdb=is_pdb)
72
+
73
+ with gzip.open(path_to_assemblies / (protein[:4]+suffix)) as file:
74
+ assembly = ampal.load_pdb(file.read().decode(), path=False)
75
+ protein_chain=protein[-1]
76
+ if not is_pdb:
77
+ flag=0
78
+ # fuse all states of the assembly into one state.
79
+ empty_polymer = ampal.Assembly()
80
+ chain_id = []
81
+ for polymer in assembly:
82
+ for chain in polymer:
83
+ #remove side chains from the chain of interest
84
+ #some assemblies have multiple chains with the same id, use flag to remove side chains only from the first one.
85
+ if chain.id==protein_chain and flag==0:
86
+ empty_polymer.append(chain.backbone)
87
+ flag=1
88
+ else:
89
+ empty_polymer.append(chain)
90
+ chain_id.append(chain.id)
91
+ # relabel chains to avoid repetition, remove ligands.
92
+
93
+ str_list = string.ascii_uppercase.replace(protein_chain, "")
94
+ #assemblies such as viral capsids are longer than the alphabet
95
+ if len(empty_polymer)>=len(str_list):
96
+ str_list=str_list*10
97
+ index = chain_id.index(protein_chain)
98
+ chain_id = list(str_list[: len(chain_id)])
99
+ chain_id[index] = protein_chain
100
+ empty_polymer.relabel_polymers(chain_id)
101
+
102
+ else:
103
+ empty_polymer = ampal.Assembly()
104
+ #pick first state of NMR
105
+ if isinstance(assembly, ampal.assembly.AmpalContainer):
106
+ assembly=assembly[0]
107
+ for chain in assembly:
108
+ if chain.id==protein_chain:
109
+ empty_polymer.append(chain.backbone)
110
+ else:
111
+ empty_polymer.append(chain)
112
+ # writing new pdb with AMPAL fixes most of the errors with EvoEF2 and Rosetta.
113
+ pdb_text = empty_polymer.make_pdb(alt_states=False, ligands=False)
114
+ with open((working_dir / protein[:4]).with_suffix(".pdb"), "w") as pdb_file:
115
+ pdb_file.write(pdb_text)
116
+ #change res ids to GLY for the backbone-only chain
117
+ gly_resid((working_dir / protein[:4]).with_suffix(".pdb"),protein_chain)
118
+
119
+
120
+ if __name__=='__main__':
121
+ #biological assemblies of crystal structures
122
+ polyglycine(Path("/home/s1706179/Rosetta/data/set.txt"), Path("/home/s1706179/Rosetta/assemblies/"),Path("/home/s1706179/Rosetta/empty_backbones/"),False)
123
+ #first state of NMR structures
124
+ #polyglycine(Path("/home/s1706179/Rosetta/data/nmr_set.txt"), Path("/home/s1706179/Rosetta/nmr_structures/"),Path("/home/s1706179/Rosetta/empty_nmr_backbones/"),True)
data/run_predictions/run_EvoEF2/evo.sh ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #! /bin/sh
2
+ #inputs:
3
+ #$1 pdb name
4
+ #$2 chain
5
+ #$3 number of sequences to predict
6
+ #$4 path to working dir
7
+ #$5 Path to EvoEF2
8
+
9
+ cd $4
10
+ #get a specified number of sequences and print results to a .txt file
11
+ for i in $(seq $3); do
12
+ $5 --command=ProteinDesign --ppint --design_chains=$2 --pdb=$1.pdb1 > /dev/null
13
+ cat $4/$1_bestseq.txt > $4/results/$1$2.txt
14
+ #remove working files to save space
15
+ rm $1*
16
+ done
data/run_predictions/run_EvoEF2/evoef2_dataset.py ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Functions for making EvoEF2 predictions."""
2
+
3
+ import ampal
4
+ import gzip
5
+ import glob
6
+ import subprocess
7
+ import multiprocessing
8
+ import os
9
+ from pathlib import Path
10
+ from benchmark import config
11
+ from sklearn.preprocessing import OneHotEncoder
12
+ import warnings
13
+ import numpy as np
14
+ import pandas as pd
15
+
16
+ def run_Evo2EF(
17
+ pdb: str, chain: str, number_of_runs: str, working_dir: Path, path_to_evoef2: Path
18
+ ) -> None:
19
+ """Runs a shell script to predict sequence with EvoEF2
20
+
21
+ Patameters
22
+ ----------
23
+ path: str
24
+ Path to PDB biological unit.
25
+ pdb: str
26
+ PDB code.
27
+ chain: str
28
+ Chain code.
29
+ number_of_runs: str
30
+ Number of sequences to be generated.
31
+ working_dir: str
32
+ Dir where to store temporary files and results.
33
+ path_to_EvoEF2: Path
34
+ Location of EvoEF2 executable.
35
+ """
36
+
37
+ print(f"Starting {pdb}{chain}.")
38
+
39
+ # evo.sh must be in the same directory as this file.
40
+ p = subprocess.Popen(
41
+ [
42
+ os.path.dirname(os.path.realpath(__file__)) + "/evo.sh",
43
+ pdb,
44
+ chain,
45
+ number_of_runs,
46
+ working_dir,
47
+ path_to_evoef2,
48
+ ]
49
+ )
50
+ p.wait()
51
+ print(f"{pdb}{chain} done.")
52
+
53
+
54
+ def multi_Evo2EF(
55
+ df: pd.DataFrame,
56
+ number_of_runs: int,
57
+ working_dir: Path,
58
+ path_to_assemblies: Path,
59
+ path_to_evoef2: Path,
60
+ max_processes: int = 8,
61
+ nmr:bool = False,
62
+ ) -> None:
63
+ """Runs Evo2EF on all PDB chains in the DataFrame.
64
+
65
+ Parameters
66
+ ----------
67
+ df: pd.DataFrame
68
+ DataFrame with PDB and chain codes.
69
+ number_of_runs: int
70
+ Number of sequences to be generated for each PDB file.
71
+ max_processes: int = 8
72
+ Number of cores to use, default is 8.
73
+ working_dir: Path
74
+ Dir where to store temporary files and results.
75
+ path_to_assemblies: Path
76
+ Dir with biological assemblies.
77
+ path_to_EvoEF2: Path
78
+ Location of EvoEF2 executable.
79
+ nmr:bool=True
80
+
81
+ """
82
+
83
+ inputs = []
84
+ # remove duplicated chains
85
+ df = df.drop_duplicates(subset=["PDB", "chain"])
86
+
87
+ # check if working directory exists. Make one if doesn't exist.
88
+ if not working_dir.exists():
89
+ os.makedirs(working_dir)
90
+ if not (working_dir / "results/").exists():
91
+ os.makedirs(working_dir / "results/")
92
+
93
+ print(f"{df.shape[0]} structures will be predicted.")
94
+
95
+ for i, protein in df.iterrows():
96
+ if not nmr:
97
+ with gzip.open(
98
+ path_to_assemblies / protein.PDB[1:3] / f"{protein.PDB}.pdb1.gz"
99
+ ) as file:
100
+ assembly = ampal.load_pdb(file.read().decode(), path=False)
101
+ # fuse all states of the assembly into one state to avoid EvoEF2 errors.
102
+ empty_polymer = ampal.Assembly()
103
+ chain_id = []
104
+ for polymer in assembly:
105
+ for chain in polymer:
106
+ empty_polymer.append(chain)
107
+ chain_id.append(chain.id)
108
+ # relabel chains to avoid repetition, remove ligands.
109
+ str_list = string.ascii_uppercase.replace(protein.chain, "")
110
+ index = chain_id.index(protein.chain)
111
+ chain_id = list(str_list[: len(chain_id)])
112
+ chain_id[index] = protein.chain
113
+ empty_polymer.relabel_polymers(chain_id)
114
+ pdb_text = empty_polymer.make_pdb(alt_states=False, ligands=False)
115
+ # writing new pdb with AMPAL fixes most of the errors with EvoEF2.
116
+ with open((working_dir / protein.PDB).with_suffix(".pdb1"), "w") as pdb_file:
117
+ pdb_file.write(pdb_text)
118
+
119
+ #pick first nmr structure
120
+ else:
121
+ with gzip.open(
122
+ path_to_assemblies / protein.PDB[1:3] / f"pdb{protein.PDB}.ent.gz"
123
+ ) as file:
124
+ assembly = ampal.load_pdb(file.read().decode(), path=False)
125
+ pdb_text = assembly[0].make_pdb(alt_states=False)
126
+ # writing new pdb with AMPAL fixes most of the errors with EvoEF2.
127
+ with open((working_dir / protein.PDB).with_suffix(".pdb1"), "w") as pdb_file:
128
+ pdb_file.write(pdb_text)
129
+
130
+ inputs.append(
131
+ (
132
+ protein.PDB,
133
+ protein.chain,
134
+ str(number_of_runs),
135
+ working_dir,
136
+ path_to_evoef2,
137
+ )
138
+ )
139
+
140
+ with multiprocessing.Pool(max_processes) as P:
141
+ P.starmap(run_Evo2EF, inputs)
142
+
143
+ def seq_to_arr(working_dir: Path, user_list: Path, ignore_uncommon:bool=True):
144
+ """Produces prediction format compatible with the benchmarking tool.
145
+ working_dir: Path
146
+ Dir where EvoEF2 results are stored.
147
+ user_list: Path
148
+ Path to .txt file with protein chains to include in the benchmark"""
149
+
150
+ with open(Path(user_list)) as file:
151
+ chains=[x.strip('\n') for x in file.readlines()]
152
+ predicted_sequences = []
153
+ path = Path(working_dir)
154
+ enc=OneHotEncoder(categories=[config.acids],sparse=False)
155
+ with open(path/'datasetmap.txt','w') as file:
156
+ file.write(f"ignore_uncommon {ignore_uncommon}\ninclude_pdbs\n##########\n")
157
+ for protein in chains:
158
+ prediction_path = path / "results"/f"{protein}.txt"
159
+ # check for empty and missing files
160
+ if prediction_path.exists() and os.path.getsize(prediction_path) > 0:
161
+ with open(prediction_path) as prediction:
162
+ seq = prediction.readline().split()[0]
163
+ if seq != "0":
164
+ predicted_sequences+=list(seq)
165
+
166
+ file.write(f"{protein} {len(seq)}\n")
167
+ else:
168
+ warnings.warn(
169
+ f"EvoEF2: {protein} prediction does not exits, EvoEF2 returned 0."
170
+ )
171
+ else:
172
+ warnings.warn(
173
+ f"EvoEF2: {protein} prediction does not exits."
174
+ )
175
+ arr=enc.fit_transform(np.array(predicted_sequences).reshape(-1, 1))
176
+ pd.DataFrame(arr).to_csv(path/"evoEF2.csv", header=None, index=None)
177
+
data/run_predictions/run_EvoEF2/run_evoef2.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Runs EvoEF2 predictions"
2
+
3
+ import evoef2_dataset
4
+ from benchmark import get_cath
5
+ from pathlib import Path
6
+ import click
7
+ import os
8
+
9
+
10
+ @click.command()
11
+ @click.option(
12
+ "--dataset",
13
+ help="Path to .txt file with dataset list (PDB+chain, e.g., 1a2bA).",
14
+ type=click.Path(exists=True),
15
+ required=True,
16
+ )
17
+ @click.option(
18
+ "--path_to_assemblies",
19
+ help="Path to the directory with biological assemblies.",
20
+ type=click.Path(exists=True),
21
+ required=True,
22
+ )
23
+ @click.option(
24
+ "--working_dir",
25
+ help="Directory where to store results.",
26
+ type=click.Path(),
27
+ required=True,
28
+ )
29
+ @click.option(
30
+ "--path_to_evoef2",
31
+ help="Path to EvoEF2 executable.",
32
+ type=click.Path(exists=True),
33
+ required=True,
34
+ )
35
+ @click.option(
36
+ "--max_processes", help="Maximum number of cores to use", type=int, default=8
37
+ )
38
+ @click.option(
39
+ "--nmr", help="If true, also set path_to_assemblies to the directory with PDB files instead of biological assemblies.", type=bool, default=False
40
+ )
41
+ def run_evoEF2(
42
+ dataset: str,
43
+ working_dir: str,
44
+ path_to_evoef2: str,
45
+ max_processes: int,
46
+ path_to_assemblies: str,
47
+ nmr: bool=False,
48
+ ) -> None:
49
+ """Runs EvoEF2 sequence predictions on a specified set.
50
+ \f
51
+ Parameters
52
+ ---------
53
+ dataset: str
54
+ Path to .txt file with dataset list (PDB+chain, e.g., 1a2bA).
55
+ working_dir: str
56
+ Path to dir where to save temp files and results.
57
+ path_to_evoef2: str
58
+ Path to EvoEF2 executable.
59
+ max_processes: int
60
+ Maximum number of cores to use.
61
+ path_to_assemblies: str
62
+ Path to the directory with biological assemblies.
63
+ nmr: bool
64
+ If true, the code expects a PDB file with NMR states insted of biological assemblies.
65
+ """
66
+
67
+ df = get_cath.read_data("../cath-domain-description-file.txt")
68
+ filtered_df = get_cath.filter_with_user_list(df, dataset)
69
+
70
+ evoef2_dataset.multi_Evo2EF(
71
+ filtered_df,
72
+ 1,
73
+ max_processes=max_processes,
74
+ working_dir=Path(working_dir),
75
+ path_to_evoef2=Path(path_to_evoef2),
76
+ path_to_assemblies=Path(path_to_assemblies),
77
+ nmr,
78
+ )
79
+
80
+ if __name__=="__main__":
81
+ run_evoEF2()
data/run_predictions/run_Rosetta/fixbb.py ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ampal
2
+ import gzip
3
+ import glob
4
+ import subprocess
5
+ import multiprocessing
6
+ import os
7
+ from pathlib import Path
8
+ from sklearn.preprocessing import OneHotEncoder
9
+ import warnings
10
+ import numpy as np
11
+ import pandas as pd
12
+ import string
13
+ import urllib
14
+ from sklearn import metrics
15
+ import numpy as np
16
+
17
+ acids = [
18
+ "A",
19
+ "C",
20
+ "D",
21
+ "E",
22
+ "F",
23
+ "G",
24
+ "H",
25
+ "I",
26
+ "K",
27
+ "L",
28
+ "M",
29
+ "N",
30
+ "P",
31
+ "Q",
32
+ "R",
33
+ "S",
34
+ "T",
35
+ "V",
36
+ "W",
37
+ "Y",
38
+ ]
39
+
40
+ standard_residues = [
41
+ "ALA",
42
+ "ARG",
43
+ "ASN",
44
+ "ASP",
45
+ "CYS",
46
+ "GLU",
47
+ "GLN",
48
+ "GLY",
49
+ "HIS",
50
+ "ILE",
51
+ "LEU",
52
+ "LYS",
53
+ "MET",
54
+ "PHE",
55
+ "PRO",
56
+ "SER",
57
+ "THR",
58
+ "TRP",
59
+ "TYR",
60
+ "VAL",
61
+ ]
62
+
63
+
64
+ def atom_to_hetatm(pdb: Path):
65
+ """Rosetta labels non-standard acids as ATOM instead of HETATM. This crashes AMPAL."""
66
+ with open(pdb, "r") as file:
67
+ text = file.readlines()
68
+ for i, line in enumerate(text):
69
+ if line[0:6].strip() == "ATOM" and line[17:20].strip() not in standard_residues:
70
+ text[i] = "HETATM" + text[i][6:]
71
+ with open(pdb, "w") as file:
72
+ file.writelines(text)
73
+
74
+
75
+ def run_Rosetta(
76
+ pdb: str,
77
+ chain: str,
78
+ working_dir: Path,
79
+ path_to_Rosetta: Path,
80
+ path_to_assemblies: Path,
81
+ ) -> None:
82
+ """Runs Rosetta design with fixed backbone
83
+ Patameters
84
+ ----------
85
+ pdb: str
86
+ PDB code.
87
+ chain: str
88
+ Chain code.
89
+ working_dir: str
90
+ Dir where to store temporary files and results.
91
+ path_to_Rosetta: Path
92
+ Location of Rosetta executable.
93
+ path_to_assemblies:Path
94
+ Location of input PDB structures.
95
+ """
96
+
97
+ print(f"Starting {pdb}{chain}.")
98
+ # make resfile to predict only the specified chain, skip non-canonical residues
99
+ assembly = ampal.load_pdb(Path(path_to_assemblies / pdb).with_suffix(".pdb"))
100
+ with open(working_dir / ("resfile_" + pdb), "w") as file:
101
+ file.write("NATRO\nstart\n")
102
+ for i, x in enumerate(assembly[chain]):
103
+ file.write(f"{x.id} {chain} ALLAA\n")
104
+ p = subprocess.run(
105
+ f'{path_to_Rosetta} -s {Path(path_to_assemblies/pdb).with_suffix(".pdb")} -linmem_ig 10 -ignore_unrecognized_res -overwrite -resfile {working_dir/("resfile_"+pdb)} -out:path:all {working_dir/"results"}',
106
+ shell=True,
107
+ )
108
+ print(f"{pdb}{chain} done.")
109
+
110
+
111
+ def seq_to_arr(working_dir: Path, user_list: Path, ignore_uncommon: bool = False):
112
+ """Produces prediction format compatible with the benchmarking tool.
113
+ working_dir: Path
114
+ Dir where Rosetta results are stored.
115
+ user_list: Path
116
+ Path to .txt file with protein chains to include in the benchmark"""
117
+
118
+ with open(Path(user_list)) as file:
119
+ chains = [x.strip("\n") for x in file.readlines()]
120
+ predicted_sequences = []
121
+ path = working_dir / "results"
122
+ enc = OneHotEncoder(categories=[acids], sparse=False)
123
+ with open(path / "datasetmap.txt", "w") as file:
124
+ file.write(f"ignore_uncommon {ignore_uncommon}\ninclude_pdbs\n##########\n")
125
+ for protein in chains:
126
+ prediction_path = path / f"{protein[:4]}_0001.pdb"
127
+ # check for empty and missing files
128
+ if prediction_path.exists():
129
+ try:
130
+ assembly = ampal.load_pdb(prediction_path)
131
+ # fix malformed files
132
+ except ValueError:
133
+ atom_to_hetatm(prediction_path)
134
+ assembly = ampal.load_pdb(prediction_path)
135
+ # exclude positions with non-cannonical amino acids
136
+ if ignore_uncommon == True:
137
+ # path to pdb has changed, change it manualy if you decide to use this option.
138
+ temp_assembly = ampal.load_pdb(working_dir / f"{protein[:4]}.pdb")
139
+ true_seq = temp_assembly[protein[-1]].sequence
140
+ print(metrics.accuracy_score(list(seq), list(true_seq)))
141
+ assert len(seq) == len(
142
+ true_seq
143
+ ), f"{protein} sequence lengths don't match"
144
+ seq = "".join(
145
+ [
146
+ pred_ch
147
+ for pred_ch, true_ch in zip(list(seq), list(true_seq))
148
+ if true_ch != "X"
149
+ ]
150
+ )
151
+ if seq.find("X") != -1:
152
+ warnings.warn(
153
+ f"Rosetta: {protein} has remaining non-canonical acids."
154
+ )
155
+ seq = assembly[protein[-1]].sequence
156
+ predicted_sequences += list(seq)
157
+ file.write(f"{protein} {len(seq)}\n")
158
+ else:
159
+ warnings.warn(f"Rosetta: {protein} prediction does not exits.")
160
+ arr = enc.fit_transform(np.array(predicted_sequences).reshape(-1, 1))
161
+ pd.DataFrame(arr).to_csv(path / "rosetta.csv", header=None, index=None)
162
+
163
+
164
+ def multi_Rosetta(
165
+ structures: list,
166
+ working_dir: Path,
167
+ path_to_assemblies: Path,
168
+ path_to_rosetta: Path,
169
+ max_processes: int = 8,
170
+ ) -> None:
171
+ """Runs Rosetta on all PDB chains in the DataFrame.
172
+ Parameters
173
+ ----------
174
+ structures:List
175
+ List with PDB and chain codes.
176
+ number_of_runs: int
177
+ Number of sequences to be generated for each PDB file.
178
+ max_processes: int = 8
179
+ Number of cores to use, default is 8.
180
+ working_dir: Path
181
+ Dir where to store temporary files and results.
182
+ path_to_assemblies: Path
183
+ Dir with biological assemblies.
184
+ path_to_rosetta: Path
185
+ Location of rosetta executable.
186
+ """
187
+
188
+ inputs = []
189
+
190
+ # check if working directory exists. Make one if doesn't exist.
191
+ if not working_dir.exists():
192
+ os.makedirs(working_dir)
193
+ if not (working_dir / "results").exists():
194
+ os.makedirs(working_dir / "results")
195
+ print(f"{len(structures)} structures will be predicted.")
196
+
197
+ for protein in structures:
198
+ inputs.append(
199
+ (
200
+ protein[:4],
201
+ protein[4],
202
+ working_dir,
203
+ path_to_rosetta,
204
+ path_to_assemblies,
205
+ )
206
+ )
207
+ with multiprocessing.Pool(max_processes) as P:
208
+ P.starmap(run_Rosetta, inputs)
209
+
210
+
211
+ if __name__ == "__main__":
212
+ # seq_to_arr(Path('/home/s1706179/Rosetta/data_polyglycine/'),Path('/home/s1706179/Rosetta/data/set.txt'),False)
213
+ seq_to_arr(
214
+ Path("/home/s1706179/Rosetta/data_nmr_polyglycine/"),
215
+ Path("/home/s1706179/Rosetta/data/nmr_set.txt"),
216
+ False,
217
+ )
data/run_predictions/run_Rosetta/run_fixbb.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Runs Rosetta predictions"
2
+
3
+ import fixbb
4
+ from pathlib import Path
5
+ import click
6
+ import os
7
+
8
+
9
+ @click.command()
10
+ @click.option(
11
+ "--dataset",
12
+ help="Path to .txt file with dataset list (PDB+chain, e.g., 1a2bA).",
13
+ type=click.Path(exists=True),
14
+ required=True,
15
+ )
16
+ @click.option(
17
+ "--path_to_assemblies",
18
+ help="Path to the directory with biological assemblies.",
19
+ type=click.Path(exists=True),
20
+ required=True,
21
+ )
22
+ @click.option(
23
+ "--working_dir",
24
+ help="Directory where to store results.",
25
+ type=click.Path(),
26
+ required=True,
27
+ )
28
+ @click.option(
29
+ "--path_to_rosetta",
30
+ help="Path to Rosetta executable.",
31
+ type=click.Path(exists=True),
32
+ required=True,
33
+ )
34
+ @click.option(
35
+ "--max_processes", help="Maximum number of cores to use", type=int, default=8
36
+ )
37
+ def run_rosetta(
38
+ dataset: str,
39
+ working_dir: str,
40
+ path_to_rosetta: str,
41
+ max_processes: int,
42
+ path_to_assemblies: str,
43
+ ) -> None:
44
+ """Runs EvoEF2 sequence predictions on a specified set.
45
+ \f
46
+ Parameters
47
+ ---------
48
+ dataset: str
49
+ Path to .txt file with dataset list (PDB+chain, e.g., 1a2bA).
50
+ working_dir: str
51
+ Path to dir where to save temp files and results.
52
+ path_to_rosetta: str
53
+ Path to Rosetta executable.
54
+ max_processes: int
55
+ Maximum number of cores to use.
56
+ path_to_assemblies: str
57
+ Path to the directory with biological assemblies.
58
+ nmr: bool
59
+ If true, the code expects a PDB file with NMR states insted of biological assemblies.
60
+ """
61
+ with open(dataset, "r") as file:
62
+ structures = [x.strip("\n") for x in file.readlines()]
63
+ fixbb.multi_Rosetta(
64
+ structures,
65
+ max_processes=max_processes,
66
+ working_dir=Path(working_dir),
67
+ path_to_rosetta=Path(path_to_rosetta),
68
+ path_to_assemblies=Path(path_to_assemblies),
69
+ )
70
+
71
+
72
+ if __name__ == "__main__":
73
+ run_rosetta()
data/run_predictions/run_proteinsolver.ipynb ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import gzip\n",
10
+ "import heapq\n",
11
+ "import io\n",
12
+ "import json\n",
13
+ "import os\n",
14
+ "import shutil\n",
15
+ "import time\n",
16
+ "from pathlib import Path\n",
17
+ "os.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0\"\n",
18
+ "\n",
19
+ "import kmtools.sci_tools\n",
20
+ "import numpy as np\n",
21
+ "import pandas as pd\n",
22
+ "import proteinsolver\n",
23
+ "import pyarrow as pa\n",
24
+ "import pyarrow.parquet as pq\n",
25
+ "import torch\n",
26
+ "import torch_geometric\n",
27
+ "#from IPython.display import HTML, display\n",
28
+ "from kmbio import PDB\n",
29
+ "from torch_geometric.data import Batch\n",
30
+ "from tqdm.notebook import tqdm\n",
31
+ "from sklearn.preprocessing import OneHotEncoder\n",
32
+ "\n",
33
+ "acids = [\n",
34
+ " \"A\",\n",
35
+ " \"C\",\n",
36
+ " \"D\",\n",
37
+ " \"E\",\n",
38
+ " \"F\",\n",
39
+ " \"G\",\n",
40
+ " \"H\",\n",
41
+ " \"I\",\n",
42
+ " \"K\",\n",
43
+ " \"L\",\n",
44
+ " \"M\",\n",
45
+ " \"N\",\n",
46
+ " \"P\",\n",
47
+ " \"Q\",\n",
48
+ " \"R\",\n",
49
+ " \"S\",\n",
50
+ " \"T\",\n",
51
+ " \"V\",\n",
52
+ " \"W\",\n",
53
+ " \"Y\",\n",
54
+ "]\n",
55
+ "\n",
56
+ "@torch.no_grad()\n",
57
+ "def design_sequence(net, data, random_position=False, value_selection_strategy=\"map\", num_categories=None):\n",
58
+ " assert value_selection_strategy in (\"map\", \"multinomial\", \"ref\")\n",
59
+ "\n",
60
+ " if num_categories is None:\n",
61
+ " num_categories = data.x.max().item()\n",
62
+ "\n",
63
+ " if hasattr(data, \"batch\"):\n",
64
+ " batch_size = data.batch.max().item() + 1\n",
65
+ " else:\n",
66
+ " print(\"Defaulting to batch size of one.\")\n",
67
+ " batch_size = 1\n",
68
+ "\n",
69
+ " if value_selection_strategy == \"ref\":\n",
70
+ " x_ref = data.y if hasattr(data, \"y\") and data.y is not None else data.x\n",
71
+ "\n",
72
+ " x = torch.ones_like(data.x) * num_categories\n",
73
+ " x_proba = torch.zeros_like(x).to(torch.float)\n",
74
+ " index_array_ref = torch.arange(x.size(0))\n",
75
+ " mask_ref = x == num_categories\n",
76
+ " while mask_ref.any():\n",
77
+ " output = net(x, data.edge_index, data.edge_attr)\n",
78
+ " output_proba_ref = torch.softmax(output, dim=1)\n",
79
+ " output_proba_max_ref, _ = output_proba_ref.max(dim=1)\n",
80
+ "\n",
81
+ " for i in range(batch_size):\n",
82
+ " mask = mask_ref\n",
83
+ " if batch_size > 1:\n",
84
+ " mask = mask & (data.batch == i)\n",
85
+ "\n",
86
+ " index_array = index_array_ref[mask]\n",
87
+ " max_probas = output_proba_max_ref[mask]\n",
88
+ "\n",
89
+ " if random_position:\n",
90
+ " selected_residue_subindex = torch.randint(0, max_probas.size(0), (1,)).item()\n",
91
+ " max_proba_index = index_array[selected_residue_subindex]\n",
92
+ " else:\n",
93
+ " selected_residue_subindex = max_probas.argmax().item()\n",
94
+ " max_proba_index = index_array[selected_residue_subindex]\n",
95
+ "\n",
96
+ " assert x[max_proba_index] == num_categories\n",
97
+ " assert x_proba[max_proba_index] == 0\n",
98
+ " category_probas = output_proba_ref[max_proba_index]\n",
99
+ "\n",
100
+ " if value_selection_strategy == \"map\":\n",
101
+ " chosen_category_proba, chosen_category = category_probas.max(dim=0)\n",
102
+ " elif value_selection_strategy == \"multinomial\":\n",
103
+ " chosen_category = torch.multinomial(category_probas, 1).item()\n",
104
+ " chosen_category_proba = category_probas[chosen_category]\n",
105
+ " else:\n",
106
+ " assert value_selection_strategy == \"ref\"\n",
107
+ " chosen_category = x_ref[max_proba_index]\n",
108
+ " chosen_category_proba = category_probas[chosen_category]\n",
109
+ "\n",
110
+ " assert chosen_category != num_categories\n",
111
+ " x[max_proba_index] = chosen_category\n",
112
+ " x_proba[max_proba_index] = chosen_category_proba\n",
113
+ " mask_ref = x == num_categories\n",
114
+ " del output, output_proba_ref, output_proba_max_ref\n",
115
+ " return x.cpu(), x_proba.cpu()\n",
116
+ " \n",
117
+ "\n",
118
+ "def run_ps(path_to_assemblies:Path, dataset_list:Path):\n",
119
+ " #load the model\n",
120
+ " state_file = '/home/s1706179/Proteinsolver/e53-s1952148-d93703104.state'\n",
121
+ " device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n",
122
+ " %run /home/s1706179/Proteinsolver/model.py\n",
123
+ "\n",
124
+ " batch_size = 512\n",
125
+ " num_features = 20\n",
126
+ " adj_input_size = 2\n",
127
+ " hidden_size = 128\n",
128
+ " frac_present = 0.5\n",
129
+ " frac_present_valid = frac_present\n",
130
+ " info_size= 1024\n",
131
+ "\n",
132
+ " net = Net(\n",
133
+ " x_input_size=num_features + 1, adj_input_size=adj_input_size, hidden_size=hidden_size, output_size=num_features\n",
134
+ " )\n",
135
+ " net.load_state_dict(torch.load(state_file, map_location=device))\n",
136
+ " net.eval()\n",
137
+ " net = net.to(device)\n",
138
+ " #run predictions\n",
139
+ " with open(dataset_list,'r') as file:\n",
140
+ " structures = [x.strip(\"\\n\") for x in file.readlines()]\n",
141
+ " results={}\n",
142
+ " for protein in structures:\n",
143
+ " STRUCTURE_FILE = path_to_assemblies/(protein[:4]+'.pdb')\n",
144
+ " chain_id=protein[-1]\n",
145
+ " try:\n",
146
+ " structure_all = PDB.load(STRUCTURE_FILE)\n",
147
+ " structure = PDB.Structure(STRUCTURE_FILE.name + chain_id, structure_all[0].extract(chain_id))\n",
148
+ " pdata = proteinsolver.utils.extract_seq_and_adj(structure, chain_id)\n",
149
+ " data = proteinsolver.datasets.protein.row_to_data(pdata)\n",
150
+ " data = proteinsolver.datasets.protein.transform_edge_attr(data)\n",
151
+ " residues, residue_probas = design_sequence(\n",
152
+ " net, data.to(device), random_position=False, value_selection_strategy=\"map\", num_categories=20\n",
153
+ " )\n",
154
+ " results[protein] = \"\".join(proteinsolver.utils.AMINO_ACIDS[i] for i in residues)\n",
155
+ " except ValueError:\n",
156
+ " continue\n",
157
+ " \n",
158
+ "\n",
159
+ " enc=OneHotEncoder(categories=[acids],sparse=False)\n",
160
+ " predicted_sequences = []\n",
161
+ " with open('/home/s1706179/Proteinsolver/proteinsolver_nmr.txt','w') as file:\n",
162
+ " file.write(f\"ignore_uncommon False\\ninclude_pdbs\\n##########\\n\")\n",
163
+ " for chain in results:\n",
164
+ " predicted_sequences+=list(results[chain])\n",
165
+ " file.write(f\"{chain} {len(results[chain])}\\n\")\n",
166
+ " arr=enc.fit_transform(np.array(predicted_sequences).reshape(-1, 1))\n",
167
+ " pd.DataFrame(arr).to_csv(\"/home/s1706179/Proteinsolver/proteinsolver_nmr.csv\", header=None, index=None)\n",
168
+ " \n",
169
+ "run_ps(Path(\"/home/s1706179/Rosetta/empty_nmr_backbones/\"),Path(\"/home/s1706179/Rosetta/data/nmr_set.txt\"))"
170
+ ]
171
+ },
172
+ {
173
+ "cell_type": "code",
174
+ "execution_count": null,
175
+ "metadata": {},
176
+ "outputs": [],
177
+ "source": []
178
+ }
179
+ ],
180
+ "metadata": {
181
+ "kernelspec": {
182
+ "display_name": "Python 3",
183
+ "language": "python",
184
+ "name": "python3"
185
+ },
186
+ "language_info": {
187
+ "codemirror_mode": {
188
+ "name": "ipython",
189
+ "version": 3
190
+ },
191
+ "file_extension": ".py",
192
+ "mimetype": "text/x-python",
193
+ "name": "python",
194
+ "nbconvert_exporter": "python",
195
+ "pygments_lexer": "ipython3",
196
+ "version": "3.7.9"
197
+ }
198
+ },
199
+ "nbformat": 4,
200
+ "nbformat_minor": 5
201
+ }
data/setup.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from setuptools import find_packages, setup
2
+
3
+ setup(
4
+ name="PDBench",
5
+ packages=find_packages(include=["benchmark"]),
6
+ version="0.1.0",
7
+ description="PDBench: software package for evaluating fixed-backbone sequence design algorithms",
8
+ author="Rokas Petrenas, Wells Wood Lab, University of Edinburgh",
9
+ license="MIT",
10
+ test_suite="test",
11
+ install_requires=['wheel','ampal','wget','numpy==1.19.5','pandas==1.2.0','scikit-learn==0.24.1','pathlib==1.0.1','matplotlib==3.3.3','click==7.1.2','scipy==1.6.0']
12
+ )
data/test/__init__.py ADDED
File without changes
data/test/run_test.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from benchmark import get_cath
2
+ import numpy as np
3
+ from pathlib import Path
4
+ import os
5
+ import sys
6
+
7
+
8
+ location=Path(__file__).parent.resolve()
9
+ PATH_TO_PDB=Path(sys.argv[1])
10
+ assert (PATH_TO_PDB.exists()), 'PDB directory is missing!'
11
+
12
+ def test_load_CATH():
13
+ """Tests basic benchmark functions - loading data, calculating metrics, ect."""
14
+
15
+ cath_location = location.parents[0]/"cath-domain-description-file.txt"
16
+ cath_df = get_cath.read_data(cath_location)
17
+ new_df=get_cath.filter_with_user_list(cath_df,location/'test_set.txt')
18
+ # check shape
19
+ assert new_df.shape == (10, 8), "DataFrame shape is incorrect"
20
+ pdbs = get_cath.get_pdbs(new_df,1,20)
21
+ assert pdbs.shape == (1, 8), "Filtered shape is incorrect"
22
+
23
+ # check sequence, 1a41A02 fragment.
24
+ new_df = get_cath.append_sequence(new_df,PATH_TO_PDB)
25
+ fragment_sequence=new_df[new_df.PDB == "1a41"]
26
+ sequence=fragment_sequence.sequence.values[0]
27
+ start=fragment_sequence.start.values[0]
28
+ stop=fragment_sequence.stop.values[0]
29
+ assert (sequence[start:stop+1] == "IRIKDLRTYGVNYTFLYNFWTNVKSISPLPSPKKLIALTIKQTAEVVGHTPSISKRAYMATTILEMVKDKNFLDVVSKTTFDEFLSIVVDHVKS"
30
+ ), "Sequence assigned incorrectly"
31
+
32
+ #check sequence, 1cruA00 fragment
33
+ fragment_sequence=new_df[new_df.PDB == "1cru"]
34
+ sequence=fragment_sequence.sequence.values[0]
35
+ start=fragment_sequence.start.values[0]
36
+ stop=fragment_sequence.stop.values[0]
37
+ assert (sequence[start:stop+1] == "DVPLTPSQFAKAKSENFDKKVILSNLNKPHALLWGPDNQIWLTERATGKILRVNPESGSVKTVFQVPEIVNDADGQNGLLGFAFHPDFKNNPYIYISGTFKNPKSKELPNQTIIRRYTYNKSTDTLEKPVDLLAGLPSSKDHQSGRLVIGPDQKIYYTIGDQGRNQLAYLFLPNQAQHTPTQQELNGKDYHTYMGKVLRLNLDGSIPKDNPSFNGVVSHIYTLGHRNPQGLAFTPNGKLLQSEQGPNSDDEINLIVKGGNYGWPNVAGYKDDSGYAYANYSAAANKSIKDLAQNGVKVAAGVPVTKESEWTGKNFVPPLKTLYTVQDTYNYNDPTCGEMTYICWPTVAPSSAYVYKGGKKAITGWENTLLVPSLKRGVIFRIKLDPTYSTTYDDAVPMFKSNNRYRDVIASPDGNVLYVLTDTAGNVQKDDGSVTNTLENPGSLIKFT"
38
+ ), "Sequence assigned incorrectly"
39
+
40
+ #load predictions
41
+ path_to_file=Path(location/'test_data.csv')
42
+ with open(path_to_file.with_suffix('.txt')) as datasetmap:
43
+ predictions = get_cath.load_prediction_matrix(new_df, path_to_file.with_suffix('.txt'), path_to_file)
44
+
45
+ # check accuracy and recall
46
+ accuracy,recall=get_cath.score_each(new_df,predictions,by_fragment=True)
47
+ assert (
48
+ abs(accuracy[0] - 0.298) <= 0.001
49
+ ), "Sequence recovery calculated incorrectly"
50
+
51
+ accuracy,recall=get_cath.score_each(new_df,predictions,by_fragment=True)
52
+ assert (
53
+ abs(recall[3] - 0.384) <= 0.001
54
+ ), "Macro-recall calculated incorrectly"
55
+
56
+ def test_command_line():
57
+ """Tests command line interface"""
58
+ os.system(f'python {location.parents[0]/"run_benchmark.py"} --dataset {location/"test_set.txt"} --path_to_pdb {PATH_TO_PDB} --path_to_models {location} --training_set {location/"trainingset.txt"}')
59
+ assert (Path(location/'test_data.csv.pdf').exists()), 'Failed to produce plots!'
60
+ assert (Path(location/'test_data_1a41.pdb').exists()), 'Failed to produce PDB with accuracy and entropy!'
61
+ if __name__=='__main__':
62
+ test_load_CATH()
63
+ test_command_line()
data/test/test_data.csv ADDED
The diff for this file is too large to render. See raw diff
 
data/test/test_data.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ignore_uncommon False
2
+ include_pdbs 1a41
3
+ ##########
4
+ 1a41A 221
5
+ 1a92A 50
6
+ 1b2pA 119
7
+ 1b77A 228
8
+ 1b8kA 90
9
+ 1bx7A 51
10
+ 1c1yB 77
11
+ 1c3mA 145
12
+ 1chdA 198
13
+ 1cruA 448
data/test/test_set.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ 1a41A
2
+ 1a92A
3
+ 1b2pA
4
+ 1b77A
5
+ 1b8kA
6
+ 1bx7A
7
+ 1c1yB
8
+ 1c3mA
9
+ 1chdA
10
+ 1cruA
data/test/trainingset.txt ADDED
The diff for this file is too large to render. See raw diff