Skip to content

Commit bdeab96

Browse files
committed
fix index for linking to terminal atom of previous biomolecule in chain
1 parent 7f6308a commit bdeab96

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

alphafold3_pytorch/alphafold3.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from functools import partial, wraps
66
from collections import namedtuple
77

8-
import einops
98
import torch
109
from torch import nn
1110
from torch import Tensor

alphafold3_pytorch/inputs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,10 @@ def molecule_to_atom_input(
362362
_, last_atom_index = prev_src_tgt_atom_indices
363363
first_atom_index, _ = src_tgt_atom_indices
364364

365-
src_atom_offset = offset + first_atom_index
366-
tgt_atom_offset = offset - last_atom_index
365+
last_atom_index_from_end = prev_mol.GetNumAtoms() - last_atom_index
366+
367+
src_atom_offset = offset - last_atom_index_from_end
368+
tgt_atom_offset = offset + first_atom_index
367369

368370
atompair_ids[src_atom_offset, tgt_atom_offset] = 1
369371
atompair_ids[tgt_atom_offset, src_atom_offset] = 1
@@ -671,8 +673,6 @@ def alphafold3_input_to_molecule_input(
671673
*metal_ions_pool_lens
672674
]
673675

674-
total_atoms = sum(token_pool_lens)
675-
676676
# construct the token bonds
677677

678678
# will be linearly connected for proteins and nucleic acids

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

0 commit comments

Comments
 (0)