-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalpha.py
487 lines (391 loc) · 30.5 KB
/
alpha.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
##############################################################
### ###
### CYCLICA ALPHAFOLD 2 CHALLENGE ###
### ###
### We have developed a binary classification model to ###
### predict 'drug binding' or 'non-drug binding' for any ###
### query residue within a protein. We are using an ###
### AlphaFold2 predicted protien model for our training ###
### data, with data confirmed by Cyclica showing if a ###
### paticular site (amino acid QR) is 'drug binding' or ###
### 'non-drug binding'. ###
### ###
##############################################################
### ###
### Authors: Matthew Athanasopoulous ###
### ###
##############################################################
# alpha.py cleans our data and prepares it for use in a neural network
# Importing pandas and numpy for functions
import pandas as pd
import numpy as np
data = pd.read_csv("af2_dataset_training_labeled.csv")
# Organizing the data (removing redundant features)
# We will be dropping some uneccesary features using the pandas Dataframe.drop() function. We will be left with all of our features representing indivual 2-D arrays, and then piece them together using the numpy empty and append functions.
##################################
#
# Legend:
#
# x1 -> indexing & annotation_sequence
# x1_label1_list -> Represents the alpha-carboxyl group's pKa.
# x1_label2_list -> Represents the alpha-ammonium ion's pKa.
# x1_label3_list -> Represents the side chain group's pKa.
# x1_label4_list -> Represents the isoelectronic point.
# x1_label5_list -> Represents the hydrophilicity of each amino acid.
# x2 -> feat_PHI -> Protein chain bonding angle, computed with [Biopython].
# x3 -> feat_PSI -> Protein chain bonding angle, computed with [Biopython].
# x4 -> feat_TAU -> Protein chain bonding angle, computed with [Biopython].
# x5 -> feat_THETA -> Protein chain bonding angle, computed with [Biopython].
# x6 -> feat_BBSASA -> Protein chain bonding angle, computed with [Biopython].
# x7 -> feat_SCSASA -> Protein chain bonding angle, computed with [Biopython].
# For reference: (https://biopython.org/docs/1.75/api/Bio.PDB.Polypeptide.html)
# x8 -> feat_pLDDT -> AlphaFold2 residue-level prediction confidence value.
# x9 -> feat_DSSP_H -> Secondary structure assignment by [DSSP].
# x10 -> feat_DSSP_B -> Secondary structure assignment by [DSSP].
# x11 -> feat_DSSP_E -> Secondary structure assignment by [DSSP].
# x12 -> feat_DSSP_G -> Secondary structure assignment by [DSSP].
# x13 -> feat_DSSP_I -> Secondary structure assignment by [DSSP].
# x14 -> feat_DSSP_T -> Secondary structure assignment by [DSSP].
# x15 -> feat_DSSP_S -> Secondary structure assignment by [DSSP].
# For reference: -> (https://en.wikipedia.org/wiki/DSSP_(algorithm))
# x16 -> feat_DSSP_6 -> Backbone structural feature describing backbone hydrogen bonding networks.
# x17 -> feat_DSSP_7 -> Backbone structural feature describing backbone hydrogen bonding networks.
# x18 -> feat_DSSP_8 -> Backbone structural feature describing backbone hydrogen bonding networks.
# x19 -> feat_DSSP_9 -> Backbone structural feature describing backbone hydrogen bonding networks.
# x20 -> feat_DSSP_10 -> Backbone structural feature describing backbone hydrogen bonding networks.
# x21 -> feat_DSSP_11 -> Backbone structural feature describing backbone hydrogen bonding networks.
# x22 -> feat_DSSP_12 -> Backbone structural feature describing backbone hydrogen bonding networks.
# x23 -> feat_DSSP_13 -> Backbone structural feature describing backbone hydrogen bonding networks.
# x24 -> y_Ligand -> Indicates if the residue (row) belongs to a known binding site or not.
#
###################################
x1 = data.drop(['annotation_atomrec', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x1_np_array = x1.to_numpy()
x2 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x2_np_array = x2.to_numpy()
x2_np_array = np.delete(x2_np_array, 0, 1)
x3 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x3_np_array = x3.to_numpy()
x3_np_array = np.delete(x3_np_array, 0, 1)
x4 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x4_np_array = x4.to_numpy()
x4_np_array = np.delete(x4_np_array, 0, 1)
x5 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x5_np_array = x5.to_numpy()
x5_np_array = np.delete(x5_np_array, 0, 1)
x6 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x6_np_array = x6.to_numpy()
x6_np_array = np.delete(x6_np_array, 0, 1)
x7 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x7_np_array = x7.to_numpy()
x7_np_array = np.delete(x7_np_array, 0, 1)
x8 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x8_np_array = x8.to_numpy()
x8_np_array = np.delete(x8_np_array, 0, 1)
x9 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x9_np_array = x9.to_numpy()
x9_np_array = np.delete(x9_np_array, 0, 1)
x10 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x10_np_array = x10.to_numpy()
x10_np_array = np.delete(x10_np_array, 0, 1)
x11 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x11_np_array = x11.to_numpy()
x11_np_array = np.delete(x11_np_array, 0, 1)
x12 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x12_np_array = x12.to_numpy()
x12_np_array = np.delete(x12_np_array, 0, 1)
x13 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x13_np_array = x13.to_numpy()
x13_np_array = np.delete(x13_np_array, 0, 1)
x14 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x14_np_array = x14.to_numpy()
x14_np_array = np.delete(x14_np_array, 0, 1)
x15 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x15_np_array = x15.to_numpy()
x15_np_array = np.delete(x15_np_array, 0, 1)
x16 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x16_np_array = x16.to_numpy()
x16_np_array = np.delete(x16_np_array, 0, 1)
x17 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x17_np_array = x17.to_numpy()
x17_np_array = np.delete(x17_np_array, 0, 1)
x18 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x18_np_array = x18.to_numpy()
x18_np_array = np.delete(x18_np_array, 0, 1)
x19 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x19_np_array = x19.to_numpy()
x19_np_array = np.delete(x19_np_array, 0, 1)
x20 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x20_np_array = x20.to_numpy()
x20_np_array = np.delete(x20_np_array, 0, 1)
x21 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x21_np_array = x21.to_numpy()
x21_np_array = np.delete(x21_np_array, 0, 1)
x22 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x22_np_array = x22.to_numpy()
x22_np_array = np.delete(x22_np_array, 0, 1)
x23 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index', 'y_Ligand'],
axis=1)
x23_np_array = x23.to_numpy()
x23_np_array = np.delete(x23_np_array, 0, 1)
x24 = data.drop(['annotation_sequence', 'feat_A', 'feat_C', 'feat_D', 'feat_E', 'feat_F', 'feat_G', 'feat_H', 'feat_I', 'feat_K', 'feat_L', 'feat_M', 'feat_N', 'feat_P', 'feat_Q', 'feat_R', 'feat_S', 'feat_T', 'feat_V', 'feat_W', 'feat_Y', 'annotation_atomrec', 'feat_PHI', 'feat_PSI', 'feat_TAU', 'feat_THETA', 'feat_BBSASA', 'feat_SCSASA', 'feat_pLDDT', 'feat_DSSP_H', 'feat_DSSP_B', 'feat_DSSP_E', 'feat_DSSP_G', 'feat_DSSP_I', 'feat_DSSP_T', 'feat_DSSP_S', 'feat_DSSP_6', 'feat_DSSP_7', 'feat_DSSP_8', 'feat_DSSP_9', 'feat_DSSP_10', 'feat_DSSP_11', 'feat_DSSP_12', 'feat_DSSP_13', 'coord_X', 'coord_Y', 'coord_Z', 'entry', 'entry_index'],
axis=1)
x24_np_array = x24.to_numpy()
x24_np_array = np.delete(x24_np_array, 0, 1)
# All columns have been seperated, we will now make adjustments to columns which are not "machine-readable".
x1_label1_list = []
x1_label2_list = []
x1_label3_list = []
x1_label4_list = []
x1_label5_list = []
x9_label_list = []
x10_label_list = []
x11_label_list = []
x12_label_list = []
x13_label_list = []
x14_label_list = []
x15_label_list = []
x24_label_list = []
# Making a combination of pKa1, pKa2, pKa3, and pl values for each amino acid. For reference pKa1= α-carboxyl group, pKa2 = α-ammonium ion, and pKa3 = side chain group. Also, pl is just the isoelectronic point. Researach from the University of Calgary: https://www.chem.ucalgary.ca/courses/350/Carey5th/Ch27/ch27-1-4-2.html
# Also adds a hydrophilicity value for each amino acid. Research for values from IMGT: https://www.imgt.org/IMGTeducation/Aide-memoire/_UK/aminoacids/IMGTclasses.html
for i in range(0, data.shape[0]):
if x1_np_array[i][1] == 'A':
x1_label1_list.append(2.34)
x1_label2_list.append(9.69)
x1_label3_list.append(0)
x1_label4_list.append(6.00)
x1_label5_list.append(1.8)
elif x1_np_array[i][1] == 'C':
x1_label1_list.append(1.96)
x1_label2_list.append(8.18)
x1_label3_list.append(0)
x1_label4_list.append(5.07)
x1_label5_list.append(2.5)
elif x1_np_array[i][1] == 'D':
x1_label1_list.append(1.88)
x1_label2_list.append(9.60)
x1_label3_list.append(3.65)
x1_label4_list.append(2.77)
x1_label5_list.append(-3.5)
elif x1_np_array[i][1] == 'E':
x1_label1_list.append(2.19)
x1_label2_list.append(9.67)
x1_label3_list.append(4.25)
x1_label4_list.append(3.22)
x1_label5_list.append(-3.5)
elif x1_np_array[i][1] == 'F':
x1_label1_list.append(1.83)
x1_label2_list.append(9.13)
x1_label3_list.append(0)
x1_label4_list.append(5.48)
x1_label5_list.append(2.8)
elif x1_np_array[i][1] == 'G':
x1_label1_list.append(2.34)
x1_label2_list.append(9.60)
x1_label3_list.append(0)
x1_label4_list.append(5.97)
x1_label5_list.append(-0.4)
elif x1_np_array[i][1] == 'H':
x1_label1_list.append(1.82)
x1_label2_list.append(9.17)
x1_label3_list.append(6.00)
x1_label4_list.append(7.59)
x1_label5_list.append(-3.2)
elif x1_np_array[i][1] == 'I':
x1_label1_list.append(2.36)
x1_label2_list.append(9.60)
x1_label3_list.append(0)
x1_label4_list.append(5.98)
x1_label5_list.append(4.5)
elif x1_np_array[i][1] == 'K':
x1_label1_list.append(2.18)
x1_label2_list.append(8.95)
x1_label3_list.append(10.53)
x1_label4_list.append(9.74)
x1_label5_list.append(-3.9)
elif x1_np_array[i][1] == 'L':
x1_label1_list.append(2.36)
x1_label2_list.append(9.60)
x1_label3_list.append(0)
x1_label4_list.append(5.98)
x1_label5_list.append(3.8)
elif x1_np_array[i][1] == 'M':
x1_label1_list.append(2.28)
x1_label2_list.append(9.21)
x1_label3_list.append(0)
x1_label4_list.append(5.74)
x1_label5_list.append(1.9)
elif x1_np_array[i][1] == 'N':
x1_label1_list.append(2.02)
x1_label2_list.append(8.80)
x1_label3_list.append(0)
x1_label4_list.append(5.41)
x1_label5_list.append(-3.5)
elif x1_np_array[i][1] == 'P':
x1_label1_list.append(1.99)
x1_label2_list.append(10.60)
x1_label3_list.append(0)
x1_label4_list.append(6.30)
x1_label5_list.append(-1.6)
elif x1_np_array[i][1] == 'Q':
x1_label1_list.append(2.17)
x1_label2_list.append(9.13)
x1_label3_list.append(0)
x1_label4_list.append(5.65)
x1_label5_list.append(-3.5)
elif x1_np_array[i][1] == 'R':
x1_label1_list.append(2.17)
x1_label2_list.append(9.04)
x1_label3_list.append(12.48)
x1_label4_list.append(10.76)
x1_label5_list.append(-4.5)
elif x1_np_array[i][1] == 'S':
x1_label1_list.append(2.21)
x1_label2_list.append(9.15)
x1_label3_list.append(0)
x1_label4_list.append(5.68)
x1_label5_list.append(-0.8)
elif x1_np_array[i][1] == 'T':
x1_label1_list.append(2.09)
x1_label2_list.append(9.10)
x1_label3_list.append(0)
x1_label4_list.append(5.60)
x1_label5_list.append(-0.7)
elif x1_np_array[i][1] == 'V':
x1_label1_list.append(2.32)
x1_label2_list.append(9.62)
x1_label3_list.append(0)
x1_label4_list.append(5.96)
x1_label5_list.append(4.2)
elif x1_np_array[i][1] == 'W':
x1_label1_list.append(2.83)
x1_label2_list.append(9.39)
x1_label3_list.append(0)
x1_label4_list.append(5.89)
x1_label5_list.append(-0.9)
elif x1_np_array[i][1] == 'Y':
x1_label1_list.append(2.20)
x1_label2_list.append(9.11)
x1_label3_list.append(0)
x1_label4_list.append(5.66)
x1_label5_list.append(-1.3)
for i in range(0, data.shape[0]):
if x9_np_array[i] == False:
x9_label_list.append(0)
elif x9_np_array[i] == True:
x9_label_list.append(1)
for i in range(0, data.shape[0]):
if x10_np_array[i] == False:
x10_label_list.append(0)
elif x10_np_array[i] == True:
x10_label_list.append(1)
for i in range(0, data.shape[0]):
if x11_np_array[i] == False:
x11_label_list.append(0)
elif x11_np_array[i] == True:
x11_label_list.append(1)
for i in range(0, data.shape[0]):
if x12_np_array[i] == False:
x12_label_list.append(0)
elif x12_np_array[i] == True:
x12_label_list.append(1)
for i in range(0, data.shape[0]):
if x13_np_array[i] == False:
x13_label_list.append(0)
elif x13_np_array[i] == True:
x13_label_list.append(1)
for i in range(0, data.shape[0]):
if x14_np_array[i] == False:
x14_label_list.append(0)
elif x14_np_array[i] == True:
x14_label_list.append(1)
for i in range(0, data.shape[0]):
if x15_np_array[i] == False:
x15_label_list.append(0)
elif x15_np_array[i] == True:
x15_label_list.append(1)
for i in range(0, data.shape[0]):
if x24_np_array[i] == False:
x24_label_list.append(0)
elif x24_np_array[i] == True:
x24_label_list.append(1)
# The data has been numerized. We will now make it back into a big 2D matrix so we can so machine learning and stuff
x1_label1 = np.empty([len(x1_label1_list), 0], float)
x1_label1 = np.append(x1_label1, np.array([x1_label1_list]).transpose(),
axis=1)
x1_label2 = np.empty([len(x1_label2_list), 0], float)
x1_label2 = np.append(x1_label2, np.array([x1_label2_list]).transpose(),
axis=1)
x1_label3 = np.empty([len(x1_label3_list), 0], float)
x1_label3 = np.append(x1_label3, np.array([x1_label3_list]).transpose(),
axis=1)
x1_label4 = np.empty([len(x1_label4_list), 0], float)
x1_label4 = np.append(x1_label4, np.array([x1_label4_list]).transpose(),
axis=1)
x1_label5 = np.empty([len(x1_label5_list), 0], float)
x1_label5 = np.append(x1_label5, np.array([x1_label5_list]).transpose(),
axis=1)
x9_label = np.empty([len(x9_label_list), 0], float)
x9_label = np.append(x9_label, np.array([x9_label_list]).transpose(),
axis=1)
x10_label = np.empty([len(x10_label_list), 0], float)
x10_label = np.append(x10_label, np.array([x10_label_list]).transpose(),
axis=1)
x11_label = np.empty([len(x11_label_list), 0], float)
x11_label = np.append(x11_label, np.array([x11_label_list]).transpose(),
axis=1)
x12_label = np.empty([len(x12_label_list), 0], float)
x12_label = np.append(x12_label, np.array([x12_label_list]).transpose(),
axis=1)
x13_label = np.empty([len(x13_label_list), 0], float)
x13_label = np.append(x13_label, np.array([x13_label_list]).transpose(),
axis=1)
x14_label = np.empty([len(x14_label_list), 0], float)
x14_label = np.append(x14_label, np.array([x14_label_list]).transpose(),
axis=1)
x15_label = np.empty([len(x15_label_list), 0], float)
x15_label = np.append(x15_label, np.array([x15_label_list]).transpose(),
axis=1)
x24_label = np.empty([len(x24_label_list), 0], float)
label = np.append(x24_label, np.array([x24_label_list]).transpose(),
axis=1)
# Creating the 2D output matrix with hstack;
# This matrix is optimized for our neural net build.
parameters = np.hstack((x1_label1, x1_label2, x1_label3, x1_label4, x1_label5, x2_np_array, x3_np_array, x4_np_array, x5_np_array, x6_np_array, x7_np_array, x8_np_array, x9_label, x10_label,
x11_label, x12_label, x13_label, x14_label, x15_label, x16_np_array, x17_np_array, x18_np_array, x19_np_array, x20_np_array, x21_np_array, x22_np_array, x23_np_array))
# Printing the output matrix for testing purposes
# j = len(parameters)
# Removes junk data
# while i < j:
#
# if parameters[i][6] == 0:
# parameters = np.delete(parameters, i, 0)
# i -= 1
# j -= 1
print(len(parameters))
print(parameters)
print(label)
# Building .csv export for testing purposes
# np.savetxt("output.csv", output, delimiter=",")