Spaces:
Sleeping
Sleeping
Update inference_app.py
Browse files- inference_app.py +4 -2
inference_app.py
CHANGED
@@ -95,14 +95,16 @@ def predict(input_sequence, input_ligand, input_msa, input_protein):
|
|
95 |
mol_coords = mol.GetConformer().GetPositions()
|
96 |
# new_coord = [0, 0, 0]
|
97 |
# new_coord = np.mean(mol_coords, axis=0) + [3.5, 3.5, 3.5]
|
98 |
-
new_coord,
|
|
|
|
|
99 |
|
100 |
output_file = "test_out.pdb"
|
101 |
set_protein_to_new_coord(input_protein, new_coord, output_file)
|
102 |
|
103 |
# return an output pdb file with the protein and ligand with resname LIG or UNK.
|
104 |
# also return any metrics you want to log, metrics will not be used for evaluation but might be useful for users
|
105 |
-
metrics = {"min_dist": min_dist}
|
106 |
|
107 |
end_time = time.time()
|
108 |
run_time = end_time - start_time
|
|
|
95 |
mol_coords = mol.GetConformer().GetPositions()
|
96 |
# new_coord = [0, 0, 0]
|
97 |
# new_coord = np.mean(mol_coords, axis=0) + [3.5, 3.5, 3.5]
|
98 |
+
new_coord, min_dist_sum = optimize_coordinate(mol_coords)
|
99 |
+
# get mindist to protein
|
100 |
+
min_dist = np.min(np.linalg.norm(mol_coords - new_coord, axis=1))
|
101 |
|
102 |
output_file = "test_out.pdb"
|
103 |
set_protein_to_new_coord(input_protein, new_coord, output_file)
|
104 |
|
105 |
# return an output pdb file with the protein and ligand with resname LIG or UNK.
|
106 |
# also return any metrics you want to log, metrics will not be used for evaluation but might be useful for users
|
107 |
+
metrics = {"min_dist": min_dist, "min_dist_sum": min_dist_sum}
|
108 |
|
109 |
end_time = time.time()
|
110 |
run_time = end_time - start_time
|