Skip to content

Commit

Permalink
Fix runtime error for protein-flexible relaxation
Browse files Browse the repository at this point in the history
  • Loading branch information
amorehead committed Jul 6, 2024
1 parent 5138278 commit 887950a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/models/minimize_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from __future__ import annotations

import copy
import logging
import os
import shutil
Expand Down Expand Up @@ -542,12 +543,12 @@ def compute_ligand_local_geometry_violations(
ref_ligand_atom_coords, local_geometry_mask = get_all_ligand_non_hydrogen_atoms(
ref_input_sdf_filepath,
input_sdf_filepath,
ref_mol=ligand_frag,
ref_mol=copy.deepcopy(ligand_frag),
)
ligand_atom_coords, _ = get_all_ligand_non_hydrogen_atoms(
input_sdf_filepath,
ref_input_sdf_filepath,
input_mol=ligand_frag,
input_mol=copy.deepcopy(ligand_frag),
)
assert len(ref_ligand_atom_coords) == len(
ligand_atom_coords
Expand Down Expand Up @@ -1302,7 +1303,7 @@ def minimize_energy(cfg: DictConfig):

# measure initial protein violations
protein_score, violation_residue_idx = compute_protein_local_geometry_violations(
temp_protein_file_path
str(temp_protein_file_path)
)
num_attempts = 0
while (
Expand Down Expand Up @@ -1341,7 +1342,7 @@ def minimize_energy(cfg: DictConfig):
shutil.copyfile(protein_output_file_path, temp_protein_file_path)
# measure subsequent protein violations
protein_score, violation_residue_idx = compute_protein_local_geometry_violations(
temp_protein_file_path
str(temp_protein_file_path)
)
# measure final ligand violations
ligand_score = compute_ligand_local_geometry_violations(
Expand Down

0 comments on commit 887950a

Please sign in to comment.