added model from pdb_string

#1
by napoles3d - opened
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -13,12 +13,17 @@ response = requests.post('https://api.esmatlas.com/foldSequence/v1/pdb/', header
13
  name = sequence[:3] + sequence[-3:]
14
  pdb_filename = "test.pdb"
15
  pdb_string = response.content.decode('utf-8')
16
- with open(pdb_filename, "w") as out:
17
- out.write(pdb_string)
18
- print(pdb_string)
19
 
20
- xyzview = py3Dmol.view(js='https://3dmol.org/build/3Dmol.js', width=800, height=400)
21
- xyzview.addModel(pdb_filename, "pdb")
 
 
 
 
 
22
  print("Set style")
23
  showmol(xyzview, height = 500,width=800)
24
  print("Displayed")
 
13
  name = sequence[:3] + sequence[-3:]
14
  pdb_filename = "test.pdb"
15
  pdb_string = response.content.decode('utf-8')
16
+ #with open(pdb_filename, "w") as out:
17
+ # out.write(pdb_string)
18
+ # print(pdb_string)
19
 
20
+ #xyzview = py3Dmol.view(js='https://3dmol.org/build/3Dmol.js', width=800, height=400)
21
+ xyzview = py3Dmol.view()
22
+ #xyzview.addModel(pdb_filename, "pdb")
23
+ xyzview.addModel(pdb_string,'pdb')
24
+ xyzview.setStyle({'cartoon':{
25
+ "color": "spectrum",}})
26
+ xyzview.zoomTo()
27
  print("Set style")
28
  showmol(xyzview, height = 500,width=800)
29
  print("Displayed")