Spaces:
Sleeping
Sleeping
Update inference_app.py
Browse files- inference_app.py +8 -7
inference_app.py
CHANGED
@@ -60,15 +60,16 @@ def set_protein_to_new_coord(input_pdb_file, new_coord, output_file):
|
|
60 |
file.write(output_file)
|
61 |
|
62 |
|
63 |
-
def predict
|
64 |
start_time = time.time()
|
65 |
|
66 |
# Do inference here
|
67 |
mol = generate_input_conformer(input_ligand, minimize_maxIters=100)
|
68 |
-
with Chem.SDWriter("test_docking_pose.sdf") as writer:
|
69 |
-
writer.write(mol)
|
70 |
-
mol_coords = mol.GetConformer().GetPositions()
|
71 |
|
|
|
|
|
|
|
|
|
72 |
# new_coord = [0, 0, 0]
|
73 |
new_coord = np.mean(mol_coords, axis=1)
|
74 |
output_file = "test_out.pdb"
|
@@ -108,9 +109,9 @@ with gr.Blocks() as app:
|
|
108 |
gr.Examples(
|
109 |
[
|
110 |
[
|
111 |
-
|
112 |
"COc1ccc(cc1)n2c3c(c(n2)C(=O)N)CCN(C3=O)c4ccc(cc4)N5CCCCC5=O",
|
113 |
-
|
114 |
"test_out.pdb"
|
115 |
],
|
116 |
],
|
@@ -134,6 +135,6 @@ with gr.Blocks() as app:
|
|
134 |
metrics = gr.JSON(label="Metrics")
|
135 |
run_time = gr.Textbox(label="Runtime")
|
136 |
|
137 |
-
btn.click(predict, inputs=[input_sequence, input_ligand, input_msa, input_protein], outputs=[out,metrics, run_time])
|
138 |
|
139 |
app.launch()
|
|
|
60 |
file.write(output_file)
|
61 |
|
62 |
|
63 |
+
def predict(input_sequence, input_ligand, input_msa, input_protein):
|
64 |
start_time = time.time()
|
65 |
|
66 |
# Do inference here
|
67 |
mol = generate_input_conformer(input_ligand, minimize_maxIters=100)
|
|
|
|
|
|
|
68 |
|
69 |
+
molwriter = Chem.SDWriter("test_docking_pose.sdf")
|
70 |
+
molwriter.write(mol)
|
71 |
+
|
72 |
+
mol_coords = mol.GetConformer().GetPositions()
|
73 |
# new_coord = [0, 0, 0]
|
74 |
new_coord = np.mean(mol_coords, axis=1)
|
75 |
output_file = "test_out.pdb"
|
|
|
109 |
gr.Examples(
|
110 |
[
|
111 |
[
|
112 |
+
"",
|
113 |
"COc1ccc(cc1)n2c3c(c(n2)C(=O)N)CCN(C3=O)c4ccc(cc4)N5CCCCC5=O",
|
114 |
+
"",
|
115 |
"test_out.pdb"
|
116 |
],
|
117 |
],
|
|
|
135 |
metrics = gr.JSON(label="Metrics")
|
136 |
run_time = gr.Textbox(label="Runtime")
|
137 |
|
138 |
+
btn.click(predict, inputs=[input_sequence, input_ligand, input_msa, input_protein], outputs=[out, metrics, run_time])
|
139 |
|
140 |
app.launch()
|