Andrew Stirn commited on
Commit
8134cc8
·
1 Parent(s): 77e4f1f

let's try something

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -3,14 +3,14 @@ import pandas as pd
3
  from run import run, GUIDE_LEN, NUCLEOTIDE_TOKENS
4
 
5
 
6
- def run_with_input(reset=False):
7
- if reset:
8
- st.write("")
9
- return 0
10
- returned_x = run(st.session_state["userInput"])
11
- csv_x = returned_x.to_csv()
12
- st.write("model prediction: ", returned_x)
13
- return csv_x
14
 
15
 
16
  # title and instructions
@@ -19,13 +19,14 @@ st.session_state['userInput'] = ''
19
  st.session_state['userInput'] = st.text_input('Enter target transcript (or substring):')
20
 
21
 
22
- csv_data = pd.DataFrame.from_dict({'Target Site': [''], 'LFC': [0.0]}).to_csv()
23
  if len(st.session_state['userInput']) < GUIDE_LEN:
24
  st.write('Transcript length must be >= 23 bases. It is {:d} chars'.format(len(st.session_state['userInput'])))
25
- run_with_input(reset=True)
26
  elif all([True if nt.upper() in NUCLEOTIDE_TOKENS.keys() else False for nt in st.session_state['userInput']]):
27
- st.write('This is your sequence', st.session_state["userInput"])
28
- csv_data = run_with_input()
 
29
  else:
30
  st.write('only ACTG is allowed')
31
- st.download_button(label='Download as CVS File', data=csv_data)
 
3
  from run import run, GUIDE_LEN, NUCLEOTIDE_TOKENS
4
 
5
 
6
+ # def run_with_input(reset=False):
7
+ # if reset:
8
+ # st.write("")
9
+ # return 0
10
+ # returned_x = run(st.session_state["userInput"])
11
+ # csv_x = returned_x.to_csv()
12
+ # st.write("model prediction: ", returned_x)
13
+ # return csv_x
14
 
15
 
16
  # title and instructions
 
19
  st.session_state['userInput'] = st.text_input('Enter target transcript (or substring):')
20
 
21
 
22
+ predictions = pd.DataFrame.from_dict({'Target Site': [''], 'Normalized LFC': [0.0]})
23
  if len(st.session_state['userInput']) < GUIDE_LEN:
24
  st.write('Transcript length must be >= 23 bases. It is {:d} chars'.format(len(st.session_state['userInput'])))
25
+ st.write("")
26
  elif all([True if nt.upper() in NUCLEOTIDE_TOKENS.keys() else False for nt in st.session_state['userInput']]):
27
+ st.write('This is your sequence', st.session_state['userInput'])
28
+ predictions = run(st.session_state['userInput'])
29
+ st.write('Model predictions: ', predictions)
30
  else:
31
  st.write('only ACTG is allowed')
32
+ st.download_button(label='Download as CVS File', data=predictions.to_csv())