aksell commited on
Commit
d222aaa
·
1 Parent(s): 42ad7ef

Button to show sidechains for labeled resis

Browse files
hexviz/🧬Attention_Visualization.py CHANGED
@@ -33,6 +33,7 @@ st.sidebar.markdown(
33
  min_attn = st.sidebar.slider("Minimum attention", min_value=0.0, max_value=0.4, value=0.1)
34
  n_highest_resis = st.sidebar.number_input("Num highest attention resis to label", value=2, min_value=1, max_value=100)
35
  label_highest = st.sidebar.checkbox("Label highest attention residues", value=True)
 
36
  # TODO add avg or max attention as params
37
 
38
 
@@ -95,7 +96,9 @@ def get_3dview(pdb):
95
  for _, _, chain, res in top_residues:
96
  xyzview.addResLabels({"chain": chain, "resi": res},
97
  {"backgroundColor": "lightgray", "fontColor": "black", "backgroundOpacity": 0.5})
98
-
 
 
99
  return xyzview
100
 
101
  xyzview = get_3dview(pdb_id)
 
33
  min_attn = st.sidebar.slider("Minimum attention", min_value=0.0, max_value=0.4, value=0.1)
34
  n_highest_resis = st.sidebar.number_input("Num highest attention resis to label", value=2, min_value=1, max_value=100)
35
  label_highest = st.sidebar.checkbox("Label highest attention residues", value=True)
36
+ sidechain_highest = st.sidebar.checkbox("Show sidechains", value=True)
37
  # TODO add avg or max attention as params
38
 
39
 
 
96
  for _, _, chain, res in top_residues:
97
  xyzview.addResLabels({"chain": chain, "resi": res},
98
  {"backgroundColor": "lightgray", "fontColor": "black", "backgroundOpacity": 0.5})
99
+ if sidechain_highest:
100
+ # What color to use?
101
+ xyzview.addStyle({"chain": chain, "resi": res, "elem": "C"},{"stick": {"radius": 0.2}})
102
  return xyzview
103
 
104
  xyzview = get_3dview(pdb_id)