simonduerr commited on
Commit
2aa230e
1 Parent(s): 2596c41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -35,9 +35,29 @@ def predict(x):
35
 
36
  #works
37
  with gr.Blocks() as demo:
38
- inp = Molecule3D("demo/1pga.pdb",label="Molecule3D", reps=reps)
39
- inp = Molecule3D("demo/1pga.pdb",label="Molecule3D", reps=reps, showviewer=False)
 
 
40
  out = Molecule3D(label="Molecule3D", reps=reps)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  btn = gr.Button("Predict")
42
  btn.click(predict, inputs=inp, outputs=out)
43
 
 
35
 
36
  #works
37
  with gr.Blocks() as demo:
38
+ gr.Markdown("# 3dmol.js Molecule Viewer")
39
+ inp = Molecule3D("1pga.pdb",label="Molecule3D", reps=reps)
40
+ gr.Markdown("Viewer disabled")
41
+ inp = Molecule3D("1pga.pdb",label="Molecule3D", reps=reps, showviewer=False)
42
  out = Molecule3D(label="Molecule3D", reps=reps)
43
+ gr.Markdown("""
44
+ You can configure the default rendering of the molecule by adding a list of representations
45
+ <code>
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
+ </code>
60
+ """)
61
  btn = gr.Button("Predict")
62
  btn.click(predict, inputs=inp, outputs=out)
63