UTR_LM / app.py
Shawn Shen
functional v1
7714123
raw
history blame
796 Bytes
import streamlit as st
# from Bio import SeqIO
from Predictor import predict_file, predict_raw
from io import StringIO
st.title("5' UTR prediction")
st.subheader("Input sequence")
#x = st.slider('Select a value')
# seq = ""
seq = st.text_area("Input your sequence here", value="")
st.subheader("Upload sequence file")
uploaded = st.file_uploader("Sequence file in FASTA format")
# if uploaded:
# st.write(StringIO(uploaded.getvalue().decode("utf-8")))
# seq = uploaded.read()
# print(seq)
# predict_file(uploaded)
# seq = SeqIO.read(uploaded, "fasta").seq
# st.subheader("Prediction result:")
if st.button("Predict"):
st.write("Prediction result:")
if uploaded:
st.write(predict_raw(uploaded.getvalue().decode()))
else:
st.write(predict_raw(seq))