tagirshin commited on
Commit
b968659
1 Parent(s): 62beb3e

fixed extraction of examples

Browse files
Files changed (1) hide show
  1. app.py +29 -28
app.py CHANGED
@@ -18,7 +18,7 @@ def render_svg(svg_string):
18
  """Renders the given svg string."""
19
  c = st.container()
20
  with c:
21
- html(svg_string)
22
 
23
 
24
  # define groups to filter
@@ -330,35 +330,36 @@ if submit:
330
 
331
  filtered_gen_stats = valid_gen_stats.iloc[filtered_indices]
332
 
333
- st.subheader('Generation results', divider='rainbow')
334
- st.dataframe(filtered_gen_stats)
335
- st.download_button(
336
- label="Download results as CSV",
337
- data=convert_df(filtered_gen_stats),
338
- file_name='vqgae_tubulin_inhibitors_valid.csv',
339
- mime='text/csv',
340
- )
341
-
342
- st.subheader('Examples of generated molecules')
343
- examples_smiles = filtered_gen_stats.sort_values(by=["similarity_score"], ascending=False).iloc[:6].smiles.to_list()
344
- examples = []
345
- for smi in examples_smiles:
346
- mol = smiles(smi)
347
- mol.clean2d()
348
- examples.append(mol)
349
- svg = grid_depict(examples, 2)
350
- render_svg(svg)
351
-
352
- show_full_stats = st.checkbox('Show full stats')
353
- if show_full_stats:
354
- st.dataframe(full_stats)
355
-
356
  st.download_button(
357
- label="Download full results as CSV",
358
- data=convert_df(full_stats),
359
- file_name='vqgae_tubulin_inhibitors_full.csv',
360
  mime='text/csv',
361
  )
362
 
363
- if st.button("Restart"):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
364
  st.rerun()
 
18
  """Renders the given svg string."""
19
  c = st.container()
20
  with c:
21
+ html(svg_string, height=300, scrolling=True)
22
 
23
 
24
  # define groups to filter
 
330
 
331
  filtered_gen_stats = valid_gen_stats.iloc[filtered_indices]
332
 
333
+ with st.form("results"):
334
+ st.subheader('Generation results', divider='rainbow')
335
+ st.dataframe(filtered_gen_stats)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  st.download_button(
337
+ label="Download results as CSV",
338
+ data=convert_df(filtered_gen_stats),
339
+ file_name='vqgae_tubulin_inhibitors_valid.csv',
340
  mime='text/csv',
341
  )
342
 
343
+ st.subheader('Examples of generated molecules')
344
+ examples_smiles = filtered_gen_stats.sort_values(by=["similarity_score"], ascending=False).iloc[:6].smiles.to_list()
345
+ examples = []
346
+ for smi in examples_smiles:
347
+ mol = smiles(smi)
348
+ mol.clean2d()
349
+ examples.append(mol)
350
+ svg = grid_depict(examples, 2)
351
+ render_svg(svg)
352
+
353
+ with st.expander("Show full stats"):
354
+ st.dataframe(full_stats)
355
+
356
+ st.download_button(
357
+ label="Download full results as CSV",
358
+ data=convert_df(full_stats),
359
+ file_name='vqgae_tubulin_inhibitors_full.csv',
360
+ mime='text/csv',
361
+ )
362
+ restart = st.form_submit_button('Restart')
363
+
364
+ if restart:
365
  st.rerun()