Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Andrew Stirn
commited on
Commit
·
78951dd
1
Parent(s):
814d067
cleanup
Browse files
app.py
CHANGED
|
@@ -11,17 +11,21 @@ def convert_df(df):
|
|
| 11 |
# title and instructions
|
| 12 |
st.title('TIGER Cas13 Efficacy Prediction')
|
| 13 |
st.session_state['userInput'] = ''
|
| 14 |
-
st.session_state['userInput'] = st.text_input('Enter target transcript (or substring):'
|
| 15 |
-
|
| 16 |
|
|
|
|
| 17 |
if len(st.session_state['userInput']) < GUIDE_LEN:
|
| 18 |
st.write('Transcript length must be >= 23 bases. It is {:d} chars'.format(len(st.session_state['userInput'])))
|
| 19 |
-
st.write(
|
|
|
|
|
|
|
| 20 |
elif all([True if nt.upper() in NUCLEOTIDE_TOKENS.keys() else False for nt in st.session_state['userInput']]):
|
| 21 |
-
st.write('This is your sequence', st.session_state['userInput'])
|
| 22 |
predictions = tiger_predict(st.session_state['userInput'])
|
| 23 |
st.write('Model predictions: ', predictions)
|
| 24 |
csv = convert_df(predictions)
|
| 25 |
st.download_button(label='Download CSV file', data=csv, file_name='tiger_predictions.csv', mime='text/csv')
|
|
|
|
|
|
|
| 26 |
else:
|
| 27 |
-
st.write('
|
|
|
|
| 11 |
# title and instructions
|
| 12 |
st.title('TIGER Cas13 Efficacy Prediction')
|
| 13 |
st.session_state['userInput'] = ''
|
| 14 |
+
st.session_state['userInput'] = st.text_input('Enter a target transcript (or substring thereof):',
|
| 15 |
+
placeholder='Upper or lower case')
|
| 16 |
|
| 17 |
+
# input is too short
|
| 18 |
if len(st.session_state['userInput']) < GUIDE_LEN:
|
| 19 |
st.write('Transcript length must be >= 23 bases. It is {:d} chars'.format(len(st.session_state['userInput'])))
|
| 20 |
+
st.write('')
|
| 21 |
+
|
| 22 |
+
# valid input
|
| 23 |
elif all([True if nt.upper() in NUCLEOTIDE_TOKENS.keys() else False for nt in st.session_state['userInput']]):
|
|
|
|
| 24 |
predictions = tiger_predict(st.session_state['userInput'])
|
| 25 |
st.write('Model predictions: ', predictions)
|
| 26 |
csv = convert_df(predictions)
|
| 27 |
st.download_button(label='Download CSV file', data=csv, file_name='tiger_predictions.csv', mime='text/csv')
|
| 28 |
+
|
| 29 |
+
# invalid input
|
| 30 |
else:
|
| 31 |
+
st.write('Nucleotides other than ACGT detected!')
|