Simon Dürr commited on
Commit
28cb117
1 Parent(s): f095f6c

add sample output

Browse files
Files changed (2) hide show
  1. inference_app.py +40 -3
  2. test_out.pdb +0 -0
inference_app.py CHANGED
@@ -6,13 +6,15 @@ import gradio as gr
6
  from gradio_molecule3d import Molecule3D
7
 
8
 
 
 
9
  def predict (input_sequence, input_ligand):
10
  start_time = time.time()
11
  # Do inference here
12
  # return an output directory
13
  end_time = time.time()
14
  run_time = end_time - start_time
15
- return None, run_time
16
 
17
  with gr.Blocks() as app:
18
 
@@ -25,13 +27,48 @@ with gr.Blocks() as app:
25
 
26
  # define any options here
27
 
28
- # the final for inference should be the default options
29
  # slider_option = gr.Slider(0,10, label="Slider Option")
30
  # checkbox_option = gr.Checkbox(label="Checkbox Option")
31
  # dropdown_option = gr.Dropdown(["Option 1", "Option 2", "Option 3"], label="Radio Option")
32
 
33
  btn = gr.Button("Run Inference")
34
- out = Molecule3D()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  run_time = gr.Textbox(label="Runtime")
36
 
37
  btn.click(predict, inputs=[input_sequence, input_ligand], outputs=[out, run_time])
 
6
  from gradio_molecule3d import Molecule3D
7
 
8
 
9
+
10
+
11
  def predict (input_sequence, input_ligand):
12
  start_time = time.time()
13
  # Do inference here
14
  # return an output directory
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
 
 
27
 
28
  # define any options here
29
 
30
+ # for automated inference the default options are used
31
  # slider_option = gr.Slider(0,10, label="Slider Option")
32
  # checkbox_option = gr.Checkbox(label="Checkbox Option")
33
  # dropdown_option = gr.Dropdown(["Option 1", "Option 2", "Option 3"], label="Radio Option")
34
 
35
  btn = gr.Button("Run Inference")
36
+
37
+ gr.Examples(
38
+ [
39
+ [
40
+ "SVKSEYAEAAAVGQEAVAVFNTMKAAFQNGDKEAVAQYLARLASLYTRHEELLNRILEKARREGNKEAVTLMNEFTATFQTGKSIFNAMVAAFKNGDDDSFESYLQALEKVTAKGETLADQIAKAL:SVKSEYAEAAAVGQEAVAVFNTMKAAFQNGDKEAVAQYLARLASLYTRHEELLNRILEKARREGNKEAVTLMNEFTATFQTGKSIFNAMVAAFKNGDDDSFESYLQALEKVTAKGETLADQIAKAL"
41
+ "COc1ccc(cc1)n2c3c(c(n2)C(=O)N)CCN(C3=O)c4ccc(cc4)N5CCCCC5=O",
42
+ ],
43
+ ],
44
+ [input_sequence, input_ligand],
45
+ )
46
+ reps = [
47
+ {
48
+ "model": 0,
49
+ "chain": "",
50
+ "resname": "",
51
+ "style": "cartoon",
52
+ "color": "whiteCarbon",
53
+ "residue_range": "",
54
+ "around": 0,
55
+ "byres": False,
56
+ "visible": False
57
+ },
58
+ {
59
+ "model": 1,
60
+ "chain": "",
61
+ "resname": "",
62
+ "style": "stick",
63
+ "color": "greenCarbon",
64
+ "residue_range": "",
65
+ "around": 0,
66
+ "byres": False,
67
+ "visible": False
68
+ }
69
+ ]
70
+
71
+ out = Molecule3D(reps=reps)
72
  run_time = gr.Textbox(label="Runtime")
73
 
74
  btn.click(predict, inputs=[input_sequence, input_ligand], outputs=[out, run_time])
test_out.pdb ADDED
The diff for this file is too large to render. See raw diff