Update app.py
Browse files
app.py
CHANGED
|
@@ -127,6 +127,27 @@ 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 |
# Information for users
|
| 131 |
st.info("""
|
| 132 |
Protein Length Guide:
|
|
@@ -213,23 +234,3 @@ if st.session_state.structure_info:
|
|
| 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)
|
|
|
|
| 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 unique 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 |
# Information for users
|
| 152 |
st.info("""
|
| 153 |
Protein Length Guide:
|
|
|
|
| 234 |
Enjoy exploring the world of protein sequences!
|
| 235 |
""")
|
| 236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|