Spaces:
Runtime error
Runtime error
Update inference_app.py
Browse files- inference_app.py +6 -11
inference_app.py
CHANGED
|
@@ -8,13 +8,13 @@ from gradio_molecule3d import Molecule3D
|
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
-
def predict (input_sequence, input_ligand, input_protein):
|
| 12 |
start_time = time.time()
|
| 13 |
# Do inference here
|
| 14 |
# return an output pdb file with the protein and ligand with resname LIG or UNK.
|
| 15 |
end_time = time.time()
|
| 16 |
run_time = end_time - start_time
|
| 17 |
-
return "test_out.pdb", run_time
|
| 18 |
|
| 19 |
with gr.Blocks() as app:
|
| 20 |
|
|
@@ -24,6 +24,8 @@ with gr.Blocks() as app:
|
|
| 24 |
with gr.Row():
|
| 25 |
input_sequence = gr.Textbox(lines=3, label="Input Protein sequence (FASTA)")
|
| 26 |
input_ligand = gr.Textbox(lines=3, label="Input ligand SMILES")
|
|
|
|
|
|
|
| 27 |
input_protein = gr.File(label="Input protein monomer")
|
| 28 |
|
| 29 |
|
|
@@ -51,16 +53,9 @@ with gr.Blocks() as app:
|
|
| 51 |
"model": 0,
|
| 52 |
"style": "cartoon",
|
| 53 |
"color": "whiteCarbon",
|
| 54 |
-
},
|
| 55 |
-
{
|
| 56 |
-
"model": 0,
|
| 57 |
-
"resname": "UNK",
|
| 58 |
-
"style": "stick",
|
| 59 |
-
"color": "greenCarbon",
|
| 60 |
},
|
| 61 |
{
|
| 62 |
-
"model":
|
| 63 |
-
"resname": "LIG",
|
| 64 |
"style": "stick",
|
| 65 |
"color": "greenCarbon",
|
| 66 |
}
|
|
@@ -70,6 +65,6 @@ with gr.Blocks() as app:
|
|
| 70 |
out = Molecule3D(reps=reps)
|
| 71 |
run_time = gr.Textbox(label="Runtime")
|
| 72 |
|
| 73 |
-
btn.click(predict, inputs=[input_sequence, input_ligand, input_protein], outputs=[out, run_time])
|
| 74 |
|
| 75 |
app.launch()
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
+
def predict (input_sequence, input_ligand,input_msa, input_protein):
|
| 12 |
start_time = time.time()
|
| 13 |
# Do inference here
|
| 14 |
# return an output pdb file with the protein and ligand with resname LIG or UNK.
|
| 15 |
end_time = time.time()
|
| 16 |
run_time = end_time - start_time
|
| 17 |
+
return ["test_out.pdb", "test_docking_pose.sdf"], run_time
|
| 18 |
|
| 19 |
with gr.Blocks() as app:
|
| 20 |
|
|
|
|
| 24 |
with gr.Row():
|
| 25 |
input_sequence = gr.Textbox(lines=3, label="Input Protein sequence (FASTA)")
|
| 26 |
input_ligand = gr.Textbox(lines=3, label="Input ligand SMILES")
|
| 27 |
+
with gr.Row():
|
| 28 |
+
input_msa = gr.File(label="Input Protein MSA (FASTA)")
|
| 29 |
input_protein = gr.File(label="Input protein monomer")
|
| 30 |
|
| 31 |
|
|
|
|
| 53 |
"model": 0,
|
| 54 |
"style": "cartoon",
|
| 55 |
"color": "whiteCarbon",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
},
|
| 57 |
{
|
| 58 |
+
"model": 1,
|
|
|
|
| 59 |
"style": "stick",
|
| 60 |
"color": "greenCarbon",
|
| 61 |
}
|
|
|
|
| 65 |
out = Molecule3D(reps=reps)
|
| 66 |
run_time = gr.Textbox(label="Runtime")
|
| 67 |
|
| 68 |
+
btn.click(predict, inputs=[input_sequence, input_ligand, input_msa, input_protein], outputs=[out, run_time])
|
| 69 |
|
| 70 |
app.launch()
|