emmas96 commited on
Commit
c542f1d
·
1 Parent(s): 5e889cc

pre-load results for example target

Browse files
Files changed (1) hide show
  1. app.py +20 -3
app.py CHANGED
@@ -132,7 +132,26 @@ def retrieval():
132
  st.image('figures/molecule_encoder.png')
133
  st.warning('Choose encoder above...')
134
 
135
- if query_embedding is not None:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  st.markdown('### Inference')
137
 
138
  progress_text = "HyperPCM is predicting the QSAR model for the query protein target. Please wait."
@@ -172,8 +191,6 @@ def retrieval():
172
  results = results.sort_values(by='Prediction', ascending=False)
173
  results = results.reset_index()
174
 
175
- print(results.head(10))
176
-
177
  cols = st.columns(5)
178
  for j, col in enumerate(cols):
179
  with col:
 
132
  st.image('figures/molecule_encoder.png')
133
  st.warning('Choose encoder above...')
134
 
135
+ if sequence == ex_target:
136
+ st.markdown('### Inference')
137
+
138
+ my_bar.progress(100, text="HyperPCM is predicting the QSAR model for the query protein target. Done.")
139
+
140
+ st.markdown('### Retrieval')
141
+
142
+ selected_k = st.slider(f'Top-k most active drug compounds {selected_database} predicted by HyperPCM are, for k = ', 5, 20, 5, 5)
143
+
144
+ results = pd.read_csv('data/Lenselink/processed/ex_results.csv')
145
+
146
+ cols = st.columns(5)
147
+ for j, col in enumerate(cols):
148
+ with col:
149
+ for i in range(int(selected_k/5)):
150
+ mol = Chem.MolFromSmiles(results.loc[j + 5*i, 'SMILES'])
151
+ mol_img = Chem.Draw.MolToImage(mol)
152
+ st.image(mol_img, caption=f"{results.loc[j + 5*i, 'Prediction']:.2f}")
153
+
154
+ elif query_embedding is not None:
155
  st.markdown('### Inference')
156
 
157
  progress_text = "HyperPCM is predicting the QSAR model for the query protein target. Please wait."
 
191
  results = results.sort_values(by='Prediction', ascending=False)
192
  results = results.reset_index()
193
 
 
 
194
  cols = st.columns(5)
195
  for j, col in enumerate(cols):
196
  with col: