Spaces:
Running
Running
simonduerr
commited on
Commit
•
fd32c9f
1
Parent(s):
3fcf73d
Update inference_app.py
Browse files- inference_app.py +16 -15
inference_app.py
CHANGED
@@ -11,7 +11,7 @@ from gradio_molecule3d import Molecule3D
|
|
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
|
15 |
end_time = time.time()
|
16 |
run_time = end_time - start_time
|
17 |
return "test_out.pdb", run_time
|
@@ -22,9 +22,13 @@ with gr.Blocks() as app:
|
|
22 |
|
23 |
gr.Markdown("Title, description, and other information about the model")
|
24 |
with gr.Row():
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
28 |
|
29 |
|
30 |
# define any options here
|
@@ -39,9 +43,11 @@ with gr.Blocks() as app:
|
|
39 |
gr.Examples(
|
40 |
[
|
41 |
[
|
42 |
-
"
|
43 |
-
"
|
44 |
-
"
|
|
|
|
|
45 |
],
|
46 |
],
|
47 |
[input_sequence, input_ligand],
|
@@ -50,17 +56,12 @@ with gr.Blocks() as app:
|
|
50 |
{
|
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": 0,
|
63 |
-
"
|
64 |
"style": "stick",
|
65 |
"color": "greenCarbon",
|
66 |
}
|
@@ -70,6 +71,6 @@ with gr.Blocks() as app:
|
|
70 |
out = Molecule3D(reps=reps)
|
71 |
run_time = gr.Textbox(label="Runtime")
|
72 |
|
73 |
-
btn.click(predict, inputs=[
|
74 |
|
75 |
app.launch()
|
|
|
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 two chains A and B.
|
15 |
end_time = time.time()
|
16 |
run_time = end_time - start_time
|
17 |
return "test_out.pdb", run_time
|
|
|
22 |
|
23 |
gr.Markdown("Title, description, and other information about the model")
|
24 |
with gr.Row():
|
25 |
+
with gr.Column():
|
26 |
+
input_seq_1 = gr.Textbox(lines=3, label="Input Protein 1 sequence (FASTA)")
|
27 |
+
input_protein_1 = gr.File(label="Input Protein 2 monomer (PDB)")
|
28 |
+
with gr.Column():
|
29 |
+
input_seq_2 = gr.Textbox(lines=3, label="Input Protein 1 sequence (FASTA)")
|
30 |
+
input_protein_2 = gr.File(label="Input Protein 2 structure (PDB)")
|
31 |
+
|
32 |
|
33 |
|
34 |
# define any options here
|
|
|
43 |
gr.Examples(
|
44 |
[
|
45 |
[
|
46 |
+
"GSGSPLAQQIKNIHSFIHQAKAAGRMDEVRTLQENLHQLMHEYFQQSD",
|
47 |
+
"3v1c_A.pdb",
|
48 |
+
"GSGSPLAQQIKNIHSFIHQAKAAGRMDEVRTLQENLHQLMHEYFQQSD",
|
49 |
+
"3v1c_B.pdb",
|
50 |
+
|
51 |
],
|
52 |
],
|
53 |
[input_sequence, input_ligand],
|
|
|
56 |
{
|
57 |
"model": 0,
|
58 |
"style": "cartoon",
|
59 |
+
"chain": "A",
|
60 |
"color": "whiteCarbon",
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
},
|
62 |
{
|
63 |
"model": 0,
|
64 |
+
"chain": "B",
|
65 |
"style": "stick",
|
66 |
"color": "greenCarbon",
|
67 |
}
|
|
|
71 |
out = Molecule3D(reps=reps)
|
72 |
run_time = gr.Textbox(label="Runtime")
|
73 |
|
74 |
+
btn.click(predict, inputs=[input_seq_1, input_protein_1, input_seq_2, input_protein_2], outputs=[out, run_time])
|
75 |
|
76 |
app.launch()
|