Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ def perform_blast_analysis(sequence):
|
|
| 59 |
progress_bar = st.progress(0)
|
| 60 |
for i in range(100):
|
| 61 |
progress_bar.progress(i + 1)
|
| 62 |
-
time.sleep(
|
| 63 |
|
| 64 |
try:
|
| 65 |
record = SeqRecord(Seq(sequence), id='random_protein')
|
|
@@ -127,28 +127,6 @@ def update(sequence, word1, word2, word3, sequence_length):
|
|
| 127 |
st.error(f"An error occurred while calling the API: {str(e)}")
|
| 128 |
st.write("Please try again later or contact support if the issue persists.")
|
| 129 |
|
| 130 |
-
def share_on_twitter(word1, word2, word3, length, plddt):
|
| 131 |
-
tweet_text = f"I just generated a new protein using #GenPro2 by @WandsAI using the seed words #{word1}, #{word2}, #{word3} + sequence length of {length}. My Protein has a {plddt}% plDDT score!"
|
| 132 |
-
tweet_url = f"https://twitter.com/intent/tweet?text={urllib.parse.quote(tweet_text)}"
|
| 133 |
-
return tweet_url
|
| 134 |
-
|
| 135 |
-
# Initialize session state variables
|
| 136 |
-
if 'sequence' not in st.session_state:
|
| 137 |
-
st.session_state.sequence = None
|
| 138 |
-
if 'show_analyze_button' not in st.session_state:
|
| 139 |
-
st.session_state.show_analyze_button = False
|
| 140 |
-
if 'structure_info' not in st.session_state:
|
| 141 |
-
st.session_state.structure_info = None
|
| 142 |
-
|
| 143 |
-
st.title("📖 User Guide:")
|
| 144 |
-
|
| 145 |
-
st.sidebar.subheader("Generate Sequence from Words")
|
| 146 |
-
word1 = st.sidebar.text_input("Word 1")
|
| 147 |
-
word2 = st.sidebar.text_input("Word 2")
|
| 148 |
-
word3 = st.sidebar.text_input("Word 3")
|
| 149 |
-
sequence_length = st.sidebar.number_input("Sequence Length", min_value=50, max_value=400, value=100, step=10)
|
| 150 |
-
|
| 151 |
-
|
| 152 |
# Information for users
|
| 153 |
st.info("""
|
| 154 |
Protein Length Guide:
|
|
@@ -234,3 +212,24 @@ if st.session_state.structure_info:
|
|
| 234 |
**Remember, this folding is based on randomly generated sequences. Interpret the results with caution.
|
| 235 |
Enjoy exploring the world of protein sequences!
|
| 236 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
progress_bar = st.progress(0)
|
| 60 |
for i in range(100):
|
| 61 |
progress_bar.progress(i + 1)
|
| 62 |
+
time.sleep(1.9) # Analysis time
|
| 63 |
|
| 64 |
try:
|
| 65 |
record = SeqRecord(Seq(sequence), id='random_protein')
|
|
|
|
| 127 |
st.error(f"An error occurred while calling the API: {str(e)}")
|
| 128 |
st.write("Please try again later or contact support if the issue persists.")
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
# Information for users
|
| 131 |
st.info("""
|
| 132 |
Protein Length Guide:
|
|
|
|
| 212 |
**Remember, this folding is based on randomly generated sequences. Interpret the results with caution.
|
| 213 |
Enjoy exploring the world of protein sequences!
|
| 214 |
""")
|
| 215 |
+
|
| 216 |
+
def share_on_twitter(word1, word2, word3, length, plddt):
|
| 217 |
+
tweet_text = f"I just generated a unique protein using #GenPro2 by @WandsAI using the seed words #{word1}, #{word2}, #{word3} + sequence length of {length}. My Protein has a {plddt}% plDDT score!"
|
| 218 |
+
tweet_url = f"https://twitter.com/intent/tweet?text={urllib.parse.quote(tweet_text)}"
|
| 219 |
+
return tweet_url
|
| 220 |
+
|
| 221 |
+
# Initialize session state variables
|
| 222 |
+
if 'sequence' not in st.session_state:
|
| 223 |
+
st.session_state.sequence = None
|
| 224 |
+
if 'show_analyze_button' not in st.session_state:
|
| 225 |
+
st.session_state.show_analyze_button = False
|
| 226 |
+
if 'structure_info' not in st.session_state:
|
| 227 |
+
st.session_state.structure_info = None
|
| 228 |
+
|
| 229 |
+
st.title("📖 User Guide:")
|
| 230 |
+
|
| 231 |
+
st.sidebar.subheader("Generate Sequence from Words")
|
| 232 |
+
word1 = st.sidebar.text_input("Word 1")
|
| 233 |
+
word2 = st.sidebar.text_input("Word 2")
|
| 234 |
+
word3 = st.sidebar.text_input("Word 3")
|
| 235 |
+
sequence_length = st.sidebar.number_input("Sequence Length", min_value=50, max_value=400, value=100, step=10)
|