OleinikovasV commited on
Commit
40a2fdf
1 Parent(s): 4a15a26

Update inference_app.py

Browse files
Files changed (1) hide show
  1. inference_app.py +5 -3
inference_app.py CHANGED
@@ -53,7 +53,7 @@ def generate_input_conformer(
53
  return _mol
54
 
55
 
56
- def optimize_coordinate(points, bound_buffer=15, dmin=6.05):
57
  bounds = list(
58
  zip(
59
  np.average(points, axis=0) - [bound_buffer]*3,
@@ -70,7 +70,7 @@ def optimize_coordinate(points, bound_buffer=15, dmin=6.05):
70
  return result.x, result.fun
71
 
72
 
73
- def optimize_decoy_coordinate(points, bound_buffer=15, dmin=6.05, decoy_min=4.0, decoy_max=4.99):
74
  bounds = list(
75
  zip(
76
  np.average(points, axis=0) - [bound_buffer]*3,
@@ -117,7 +117,9 @@ def predict(input_sequence, input_ligand, input_msa, input_protein):
117
  molwriter = Chem.SDWriter("test_docking_pose.sdf")
118
  molwriter.write(mol)
119
 
120
- mol_coords = mol.GetConformer().GetPositions()
 
 
121
  # get opt coords
122
  new_coord, min_dist_sum = optimize_coordinate(mol_coords)
123
  # get mindist to protein
 
53
  return _mol
54
 
55
 
56
+ def optimize_coordinate(points, bound_buffer=15, dmin=6.02):
57
  bounds = list(
58
  zip(
59
  np.average(points, axis=0) - [bound_buffer]*3,
 
70
  return result.x, result.fun
71
 
72
 
73
+ def optimize_decoy_coordinate(points, bound_buffer=15, dmin=6.02, decoy_min=4.0, decoy_max=4.98):
74
  bounds = list(
75
  zip(
76
  np.average(points, axis=0) - [bound_buffer]*3,
 
117
  molwriter = Chem.SDWriter("test_docking_pose.sdf")
118
  molwriter.write(mol)
119
 
120
+ # get only non hydrogen atoms
121
+ heavy_atom_mask = [at.GetAtomicNum() != 1 for at in mol.GetAtoms()]
122
+ mol_coords = mol.GetConformer().GetPositions()[heavy_atom_mask]
123
  # get opt coords
124
  new_coord, min_dist_sum = optimize_coordinate(mol_coords)
125
  # get mindist to protein