Skip to content

Commit 1670065

Browse files
committed
remove all atom reordering stuff from life.py and add an assert on the indices
1 parent 30c76e9 commit 1670065

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

alphafold3_pytorch/life.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -511,22 +511,10 @@ def mol_from_template_mmcif_file(
511511
mol = mol_from_smile(entry['smile'])
512512
entry['rdchem_mol'] = mol
513513

514-
# reorder all the chainable biomolecules
515-
# to simplify chaining them up and specifying the peptide or phosphodiesterase bonds
516-
517514
for entry in CHAINABLE_BIOMOLECULES:
518-
mol = entry['rdchem_mol']
519-
520-
atom_order = torch.arange(mol.GetNumAtoms())
521-
522-
atom_order[entry['first_atom_idx']] = -1
523-
atom_order[entry['last_atom_idx']] = 1e4
515+
num_atoms = mol.GetNumAtoms()
524516

525-
atom_reorder = atom_order.argsort()
526-
527-
mol = Chem.RenumberAtoms(mol, atom_reorder.tolist())
528-
529-
entry.update(
530-
atom_reorder_indices = atom_reorder,
531-
rdchem_mol = mol
532-
)
517+
assert 0 <= entry['distogram_atom_idx'] < num_atoms
518+
assert 0 <= entry['first_atom_idx'] < num_atoms
519+
assert 0 <= entry['last_atom_idx'] < num_atoms
520+
assert 0 <= entry['token_center_atom_idx'] < num_atoms

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.122"
3+
version = "0.1.123"
44
description = "Alphafold 3 - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "[email protected]" }

0 commit comments

Comments
 (0)