Andrew Stirn commited on
Commit
89ffb34
1 Parent(s): f57c1f6

support for app

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. tiger.py +1 -1
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import streamlit as st
2
  from tiger import tiger_exhibit, TARGET_LEN, NUCLEOTIDE_TOKENS
3
 
@@ -23,7 +24,7 @@ if len(st.session_state['userInput']) < TARGET_LEN:
23
 
24
  # valid input
25
  elif all([True if nt.upper() in NUCLEOTIDE_TOKENS.keys() else False for nt in st.session_state['userInput']]):
26
- on_target, off_target = tiger_exhibit(st.session_state['userInput'])
27
  st.write('On-target predictions: ', on_target)
28
  st.download_button(label='Download', data=convert_df(on_target), file_name='on_target.csv', mime='text/csv')
29
  if len(off_target) > 0:
 
1
+ import pandas as pd
2
  import streamlit as st
3
  from tiger import tiger_exhibit, TARGET_LEN, NUCLEOTIDE_TOKENS
4
 
 
24
 
25
  # valid input
26
  elif all([True if nt.upper() in NUCLEOTIDE_TOKENS.keys() else False for nt in st.session_state['userInput']]):
27
+ on_target, off_target = tiger_exhibit(pd.DataFrame(dict(id=['ManualEntry'], seq=[st.session_state['userInput']])))
28
  st.write('On-target predictions: ', on_target)
29
  st.download_button(label='Download', data=convert_df(on_target), file_name='on_target.csv', mime='text/csv')
30
  if len(off_target) > 0:
tiger.py CHANGED
@@ -214,7 +214,7 @@ if __name__ == '__main__':
214
  # simple test case
215
  if args.simple_test:
216
  # first 50 from EIF3B-003's CDS
217
- simple_test = pd.DataFrame(dict(id=['user entry'], seq=['ATGCAGGACGCGGAGAACGTGGCGGTGCCCGAGGCGGCCGAGGAGCGCGC']))
218
  simple_test.set_index('id', inplace=True)
219
  df_on_target, df_off_target = tiger_exhibit(simple_test)
220
  df_on_target.to_csv('on_target.csv')
 
214
  # simple test case
215
  if args.simple_test:
216
  # first 50 from EIF3B-003's CDS
217
+ simple_test = pd.DataFrame(dict(id=['ManualEntry'], seq=['ATGCAGGACGCGGAGAACGTGGCGGTGCCCGAGGCGGCCGAGGAGCGCGC']))
218
  simple_test.set_index('id', inplace=True)
219
  df_on_target, df_off_target = tiger_exhibit(simple_test)
220
  df_on_target.to_csv('on_target.csv')