TillCyrill commited on
Commit
4d3271b
1 Parent(s): 762b539

visualization

Browse files
Files changed (1) hide show
  1. main.py +10 -6
main.py CHANGED
@@ -187,13 +187,17 @@ def predict(pdb_code, pdb_file, topN):
187
  topN_ind = np.argsort(adaptability)[::-1][:topN]
188
 
189
  pdb = open(pdb_file.name, "r").read()
 
190
 
191
-
192
- view = py3Dmol.view(width=600, height=400)
193
  view.setBackgroundColor('white')
194
  view.addModel(pdb, "pdb")
195
- view.setStyle({'stick': {'colorscheme': {'prop': 'resi', 'C': 'turquoise'}}})
196
-
 
 
 
 
197
  # Commenting since the visualizer is not rendered
198
  # view.addLight([0, 0, 10], [1, 1, 1], 1) # Add directional light from the z-axis
199
  # view.setSpecular(0.5) # Adjust the specular lighting effect
@@ -201,7 +205,7 @@ def predict(pdb_code, pdb_file, topN):
201
 
202
  for i in range(topN):
203
  adaptability_value = adaptability[topN_ind[i]]
204
- color = 'orange'
205
  view.addSphere({
206
  'center': {
207
  'x': atoms_protein.iloc[topN_ind[i], atoms_protein.columns.get_loc("x")],
@@ -220,7 +224,7 @@ def predict(pdb_code, pdb_file, topN):
220
 
221
  x = f"""<!DOCTYPE html><html> {output} </html>""" # do not use ' in this input
222
 
223
- return f"""<iframe style="width: 100%; height:420px" name="result" allow="midi; geolocation; microphone; camera;
224
  display-capture; encrypted-media;" sandbox="allow-modals allow-forms
225
  allow-scripts allow-same-origin allow-popups
226
  allow-top-navigation-by-user-activation allow-downloads" allowfullscreen=""
 
187
  topN_ind = np.argsort(adaptability)[::-1][:topN]
188
 
189
  pdb = open(pdb_file.name, "r").read()
190
+ pdb2 = pdb
191
 
192
+ view = py3Dmol.view(width=1000, height=800)
 
193
  view.setBackgroundColor('white')
194
  view.addModel(pdb, "pdb")
195
+ view.setStyle({'stick': {'colorscheme': {'prop': 'resi', 'C': '#cccccc'}},'cartoon': {'color': '#4c4e9e', 'alpha':"0.6"}})
196
+
197
+ #view.addModel(pdb2, "pdb2")
198
+ #view.setStyle({'cartoon': {'color': 'gray'}})
199
+
200
+
201
  # Commenting since the visualizer is not rendered
202
  # view.addLight([0, 0, 10], [1, 1, 1], 1) # Add directional light from the z-axis
203
  # view.setSpecular(0.5) # Adjust the specular lighting effect
 
205
 
206
  for i in range(topN):
207
  adaptability_value = adaptability[topN_ind[i]]
208
+ color = '#a0210f'
209
  view.addSphere({
210
  'center': {
211
  'x': atoms_protein.iloc[topN_ind[i], atoms_protein.columns.get_loc("x")],
 
224
 
225
  x = f"""<!DOCTYPE html><html> {output} </html>""" # do not use ' in this input
226
 
227
+ return f"""<iframe style="width: 100%; height:820px" name="result" allow="midi; geolocation; microphone; camera;
228
  display-capture; encrypted-media;" sandbox="allow-modals allow-forms
229
  allow-scripts allow-same-origin allow-popups
230
  allow-top-navigation-by-user-activation allow-downloads" allowfullscreen=""