Skip to content

Commit faba753

Browse files
authored
Update inputs.py (#196)
1 parent d174bee commit faba753

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

alphafold3_pytorch/inputs.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,9 +3160,7 @@ def pdb_input_to_molecule_input(
31603160

31613161
# handle `atom_indices_for_frame` for the PAE
31623162

3163-
atom_indices_for_frame = tensor(
3164-
[default(indices, (-1, -1, -1)) for indices in atom_indices_for_frame]
3165-
)
3163+
atom_indices_for_frame = tensor(atom_indices_for_frame)
31663164

31673165
# build offsets for all indices
31683166

@@ -3199,6 +3197,12 @@ def pdb_input_to_molecule_input(
31993197
# craft ligand frame offsets
32003198
atom_indices_for_ligand_frame = torch.zeros_like(atom_indices_for_frame)
32013199
for ligand_frame_index in torch.where(is_ligand_frame)[0]:
3200+
if (atom_indices_for_frame[ligand_frame_index] == -1).any():
3201+
atom_indices_for_ligand_frame[ligand_frame_index] = atom_indices_for_frame[
3202+
ligand_frame_index
3203+
]
3204+
continue
3205+
32023206
global_atom_indices = torch.gather(
32033207
atom_indices_offsets, 0, atom_indices_for_frame[ligand_frame_index]
32043208
)

0 commit comments

Comments
 (0)