Spaces:
Running
Running
Erva Ulusoy
commited on
Commit
·
7419d2a
1
Parent(s):
da1c3d0
added example query option
Browse files- ProtHGT_app.py +7 -2
ProtHGT_app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import os
|
2 |
import streamlit as st
|
3 |
from rapidfuzz import process
|
|
|
4 |
|
5 |
# with st.spinner("Initializing the environment... This may take up to 10 minutes at the start of each session."):
|
6 |
# # Create a temporary placeholder for the message
|
@@ -84,10 +85,14 @@ with st.sidebar:
|
|
84 |
# Add protein selection methods
|
85 |
selection_method = st.radio(
|
86 |
"Choose input method:",
|
87 |
-
["Search proteins", "Upload protein ID file"]
|
88 |
)
|
89 |
|
90 |
-
if selection_method == "
|
|
|
|
|
|
|
|
|
91 |
# User enters search term
|
92 |
search_query = st.text_input("Start typing a protein ID (at least 3 characters)", "")
|
93 |
|
|
|
1 |
import os
|
2 |
import streamlit as st
|
3 |
from rapidfuzz import process
|
4 |
+
import random
|
5 |
|
6 |
# with st.spinner("Initializing the environment... This may take up to 10 minutes at the start of each session."):
|
7 |
# # Create a temporary placeholder for the message
|
|
|
85 |
# Add protein selection methods
|
86 |
selection_method = st.radio(
|
87 |
"Choose input method:",
|
88 |
+
["Use example query", "Search proteins", "Upload protein ID file"]
|
89 |
)
|
90 |
|
91 |
+
if selection_method == "Use example query":
|
92 |
+
st.session_state.example_proteins = random.sample(available_proteins, 5)
|
93 |
+
selected_proteins = st.session_state.example_proteins
|
94 |
+
|
95 |
+
elif selection_method == "Search proteins":
|
96 |
# User enters search term
|
97 |
search_query = st.text_input("Start typing a protein ID (at least 3 characters)", "")
|
98 |
|