File size: 1,082 Bytes
89be9f9
 
54823be
89be9f9
 
 
 
 
 
 
 
 
 
 
cf3bd3a
 
 
89be9f9
cf3bd3a
 
 
 
 
 
89be9f9
 
 
 
 
54823be
89be9f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import streamlit as st
import run as trun
import pandas as pd


def run_with_input(reset=False):
    if reset:
        st.write("")
        return 0
    returned_x = trun.run(st.session_state["userInput"])
    csv_x = returned_x.to_csv()
    st.write("model prediction: ", returned_x)
    return csv_x


# title and instructions
st.title('TIGER Cas13 Efficacy Prediction')
st.session_state['userInput'] = ""
st.session_state["userInput"] = st.text_input('Enter target transcript (or substring):')


csv_data = pd.DataFrame.from_dict({'Target Site': [''], 'LFC': [0.0]}).to_csv()
if len(st.session_state['userInput']) < trun.GUIDE_LEN:
    st.write('Transcript length must be >= 23 bases. It is {:d} chars'.format(len(st.session_state['userInput'])))
    run_with_input(reset=True)
elif all([True if item in "ACGTacgt" else False for item in st.session_state['userInput']]):
    st.write('This is your sequence', st.session_state["userInput"])
    csv_data = run_with_input()
else:
    st.write("only ACTG is allowed")
st.download_button(label="Download as CVS File", data=csv_data)