astirn commited on
Commit
54823be
·
1 Parent(s): 57dc36b

manually merged latest tiger-exhibit files

Browse files
Files changed (3) hide show
  1. app.py +3 -2
  2. requirements.txt +1 -0
  3. run.py +1 -4
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import streamlit as st
2
  import run as trun
 
3
 
4
 
5
  def run_with_input(reset=False):
@@ -14,7 +15,7 @@ def run_with_input(reset=False):
14
  st.title("Tiger gen prediction")
15
  st.session_state['userInput'] = ""
16
  st.session_state["userInput"] = st.text_input('type gen sequence')
17
- cvs_data = "first run model to generate data"
18
  if len(st.session_state['userInput']) < 23:
19
  st.write("Sorry your input length must be at least 23 bases. It is %s chars"%len(st.session_state['userInput']))
20
  run_with_input(reset=True)
@@ -22,5 +23,5 @@ elif all([True if item in "ACGTacgt" else False for item in st.session_state['us
22
  st.write('This is your sequence', st.session_state["userInput"])
23
  csv_data = run_with_input()
24
  else:
25
- st.write("only ACTG is allowed")
26
  st.download_button(label="Download as CVS File", data=csv_data)
 
1
  import streamlit as st
2
  import run as trun
3
+ import pandas as pd
4
 
5
 
6
  def run_with_input(reset=False):
 
15
  st.title("Tiger gen prediction")
16
  st.session_state['userInput'] = ""
17
  st.session_state["userInput"] = st.text_input('type gen sequence')
18
+ csv_data = pd.DataFrame.from_dict({"Gene": [""], "res":[0.0]}).to_csv()
19
  if len(st.session_state['userInput']) < 23:
20
  st.write("Sorry your input length must be at least 23 bases. It is %s chars"%len(st.session_state['userInput']))
21
  run_with_input(reset=True)
 
23
  st.write('This is your sequence', st.session_state["userInput"])
24
  csv_data = run_with_input()
25
  else:
26
+ st.write("only ACTG is allowed")
27
  st.download_button(label="Download as CVS File", data=csv_data)
requirements.txt CHANGED
@@ -1,2 +1,3 @@
 
1
  tensorflow==2.11.0
2
  tensorflow-probability==0.19.0
 
1
+ pandas==1.5.2
2
  tensorflow==2.11.0
3
  tensorflow-probability==0.19.0
run.py CHANGED
@@ -55,7 +55,4 @@ if __name__ == "__main__":
55
  print("you need to specify 23 character gen information. You typed %s chars" % len(x))
56
  exit()
57
  elif all([True if item in "ACGT" else False for item in x]):
58
- print("run succesfully: ", run(x))
59
- else:
60
- print("your gen sequence need 23 character only from ACGT")
61
- exit()
 
55
  print("you need to specify 23 character gen information. You typed %s chars" % len(x))
56
  exit()
57
  elif all([True if item in "ACGT" else False for item in x]):
58
+ print("run succesfully: ", run(x))