emmas96 commited on
Commit
601b6c8
·
1 Parent(s): 65ed60c

final touches to dummy functionalities

Browse files
Files changed (1) hide show
  1. app.py +24 -11
app.py CHANGED
@@ -51,7 +51,7 @@ def about_page():
51
  def predict_dti():
52
  st.markdown('## Predict drug-target interaction')
53
 
54
- st.warning('In the future this page will display the predicted interaction betweek the given drug compounds and protein target by the HyperPCM mdoel.')
55
 
56
  col1, col2 = st.columns(2)
57
 
@@ -162,23 +162,37 @@ def predict_dti():
162
  if drug_embedding is None or prot_embedding is None:
163
  st.warning('Waiting for both drug and target embeddings to be computed...')
164
  else:
165
- st.warning('In the future inference will be run with HyperPCM on the given drug compound and protein target...')
 
 
 
 
 
 
 
 
 
 
 
166
 
167
 
168
  def retrieval():
169
- st.markdown('## Retrieve top-k')
170
 
171
  st.write('In the furute this page will retrieve the top-k drug compounds that are predicted to have the highest activity toward the given protein target from either the Lenselink or Davis datasets.')
172
 
173
  st.markdown('### Target')
174
- sequence = st.text_input('Enter query amino-acid sequence', value='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA', placeholder='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA')
175
 
176
- if sequence:
177
- col1, col2 = st.columns(2)
178
- with col1:
 
179
  st.error('Visualization coming soon...')
180
-
181
- with col2:
 
 
 
182
  with st.spinner('Encoding in progress...'):
183
  from bio_embeddings.embed import SeqVecEmbedder
184
  encoder = SeqVecEmbedder()
@@ -186,7 +200,6 @@ def retrieval():
186
  for emb in embeddings:
187
  embedding = encoder.reduce_per_protein(emb)
188
  break
189
- st.image('protein_encoder_done.png')
190
  st.success('Encoding complete.')
191
 
192
  st.markdown('### Inference')
@@ -222,7 +235,7 @@ def retrieval():
222
  st.image(mol_img)
223
 
224
  def display_protein():
225
- st.markdown('## Display protein')
226
  st.write('In the future this page will display the ESM predicted sequence of a protein target.')
227
 
228
  st.markdown('### Target')
 
51
  def predict_dti():
52
  st.markdown('## Predict drug-target interaction')
53
 
54
+ st.text('In the future this page can be used to predict interactions betweek a query drug compound and a query protein target by the HyperPCM mdoel.')
55
 
56
  col1, col2 = st.columns(2)
57
 
 
162
  if drug_embedding is None or prot_embedding is None:
163
  st.warning('Waiting for both drug and target embeddings to be computed...')
164
  else:
165
+ st.markdown('### Inference')
166
+
167
+ import time
168
+ progress_text = "HyperPCM predicts the interaction between the query drug compound toward the query protein target. Please wait."
169
+ my_bar = st.progress(0, text=progress_text)
170
+ for i in range(100):
171
+ time.sleep(0.1)
172
+ my_bar.progress(i + 1, text=progress_text)
173
+ my_bar.progress(100, text="HyperPCM predicts the interaction between the query drug compound toward the query protein target. Done.")
174
+
175
+ st.markdown('### Interaction')
176
+ st.text('HyperPCM predicts an activity of xxx pChEMBL.')
177
 
178
 
179
  def retrieval():
180
+ st.markdown('## Retrieve top-k most active drug compounds')
181
 
182
  st.write('In the furute this page will retrieve the top-k drug compounds that are predicted to have the highest activity toward the given protein target from either the Lenselink or Davis datasets.')
183
 
184
  st.markdown('### Target')
 
185
 
186
+ col1, col2, col3, col4 = st.columns(4)
187
+ with col2:
188
+ sequence = st.text_input('Enter query amino-acid sequence', value='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA', placeholder='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA')
189
+ if sequence:
190
  st.error('Visualization coming soon...')
191
+
192
+ with col3:
193
+ if sequence:
194
+ st.image('protein_encoder_done.png')
195
+
196
  with st.spinner('Encoding in progress...'):
197
  from bio_embeddings.embed import SeqVecEmbedder
198
  encoder = SeqVecEmbedder()
 
200
  for emb in embeddings:
201
  embedding = encoder.reduce_per_protein(emb)
202
  break
 
203
  st.success('Encoding complete.')
204
 
205
  st.markdown('### Inference')
 
235
  st.image(mol_img)
236
 
237
  def display_protein():
238
+ st.markdown('## Display protein structure')
239
  st.write('In the future this page will display the ESM predicted sequence of a protein target.')
240
 
241
  st.markdown('### Target')