import streamlit as st import run as trun 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 st.title("Tiger gen prediction") st.session_state['userInput'] = "" st.session_state["userInput"] = st.text_input('type gen sequence') cvs_data = "first run model to generate data" if len(st.session_state['userInput']) < 23: st.write("Sorry your input length must be at least 23 bases. It is %s chars"%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)