File size: 1,063 Bytes
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
import streamlit as st
from time import time, ctime
import tiger_trainer as stt
import run as trun
import pandas as pd 
import os, shutil, glob


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)