remove hetero atoms
Browse files- data/pdbbind_with_contacts.parquet +2 -2
- pdbbind.ipynb +27 -47
- pdbbind.py +2 -1
data/pdbbind_with_contacts.parquet
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:90b17f9e0253534a0ffd558c231de5d715c5620ab5985fcec59cb7c759f145ee
|
3 |
+
size 267149495
|
pdbbind.ipynb
CHANGED
@@ -111,7 +111,7 @@
|
|
111 |
},
|
112 |
{
|
113 |
"cell_type": "code",
|
114 |
-
"execution_count":
|
115 |
"id": "aa358835-55f3-4551-9217-e76a15de4fe8",
|
116 |
"metadata": {},
|
117 |
"outputs": [],
|
@@ -122,7 +122,7 @@
|
|
122 |
},
|
123 |
{
|
124 |
"cell_type": "code",
|
125 |
-
"execution_count":
|
126 |
"id": "802cb9bc-2563-4d7f-9a76-3be2d9263a36",
|
127 |
"metadata": {},
|
128 |
"outputs": [],
|
@@ -132,7 +132,7 @@
|
|
132 |
},
|
133 |
{
|
134 |
"cell_type": "code",
|
135 |
-
"execution_count":
|
136 |
"id": "d8e71a8c-11a3-41f0-ab61-3ddc57e10961",
|
137 |
"metadata": {},
|
138 |
"outputs": [],
|
@@ -142,7 +142,7 @@
|
|
142 |
},
|
143 |
{
|
144 |
"cell_type": "code",
|
145 |
-
"execution_count":
|
146 |
"id": "ed3fe035-6035-4d39-b072-d12dc0a95857",
|
147 |
"metadata": {},
|
148 |
"outputs": [],
|
@@ -157,7 +157,7 @@
|
|
157 |
},
|
158 |
{
|
159 |
"cell_type": "code",
|
160 |
-
"execution_count":
|
161 |
"id": "cd26125b-e68b-4fa3-846e-2b6e7f635fe0",
|
162 |
"metadata": {},
|
163 |
"outputs": [
|
@@ -177,7 +177,7 @@
|
|
177 |
},
|
178 |
{
|
179 |
"cell_type": "code",
|
180 |
-
"execution_count":
|
181 |
"id": "9c7c9849-2345-4baf-89e7-d412f52353b6",
|
182 |
"metadata": {},
|
183 |
"outputs": [
|
@@ -248,7 +248,7 @@
|
|
248 |
"dask.array<blocks, shape=(700, 2046, 510), dtype=float32, chunksize=(700, 2046, 510), chunktype=numpy.ndarray>"
|
249 |
]
|
250 |
},
|
251 |
-
"execution_count":
|
252 |
"metadata": {},
|
253 |
"output_type": "execute_result"
|
254 |
}
|
@@ -259,17 +259,17 @@
|
|
259 |
},
|
260 |
{
|
261 |
"cell_type": "code",
|
262 |
-
"execution_count":
|
263 |
"id": "0bd8e9b9-9713-4572-bd7f-dc47da9fce91",
|
264 |
"metadata": {},
|
265 |
"outputs": [
|
266 |
{
|
267 |
"data": {
|
268 |
"text/plain": [
|
269 |
-
"[
|
270 |
]
|
271 |
},
|
272 |
-
"execution_count":
|
273 |
"metadata": {},
|
274 |
"output_type": "execute_result"
|
275 |
}
|
@@ -280,17 +280,17 @@
|
|
280 |
},
|
281 |
{
|
282 |
"cell_type": "code",
|
283 |
-
"execution_count":
|
284 |
"id": "87493934-3839-476a-a975-7da057c320da",
|
285 |
"metadata": {},
|
286 |
"outputs": [
|
287 |
{
|
288 |
"data": {
|
289 |
"text/plain": [
|
290 |
-
"
|
291 |
]
|
292 |
},
|
293 |
-
"execution_count":
|
294 |
"metadata": {},
|
295 |
"output_type": "execute_result"
|
296 |
}
|
@@ -301,7 +301,7 @@
|
|
301 |
},
|
302 |
{
|
303 |
"cell_type": "code",
|
304 |
-
"execution_count":
|
305 |
"id": "42e95d84-ef27-4417-9479-8b356462b8c3",
|
306 |
"metadata": {},
|
307 |
"outputs": [],
|
@@ -323,7 +323,7 @@
|
|
323 |
},
|
324 |
{
|
325 |
"cell_type": "code",
|
326 |
-
"execution_count":
|
327 |
"id": "5520a925-693f-43f0-9e76-df2e128f272e",
|
328 |
"metadata": {},
|
329 |
"outputs": [
|
@@ -356,7 +356,7 @@
|
|
356 |
" <tr>\n",
|
357 |
" <th>0</th>\n",
|
358 |
" <td>10gs</td>\n",
|
359 |
-
" <td>[
|
360 |
" </tr>\n",
|
361 |
" <tr>\n",
|
362 |
" <th>1</th>\n",
|
@@ -384,14 +384,14 @@
|
|
384 |
],
|
385 |
"text/plain": [
|
386 |
" name contacts_5A\n",
|
387 |
-
"0 10gs [
|
388 |
"1 184l [39945, 39946, 39947, 39948, 43010, 43012, 430...\n",
|
389 |
"2 186l [39943, 39944, 39945, 43010, 43011, 43012, 430...\n",
|
390 |
"3 187l [39937, 39938, 39947, 43009, 43010, 43012, 430...\n",
|
391 |
"4 188l [39937, 39938, 39940, 39941, 43009, 43010, 430..."
|
392 |
]
|
393 |
},
|
394 |
-
"execution_count":
|
395 |
"metadata": {},
|
396 |
"output_type": "execute_result"
|
397 |
}
|
@@ -402,7 +402,7 @@
|
|
402 |
},
|
403 |
{
|
404 |
"cell_type": "code",
|
405 |
-
"execution_count":
|
406 |
"id": "4982c3b1-5ce9-4f17-9834-a02c4e136bc2",
|
407 |
"metadata": {},
|
408 |
"outputs": [],
|
@@ -412,7 +412,7 @@
|
|
412 |
},
|
413 |
{
|
414 |
"cell_type": "code",
|
415 |
-
"execution_count":
|
416 |
"id": "f6cdee43-33c6-445c-8619-ace20f90638c",
|
417 |
"metadata": {},
|
418 |
"outputs": [],
|
@@ -429,19 +429,10 @@
|
|
429 |
},
|
430 |
{
|
431 |
"cell_type": "code",
|
432 |
-
"execution_count":
|
433 |
"id": "8f49f871-76f6-4fb2-b2db-c0794d4c07bf",
|
434 |
"metadata": {},
|
435 |
-
"outputs": [
|
436 |
-
{
|
437 |
-
"name": "stdout",
|
438 |
-
"output_type": "stream",
|
439 |
-
"text": [
|
440 |
-
"CPU times: user 8min 48s, sys: 12min 3s, total: 20min 52s\n",
|
441 |
-
"Wall time: 3min 20s\n"
|
442 |
-
]
|
443 |
-
}
|
444 |
-
],
|
445 |
"source": [
|
446 |
"%%time\n",
|
447 |
"df_all_contacts = ddf_all.compute()"
|
@@ -449,7 +440,7 @@
|
|
449 |
},
|
450 |
{
|
451 |
"cell_type": "code",
|
452 |
-
"execution_count":
|
453 |
"id": "45e4b4fa-6338-4abe-bd6e-8aea46e2a09c",
|
454 |
"metadata": {},
|
455 |
"outputs": [],
|
@@ -459,21 +450,10 @@
|
|
459 |
},
|
460 |
{
|
461 |
"cell_type": "code",
|
462 |
-
"execution_count":
|
463 |
"id": "7c3db301-6565-4053-bbd4-139bb41dd1c4",
|
464 |
"metadata": {},
|
465 |
-
"outputs": [
|
466 |
-
{
|
467 |
-
"data": {
|
468 |
-
"text/plain": [
|
469 |
-
"(array([6.34974652]), array([3.56691843]))"
|
470 |
-
]
|
471 |
-
},
|
472 |
-
"execution_count": 36,
|
473 |
-
"metadata": {},
|
474 |
-
"output_type": "execute_result"
|
475 |
-
}
|
476 |
-
],
|
477 |
"source": [
|
478 |
"from sklearn.preprocessing import StandardScaler\n",
|
479 |
"scaler = StandardScaler()\n",
|
@@ -483,7 +463,7 @@
|
|
483 |
},
|
484 |
{
|
485 |
"cell_type": "code",
|
486 |
-
"execution_count":
|
487 |
"id": "c9d674bb-d6a2-4810-aa2b-e3bc3b4bbc98",
|
488 |
"metadata": {},
|
489 |
"outputs": [],
|
@@ -495,7 +475,7 @@
|
|
495 |
{
|
496 |
"cell_type": "code",
|
497 |
"execution_count": null,
|
498 |
-
"id": "
|
499 |
"metadata": {},
|
500 |
"outputs": [],
|
501 |
"source": []
|
|
|
111 |
},
|
112 |
{
|
113 |
"cell_type": "code",
|
114 |
+
"execution_count": 7,
|
115 |
"id": "aa358835-55f3-4551-9217-e76a15de4fe8",
|
116 |
"metadata": {},
|
117 |
"outputs": [],
|
|
|
122 |
},
|
123 |
{
|
124 |
"cell_type": "code",
|
125 |
+
"execution_count": 8,
|
126 |
"id": "802cb9bc-2563-4d7f-9a76-3be2d9263a36",
|
127 |
"metadata": {},
|
128 |
"outputs": [],
|
|
|
132 |
},
|
133 |
{
|
134 |
"cell_type": "code",
|
135 |
+
"execution_count": 9,
|
136 |
"id": "d8e71a8c-11a3-41f0-ab61-3ddc57e10961",
|
137 |
"metadata": {},
|
138 |
"outputs": [],
|
|
|
142 |
},
|
143 |
{
|
144 |
"cell_type": "code",
|
145 |
+
"execution_count": 10,
|
146 |
"id": "ed3fe035-6035-4d39-b072-d12dc0a95857",
|
147 |
"metadata": {},
|
148 |
"outputs": [],
|
|
|
157 |
},
|
158 |
{
|
159 |
"cell_type": "code",
|
160 |
+
"execution_count": 11,
|
161 |
"id": "cd26125b-e68b-4fa3-846e-2b6e7f635fe0",
|
162 |
"metadata": {},
|
163 |
"outputs": [
|
|
|
177 |
},
|
178 |
{
|
179 |
"cell_type": "code",
|
180 |
+
"execution_count": 12,
|
181 |
"id": "9c7c9849-2345-4baf-89e7-d412f52353b6",
|
182 |
"metadata": {},
|
183 |
"outputs": [
|
|
|
248 |
"dask.array<blocks, shape=(700, 2046, 510), dtype=float32, chunksize=(700, 2046, 510), chunktype=numpy.ndarray>"
|
249 |
]
|
250 |
},
|
251 |
+
"execution_count": 12,
|
252 |
"metadata": {},
|
253 |
"output_type": "execute_result"
|
254 |
}
|
|
|
259 |
},
|
260 |
{
|
261 |
"cell_type": "code",
|
262 |
+
"execution_count": 13,
|
263 |
"id": "0bd8e9b9-9713-4572-bd7f-dc47da9fce91",
|
264 |
"metadata": {},
|
265 |
"outputs": [
|
266 |
{
|
267 |
"data": {
|
268 |
"text/plain": [
|
269 |
+
"[16232, 16228, 16226, 16223]"
|
270 |
]
|
271 |
},
|
272 |
+
"execution_count": 13,
|
273 |
"metadata": {},
|
274 |
"output_type": "execute_result"
|
275 |
}
|
|
|
280 |
},
|
281 |
{
|
282 |
"cell_type": "code",
|
283 |
+
"execution_count": 14,
|
284 |
"id": "87493934-3839-476a-a975-7da057c320da",
|
285 |
"metadata": {},
|
286 |
"outputs": [
|
287 |
{
|
288 |
"data": {
|
289 |
"text/plain": [
|
290 |
+
"16232"
|
291 |
]
|
292 |
},
|
293 |
+
"execution_count": 14,
|
294 |
"metadata": {},
|
295 |
"output_type": "execute_result"
|
296 |
}
|
|
|
301 |
},
|
302 |
{
|
303 |
"cell_type": "code",
|
304 |
+
"execution_count": 15,
|
305 |
"id": "42e95d84-ef27-4417-9479-8b356462b8c3",
|
306 |
"metadata": {},
|
307 |
"outputs": [],
|
|
|
323 |
},
|
324 |
{
|
325 |
"cell_type": "code",
|
326 |
+
"execution_count": 16,
|
327 |
"id": "5520a925-693f-43f0-9e76-df2e128f272e",
|
328 |
"metadata": {},
|
329 |
"outputs": [
|
|
|
356 |
" <tr>\n",
|
357 |
" <th>0</th>\n",
|
358 |
" <td>10gs</td>\n",
|
359 |
+
" <td>[3083, 3084, 3086, 3087, 3088, 3089, 3094, 309...</td>\n",
|
360 |
" </tr>\n",
|
361 |
" <tr>\n",
|
362 |
" <th>1</th>\n",
|
|
|
384 |
],
|
385 |
"text/plain": [
|
386 |
" name contacts_5A\n",
|
387 |
+
"0 10gs [3083, 3084, 3086, 3087, 3088, 3089, 3094, 309...\n",
|
388 |
"1 184l [39945, 39946, 39947, 39948, 43010, 43012, 430...\n",
|
389 |
"2 186l [39943, 39944, 39945, 43010, 43011, 43012, 430...\n",
|
390 |
"3 187l [39937, 39938, 39947, 43009, 43010, 43012, 430...\n",
|
391 |
"4 188l [39937, 39938, 39940, 39941, 43009, 43010, 430..."
|
392 |
]
|
393 |
},
|
394 |
+
"execution_count": 16,
|
395 |
"metadata": {},
|
396 |
"output_type": "execute_result"
|
397 |
}
|
|
|
402 |
},
|
403 |
{
|
404 |
"cell_type": "code",
|
405 |
+
"execution_count": 17,
|
406 |
"id": "4982c3b1-5ce9-4f17-9834-a02c4e136bc2",
|
407 |
"metadata": {},
|
408 |
"outputs": [],
|
|
|
412 |
},
|
413 |
{
|
414 |
"cell_type": "code",
|
415 |
+
"execution_count": 18,
|
416 |
"id": "f6cdee43-33c6-445c-8619-ace20f90638c",
|
417 |
"metadata": {},
|
418 |
"outputs": [],
|
|
|
429 |
},
|
430 |
{
|
431 |
"cell_type": "code",
|
432 |
+
"execution_count": null,
|
433 |
"id": "8f49f871-76f6-4fb2-b2db-c0794d4c07bf",
|
434 |
"metadata": {},
|
435 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
"source": [
|
437 |
"%%time\n",
|
438 |
"df_all_contacts = ddf_all.compute()"
|
|
|
440 |
},
|
441 |
{
|
442 |
"cell_type": "code",
|
443 |
+
"execution_count": null,
|
444 |
"id": "45e4b4fa-6338-4abe-bd6e-8aea46e2a09c",
|
445 |
"metadata": {},
|
446 |
"outputs": [],
|
|
|
450 |
},
|
451 |
{
|
452 |
"cell_type": "code",
|
453 |
+
"execution_count": null,
|
454 |
"id": "7c3db301-6565-4053-bbd4-139bb41dd1c4",
|
455 |
"metadata": {},
|
456 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
"source": [
|
458 |
"from sklearn.preprocessing import StandardScaler\n",
|
459 |
"scaler = StandardScaler()\n",
|
|
|
463 |
},
|
464 |
{
|
465 |
"cell_type": "code",
|
466 |
+
"execution_count": null,
|
467 |
"id": "c9d674bb-d6a2-4810-aa2b-e3bc3b4bbc98",
|
468 |
"metadata": {},
|
469 |
"outputs": [],
|
|
|
475 |
{
|
476 |
"cell_type": "code",
|
477 |
"execution_count": null,
|
478 |
+
"id": "0e532f31-9157-47e9-be82-86c13565f3da",
|
479 |
"metadata": {},
|
480 |
"outputs": [],
|
481 |
"source": []
|
pdbbind.py
CHANGED
@@ -72,7 +72,8 @@ def parse_complex(fn):
|
|
72 |
|
73 |
close_residues = [neighbor_search.search(center=t, level='R', radius=cutoff) for t in token_pos]
|
74 |
first_residue = next(structure.get_residues()).get_id()[1]
|
75 |
-
residue_id = [[c.get_id()[1]-first_residue for c in query
|
|
|
76 |
|
77 |
# contact map
|
78 |
contact_map = np.zeros((max_seq, max_smiles),dtype=np.float32)
|
|
|
72 |
|
73 |
close_residues = [neighbor_search.search(center=t, level='R', radius=cutoff) for t in token_pos]
|
74 |
first_residue = next(structure.get_residues()).get_id()[1]
|
75 |
+
residue_id = [[c.get_id()[1]-first_residue for c in query if not c.get_id()[0].startswith(('H','W'))]
|
76 |
+
for query in close_residues] # zero-based, exclude hetero atoms
|
77 |
|
78 |
# contact map
|
79 |
contact_map = np.zeros((max_seq, max_smiles),dtype=np.float32)
|