NiniCat commited on
Commit
aaf258e
1 Parent(s): 91923eb

add enzyme buttons

Browse files
Files changed (1) hide show
  1. app.py +11 -14
app.py CHANGED
@@ -4,15 +4,15 @@ import pandas as pd
4
  import streamlit as st
5
  from pathlib import Path
6
 
7
- ENTRY_METHODS = dict(
8
- manual='Manual entry of single transcript',
9
- fasta="Fasta file upload (supports multiple transcripts if they have unique ID's)"
10
- )
11
- CRISPR_MODELS = ['Cas9', 'Cas12', 'Cas13d']
12
 
 
13
 
14
  selected_model = st.selectbox('Select CRISPR model:', CRISPR_MODELS, key='selected_model')
15
 
 
16
  # Check if the selected model is Cas9
17
  if selected_model == 'Cas9':
18
  # Boolean variables for each checkbox state
@@ -20,26 +20,27 @@ if selected_model == 'Cas9':
20
  spcas9_t7 = st.checkbox('SPCas9_t7', key='spcas9_t7')
21
  esp_cas9 = st.checkbox('eSPCas9', key='esp_cas9')
22
  spcas9_hf1 = st.checkbox('SPCas9_HF1', key='spcas9_hf1')
23
- # Display checkboxes for the Cas9 model
24
- if st.checkbox('SPCas9_U6', value=False, disabled=st.session_state.checkbox_selected not in [None, 'SPCas9_U6']):
 
25
  st.session_state['spcas9_t7'] = False
26
  st.session_state['esp_cas9'] = False
27
  st.session_state['spcas9_hf1'] = False
28
  pass
29
  # Placeholder for action when SPCas9_U6 is clicked
30
- elif st.checkbox('SPCas9_t7', value=False, disabled=st.session_state.checkbox_selected not in [None, 'SPCas9_t7']):
31
  st.session_state['spcas9_u6'] = False
32
  st.session_state['esp_cas9'] = False
33
  st.session_state['spcas9_hf1'] = False
34
  pass
35
  # Placeholder for action when SPCas9_t7 is clicked
36
- elif st.checkbox('eSPCas9', value=False, disabled=st.session_state.checkbox_selected not in [None, 'eSPCas9']):
37
  st.session_state['spcas9_u6'] = False
38
  st.session_state['spcas9_t7'] = False
39
  st.session_state['spcas9_hf1'] = False
40
  pass
41
  # Placeholder for action when eSPCas9 is clicked
42
- elif st.checkbox('SPCas9_HF1', value=False, disabled=st.session_state.checkbox_selected not in [None, 'SPCas9_HF1']):
43
  st.session_state['spcas9_u6'] = False
44
  st.session_state['spcas9_t7'] = False
45
  st.session_state['esp_cas9'] = False
@@ -141,10 +142,6 @@ elif selected_model == 'Cas13d':
141
  if 'off_target' not in st.session_state:
142
  st.session_state.off_target = None
143
 
144
- # title and documentation
145
- st.markdown(Path('tiger.md').read_text(), unsafe_allow_html=True)
146
- st.divider()
147
-
148
  # mode selection
149
  col1, col2 = st.columns([0.65, 0.35])
150
  with col1:
 
4
  import streamlit as st
5
  from pathlib import Path
6
 
7
+ # title and documentation
8
+ st.markdown(Path('tiger.md').read_text(), unsafe_allow_html=True)
9
+ st.divider()
 
 
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
  # Check if the selected model is Cas9
17
  if selected_model == 'Cas9':
18
  # Boolean variables for each checkbox state
 
20
  spcas9_t7 = st.checkbox('SPCas9_t7', key='spcas9_t7')
21
  esp_cas9 = st.checkbox('eSPCas9', key='esp_cas9')
22
  spcas9_hf1 = st.checkbox('SPCas9_HF1', key='spcas9_hf1')
23
+
24
+ # Update the state of checkboxes based on the selection
25
+ if spcas9_u6:
26
  st.session_state['spcas9_t7'] = False
27
  st.session_state['esp_cas9'] = False
28
  st.session_state['spcas9_hf1'] = False
29
  pass
30
  # Placeholder for action when SPCas9_U6 is clicked
31
+ elif spcas9_t7:
32
  st.session_state['spcas9_u6'] = False
33
  st.session_state['esp_cas9'] = False
34
  st.session_state['spcas9_hf1'] = False
35
  pass
36
  # Placeholder for action when SPCas9_t7 is clicked
37
+ elif esp_cas9:
38
  st.session_state['spcas9_u6'] = False
39
  st.session_state['spcas9_t7'] = False
40
  st.session_state['spcas9_hf1'] = False
41
  pass
42
  # Placeholder for action when eSPCas9 is clicked
43
+ elif spcas9_hf1:
44
  st.session_state['spcas9_u6'] = False
45
  st.session_state['spcas9_t7'] = False
46
  st.session_state['esp_cas9'] = False
 
142
  if 'off_target' not in st.session_state:
143
  st.session_state.off_target = None
144
 
 
 
 
 
145
  # mode selection
146
  col1, col2 = st.columns([0.65, 0.35])
147
  with col1: