Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Andrew Stirn
commited on
Commit
·
8134cc8
1
Parent(s):
77e4f1f
let's try something
Browse files
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 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 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 |
-
|
| 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 |
-
|
| 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[
|
| 28 |
-
|
|
|
|
| 29 |
else:
|
| 30 |
st.write('only ACTG is allowed')
|
| 31 |
-
st.download_button(label='Download as CVS File', 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())
|