astirn commited on
Commit
e9d876c
·
1 Parent(s): 66b2911
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -73,13 +73,16 @@ def process_input():
73
  # convert to upper case as used by tokenizer
74
  st.session_state.transcripts[tiger.SEQ_COL] = st.session_state.transcripts[tiger.SEQ_COL].apply(lambda s: s.upper())
75
 
76
- # if src_seq and all([True if nt.upper() in NUCLEOTIDE_TOKENS.keys() else False for nt in src_seq]):
77
- # elif src_seq is not None:
78
- # st.write('Invalid input!')
 
 
 
79
 
80
  print(st.session_state.transcripts)
81
 
82
- # everything looks good to run the model
83
  st.session_state.run = True
84
 
85
 
 
73
  # convert to upper case as used by tokenizer
74
  st.session_state.transcripts[tiger.SEQ_COL] = st.session_state.transcripts[tiger.SEQ_COL].apply(lambda s: s.upper())
75
 
76
+ # make sure all transcripts only contain nucleotides A, C, G, T, and wildcard N
77
+ valid = st.session_state.transcripts[tiger.SEQ_COL].apply(lambda s: set(s).issubset(tiger.NUCLEOTIDE_TOKENS.keys()))
78
+ if not all(valid):
79
+ with TRANSCRIPT_ENTRY:
80
+ st.write('Transcript(s) must only contain upper or lower case A, C, G, and Ts')
81
+ return
82
 
83
  print(st.session_state.transcripts)
84
 
85
+ # everything looks good, so run the model
86
  st.session_state.run = True
87
 
88