aksell commited on
Commit
739d26f
·
1 Parent(s): a2eb24d

Allow changing viewer width

Browse files
hexviz/pages/3_🏗️Test:_Birds_Eye_View.py CHANGED
@@ -46,6 +46,14 @@ with st.expander("Input a PDB id, upload a PDB file or input a sequence", expand
46
  selected_model = select_model(models)
47
 
48
 
 
 
 
 
 
 
 
 
49
  chains = list(structure.get_chains())
50
  chain_ids = [chain.id for chain in chains]
51
  if "selected_chain" not in st.session_state:
@@ -105,7 +113,6 @@ attention, tokens = get_attention(
105
 
106
  grid_rows = len(layer_sequence)
107
  grid_cols = len(head_sequence)
108
- viewer_width = 1200
109
  cell_width = viewer_width / grid_cols
110
  viewer_height = int(cell_width * grid_rows)
111
 
 
46
  selected_model = select_model(models)
47
 
48
 
49
+ if "viewer_width" not in st.session_state:
50
+ st.session_state.viewer_width = 1200
51
+ viewer_width = st.sidebar.number_input(
52
+ label="Protein viewer width (px)",
53
+ min_value=0,
54
+ key="viewer_width",
55
+ )
56
+
57
  chains = list(structure.get_chains())
58
  chain_ids = [chain.id for chain in chains]
59
  if "selected_chain" not in st.session_state:
 
113
 
114
  grid_rows = len(layer_sequence)
115
  grid_cols = len(head_sequence)
 
116
  cell_width = viewer_width / grid_cols
117
  viewer_height = int(cell_width * grid_rows)
118