NiniCat commited on
Commit
2f35b39
1 Parent(s): 83a2e73

add enzyme buttons

Browse files
Files changed (1) hide show
  1. app.py +14 -6
app.py CHANGED
@@ -10,23 +10,31 @@ ENTRY_METHODS = dict(
10
  )
11
  CRISPR_MODELS = ['Cas9', 'Cas12', 'Cas13d']
12
 
 
 
 
 
13
  selected_model = st.selectbox('Select CRISPR model:', CRISPR_MODELS, key='selected_model')
14
 
15
  # Check if the selected model is Cas9
16
  if selected_model == 'Cas9':
17
- # Display buttons for the Cas9 model
18
- if st.checkbox('SPCas9_U6'):
 
 
19
  # Placeholder for action when SPCas9_U6 is clicked
 
 
20
  pass
21
- if st.checkbox('SPCas9_t7'):
22
  # Placeholder for action when SPCas9_t7 is clicked
 
 
23
  pass
24
- if st.checkbox('eSPCas9'):
25
  # Placeholder for action when eSPCas9 is clicked
 
 
26
  pass
27
- if st.checkbox('SPCas9_HF1'):
28
  # Placeholder for action when SPCas9_HF1 is clicked
29
- pass
30
  elif selected_model == 'Cas12':
31
  # Placeholder for Cas12 model loading
32
  # TODO: Implement Cas12 model loading logic
 
10
  )
11
  CRISPR_MODELS = ['Cas9', 'Cas12', 'Cas13d']
12
 
13
+ # Initialize a session state variable to track checkbox selection
14
+ if 'checkbox_selected' not in st.session_state:
15
+ st.session_state.checkbox_selected = None
16
+
17
  selected_model = st.selectbox('Select CRISPR model:', CRISPR_MODELS, key='selected_model')
18
 
19
  # Check if the selected model is Cas9
20
  if selected_model == 'Cas9':
21
+ # Display checkboxes for the Cas9 model
22
+ if st.checkbox('SPCas9_U6', value=False, disabled=st.session_state.checkbox_selected not in [None, 'SPCas9_U6']):
23
+ st.session_state.checkbox_selected = 'SPCas9_U6'
24
+ pass
25
  # Placeholder for action when SPCas9_U6 is clicked
26
+ elif st.checkbox('SPCas9_t7', value=False, disabled=st.session_state.checkbox_selected not in [None, 'SPCas9_t7']):
27
+ st.session_state.checkbox_selected = 'SPCas9_t7'
28
  pass
 
29
  # Placeholder for action when SPCas9_t7 is clicked
30
+ elif st.checkbox('eSPCas9', value=False, disabled=st.session_state.checkbox_selected not in [None, 'eSPCas9']):
31
+ st.session_state.checkbox_selected = 'eSPCas9'
32
  pass
 
33
  # Placeholder for action when eSPCas9 is clicked
34
+ elif st.checkbox('SPCas9_HF1', value=False, disabled=st.session_state.checkbox_selected not in [None, 'SPCas9_HF1']):
35
+ st.session_state.checkbox_selected = 'SPCas9_HF1'
36
  pass
 
37
  # Placeholder for action when SPCas9_HF1 is clicked
 
38
  elif selected_model == 'Cas12':
39
  # Placeholder for Cas12 model loading
40
  # TODO: Implement Cas12 model loading logic