Update app.py
Browse files
app.py
CHANGED
@@ -113,7 +113,7 @@ def update(sequence, word1, word2, word3, sequence_length):
|
|
113 |
st.write("Please try again later or contact support if the issue persists.")
|
114 |
|
115 |
def share_on_twitter(word1, word2, word3, length, plddt):
|
116 |
-
tweet_text = f"I generated a
|
117 |
tweet_url = f"https://twitter.com/intent/tweet?text={urllib.parse.quote(tweet_text)}"
|
118 |
return tweet_url
|
119 |
|
@@ -155,7 +155,39 @@ if st.session_state.structure_info:
|
|
155 |
st.write('plDDT is a per-residue estimate of the confidence in prediction on a scale from 0-100%.')
|
156 |
plddt_score = int(info["b_value"] * 100)
|
157 |
st.info(f'Average plDDT: {plddt_score}%')
|
|
|
|
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
col1, col2 = st.columns(2)
|
160 |
with col1:
|
161 |
if st.button('Analyze Protein'):
|
@@ -168,15 +200,6 @@ if st.session_state.structure_info:
|
|
168 |
file_name='predicted.pdb',
|
169 |
mime='text/plain',
|
170 |
)
|
171 |
-
|
172 |
-
st.subheader("Share your unique protein on X")
|
173 |
-
st.write("1. Take a screenshot of the protein structure above.")
|
174 |
-
st.write("2. Click the 'Share Results' button below to open a pre-filled tweet.")
|
175 |
-
st.write("3. Attach your screenshot to the tweet before posting.")
|
176 |
-
|
177 |
-
tweet_url = share_on_twitter(info["word1"], info["word2"], info["word3"], info["sequence_length"], plddt_score)
|
178 |
-
st.markdown(f"[Share Results]({tweet_url})")
|
179 |
-
|
180 |
st.markdown("""
|
181 |
## What to do next:
|
182 |
If you find interesting results from the sequence folding, you can explore further:
|
|
|
113 |
st.write("Please try again later or contact support if the issue persists.")
|
114 |
|
115 |
def share_on_twitter(word1, word2, word3, length, plddt):
|
116 |
+
tweet_text = f"I generated a new protein using GenPro2 by @WandsAI from the words '{word1}', '{word2}', and '{word3}' + sequence length {length}! It's Predictive Protein Score is: {plddt}%"
|
117 |
tweet_url = f"https://twitter.com/intent/tweet?text={urllib.parse.quote(tweet_text)}"
|
118 |
return tweet_url
|
119 |
|
|
|
155 |
st.write('plDDT is a per-residue estimate of the confidence in prediction on a scale from 0-100%.')
|
156 |
plddt_score = int(info["b_value"] * 100)
|
157 |
st.info(f'Average plDDT: {plddt_score}%')
|
158 |
+
|
159 |
+
st.subheader("Share your unique protein on X(Twitter)")
|
160 |
|
161 |
+
st.markdown("""
|
162 |
+
<div style='background-color: #e6f2ff; padding: 10px; border-radius: 5px; font-size: 0.8em;'>
|
163 |
+
<ol>
|
164 |
+
<li>Take a screenshot of the protein structure above.</li>
|
165 |
+
<li>Click the 'Share on X' button below to open a pre-filled tweet.</li>
|
166 |
+
<li>Attach your screenshot to the tweet before posting.</li>
|
167 |
+
</ol>
|
168 |
+
</div>
|
169 |
+
""", unsafe_allow_html=True)
|
170 |
+
|
171 |
+
st.write("1. Take a screenshot of the protein structure above.")
|
172 |
+
st.write("2. Click the 'Share Results' button below to open a pre-filled tweet.")
|
173 |
+
st.write("3. Attach your protein screenshot to the post.")
|
174 |
+
|
175 |
+
tweet_url = share_on_twitter(info["word1"], info["word2"], info["word3"], info["sequence_length"], plddt_score)
|
176 |
+
st.markdown(f"[Share Results]({tweet_url})")
|
177 |
+
|
178 |
+
st.markdown("""
|
179 |
+
## What to do next:
|
180 |
+
If you find interesting results from the sequence folding, you can explore further:
|
181 |
+
1. Learn more about protein structures and sequences.
|
182 |
+
2. Visit the [Protein Data Bank (PDB)](https://www.rcsb.org/) for known protein structures.
|
183 |
+
3. Compare your folded structure with known functional proteins by downloading your results.
|
184 |
+
4. Read about similar proteins to gain insights into potential functions.
|
185 |
+
5. Click the "Analyze Protein" button to get more information about your generated protein.
|
186 |
+
**Remember, this folding is based on randomly generated sequences. Interpret the results with caution.
|
187 |
+
Enjoy exploring the world of protein sequences! Share your high-confidence protein images with us on X [*@WandsAI*](https://x.com/wandsai)!
|
188 |
+
""")
|
189 |
+
|
190 |
+
# Moved Analyze and Download buttons to the bottom
|
191 |
col1, col2 = st.columns(2)
|
192 |
with col1:
|
193 |
if st.button('Analyze Protein'):
|
|
|
200 |
file_name='predicted.pdb',
|
201 |
mime='text/plain',
|
202 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
st.markdown("""
|
204 |
## What to do next:
|
205 |
If you find interesting results from the sequence folding, you can explore further:
|