Skip to content

Commit a758297

Browse files
committed
prepare for hydroxyl-less monomers
1 parent 8933bc8 commit a758297

File tree

3 files changed

+3
-44
lines changed

3 files changed

+3
-44
lines changed

alphafold3_pytorch/inputs.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -471,21 +471,9 @@ def map_int_or_string_indices_to_mol(
471471
else:
472472
entries = [entries[s] for s in indices]
473473

474-
# for all peptides or nucleotide except last, remove hydroxl
474+
# gather Chem.Mol(s)
475475

476-
mols = []
477-
478-
for idx, entry in enumerate(entries):
479-
is_last = idx == (len(entries) - 1)
480-
481-
mol = entry[mol_keyname]
482-
483-
if chain and not is_last:
484-
# hydroxyl oxygen to be removed should be the last atom
485-
hydroxyl_idx = mol.GetNumAtoms() - 1
486-
mol = remove_atom_from_mol(mol, hydroxyl_idx)
487-
488-
mols.append(mol)
476+
mols = [entry[mol_keyname] for entry in entries]
489477

490478
if not return_entries:
491479
return mols

alphafold3_pytorch/life.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def is_unique(arr):
2626
# template_smile = 'NC(C=O)C',
2727
first_atom_idx = 5,
2828
last_atom_idx = 2,
29-
hydroxyl_idx = 4,
3029
distogram_atom_idx = 1,
3130
token_center_atom_idx = 1,
3231
),
@@ -35,7 +34,6 @@ def is_unique(arr):
3534
# template_smile = 'NC(C=O)CCCNC(N)=N',
3635
first_atom_idx = 6,
3736
last_atom_idx = 3,
38-
hydroxyl_idx = 5,
3937
distogram_atom_idx = 2,
4038
token_center_atom_idx = 2,
4139
),
@@ -44,7 +42,6 @@ def is_unique(arr):
4442
# template_smile = 'NC(C=O)CC(=O)N',
4543
first_atom_idx = 5,
4644
last_atom_idx = 2,
47-
hydroxyl_idx = 4,
4845
distogram_atom_idx = 1,
4946
token_center_atom_idx = 1,
5047
),
@@ -53,7 +50,6 @@ def is_unique(arr):
5350
# template_smile = 'NC(C=O)CC(=O)O',
5451
first_atom_idx = 5,
5552
last_atom_idx = 2,
56-
hydroxyl_idx = 8,
5753
distogram_atom_idx = 1,
5854
token_center_atom_idx = 1,
5955
),
@@ -62,7 +58,6 @@ def is_unique(arr):
6258
# template_smile = 'NC(C=O)CS',
6359
first_atom_idx = 5,
6460
last_atom_idx = 2,
65-
hydroxyl_idx = 4,
6661
distogram_atom_idx = 1,
6762
token_center_atom_idx = 1,
6863
),
@@ -71,7 +66,6 @@ def is_unique(arr):
7166
# template_smile = 'NC(C=O)CCC(=O)N',
7267
first_atom_idx = 9,
7368
last_atom_idx = 6,
74-
hydroxyl_idx = 8,
7569
distogram_atom_idx = 5,
7670
token_center_atom_idx = 5,
7771
),
@@ -80,7 +74,6 @@ def is_unique(arr):
8074
# template_smile = 'NC(C=O)CCC(=O)O',
8175
first_atom_idx = 9,
8276
last_atom_idx = 6,
83-
hydroxyl_idx = 8,
8477
distogram_atom_idx = 5,
8578
token_center_atom_idx = 5,
8679
),
@@ -89,7 +82,6 @@ def is_unique(arr):
8982
# template_smile = 'NCC=O',
9083
first_atom_idx = 4,
9184
last_atom_idx = 1,
92-
hydroxyl_idx = 3,
9385
distogram_atom_idx = 0,
9486
token_center_atom_idx = 0,
9587
),
@@ -98,7 +90,6 @@ def is_unique(arr):
9890
# template_smile = 'NC(C=O)CC1=CNC=N1',
9991
first_atom_idx = 10,
10092
last_atom_idx = 7,
101-
hydroxyl_idx = 9,
10293
distogram_atom_idx = 0,
10394
token_center_atom_idx = 0,
10495
),
@@ -107,7 +98,6 @@ def is_unique(arr):
10798
# template_smile = 'NC(C=O)C(CC)C',
10899
first_atom_idx = 8,
109100
last_atom_idx = 5,
110-
hydroxyl_idx = 7,
111101
distogram_atom_idx = 0,
112102
token_center_atom_idx = 0,
113103
),
@@ -116,7 +106,6 @@ def is_unique(arr):
116106
# template_smile = 'NC(C=O)CC(C)C',
117107
first_atom_idx = 8,
118108
last_atom_idx = 5,
119-
hydroxyl_idx = 7,
120109
distogram_atom_idx = 4,
121110
token_center_atom_idx = 4,
122111
),
@@ -125,7 +114,6 @@ def is_unique(arr):
125114
# template_smile = 'NC(C=O)CCCCN',
126115
first_atom_idx = 9,
127116
last_atom_idx = 6,
128-
hydroxyl_idx = 8,
129117
distogram_atom_idx = 5,
130118
token_center_atom_idx = 5,
131119
),
@@ -134,7 +122,6 @@ def is_unique(arr):
134122
# template_smile = 'NC(C=O)CCSC',
135123
first_atom_idx = 8,
136124
last_atom_idx = 5,
137-
hydroxyl_idx = 7,
138125
distogram_atom_idx = 4,
139126
token_center_atom_idx = 4,
140127
),
@@ -143,7 +130,6 @@ def is_unique(arr):
143130
# template_smile = 'NC(C=O)CC1=CC=CC=C1',
144131
first_atom_idx = 11,
145132
last_atom_idx = 8,
146-
hydroxyl_idx = 10,
147133
distogram_atom_idx = 7,
148134
token_center_atom_idx = 7,
149135
),
@@ -152,7 +138,6 @@ def is_unique(arr):
152138
# template_smile = 'N1C(C=O)CCC1',
153139
first_atom_idx = 3,
154140
last_atom_idx = 5,
155-
hydroxyl_idx = 7,
156141
distogram_atom_idx = 2,
157142
token_center_atom_idx = 2,
158143
),
@@ -161,7 +146,6 @@ def is_unique(arr):
161146
# template_smile = 'NC(C=O)CO',
162147
first_atom_idx = 5,
163148
last_atom_idx = 2,
164-
hydroxyl_idx = 4,
165149
distogram_atom_idx = 1,
166150
token_center_atom_idx = 1,
167151
),
@@ -170,7 +154,6 @@ def is_unique(arr):
170154
# template_smile = 'NC(C=O)C(O)C',
171155
first_atom_idx = 6,
172156
last_atom_idx = 3,
173-
hydroxyl_idx = 5,
174157
distogram_atom_idx = 2,
175158
token_center_atom_idx = 2,
176159
),
@@ -179,7 +162,6 @@ def is_unique(arr):
179162
# template_smile = 'NC(C=O)CC1=CNC2=C1C=CC=C2',
180163
first_atom_idx = 14,
181164
last_atom_idx = 11,
182-
hydroxyl_idx = 13,
183165
distogram_atom_idx = 10,
184166
token_center_atom_idx = 10,
185167
),
@@ -188,7 +170,6 @@ def is_unique(arr):
188170
# template_smile = 'NC(C=O)CC1=CC=C(O)C=C1',
189171
first_atom_idx = 11,
190172
last_atom_idx = 8,
191-
hydroxyl_idx = 10,
192173
distogram_atom_idx = 7,
193174
token_center_atom_idx = 7,
194175
),
@@ -197,7 +178,6 @@ def is_unique(arr):
197178
# template_smile = 'NC(C=O)C(C)C',
198179
first_atom_idx = 7,
199180
last_atom_idx = 4,
200-
hydroxyl_idx = 6,
201181
distogram_atom_idx = 3,
202182
token_center_atom_idx = 3,
203183
)
@@ -213,7 +193,6 @@ def is_unique(arr):
213193
complement = 'T',
214194
first_atom_idx = 20,
215195
last_atom_idx = 1,
216-
hydroxyl_idx = 21,
217196
distogram_atom_idx = 4,
218197
token_center_atom_idx = 4,
219198
),
@@ -223,7 +202,6 @@ def is_unique(arr):
223202
complement = 'G',
224203
first_atom_idx = 17,
225204
last_atom_idx = 1,
226-
hydroxyl_idx = 19,
227205
distogram_atom_idx = 4,
228206
token_center_atom_idx = 4,
229207
),
@@ -233,7 +211,6 @@ def is_unique(arr):
233211
complement = 'C',
234212
first_atom_idx = 21,
235213
last_atom_idx = 1,
236-
hydroxyl_idx = 22,
237214
distogram_atom_idx = 4,
238215
token_center_atom_idx = 4,
239216
),
@@ -243,7 +220,6 @@ def is_unique(arr):
243220
complement = 'A',
244221
first_atom_idx = 19,
245222
last_atom_idx = 11,
246-
hydroxyl_idx = 20,
247223
distogram_atom_idx = 9,
248224
token_center_atom_idx = 8,
249225
)
@@ -256,7 +232,6 @@ def is_unique(arr):
256232
complement = 'U',
257233
first_atom_idx = 19,
258234
last_atom_idx = 11,
259-
hydroxyl_idx = 20,
260235
distogram_atom_idx = 9,
261236
token_center_atom_idx = 9,
262237
),
@@ -266,7 +241,6 @@ def is_unique(arr):
266241
complement = 'G',
267242
first_atom_idx = 17,
268243
last_atom_idx = 10,
269-
hydroxyl_idx = 19,
270244
distogram_atom_idx = 8,
271245
token_center_atom_idx = 8,
272246
),
@@ -276,7 +250,6 @@ def is_unique(arr):
276250
complement = 'C',
277251
first_atom_idx = 14,
278252
last_atom_idx = 7,
279-
hydroxyl_idx = 16,
280253
distogram_atom_idx = 5,
281254
token_center_atom_idx = 5,
282255
),
@@ -286,7 +259,6 @@ def is_unique(arr):
286259
complement = 'A',
287260
first_atom_idx = 18,
288261
last_atom_idx = 10,
289-
hydroxyl_idx = 19,
290262
distogram_atom_idx = 8,
291263
token_center_atom_idx = 8,
292264
)
@@ -549,7 +521,6 @@ def mol_from_template_mmcif_file(
549521

550522
atom_order[entry['first_atom_idx']] = -1
551523
atom_order[entry['last_atom_idx']] = 1e4
552-
atom_order[entry['hydroxyl_idx']] = 1e4 + 1
553524

554525
atom_reorder = atom_order.argsort()
555526

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "alphafold3-pytorch"
3-
version = "0.1.118"
3+
version = "0.1.120"
44
description = "Alphafold 3 - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "[email protected]" }

0 commit comments

Comments
 (0)