final download option
Browse files
app.py
CHANGED
|
@@ -52,12 +52,6 @@ def about_page():
|
|
| 52 |
)
|
| 53 |
|
| 54 |
st.image('figures/hyper-dti.png', caption='Overview of HyperPCM architecture.')
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
@st.cache
|
| 58 |
-
def convert_df(df):
|
| 59 |
-
# IMPORTANT: Cache the conversion to prevent computation on every rerun
|
| 60 |
-
return df.to_csv().encode('utf-8')
|
| 61 |
|
| 62 |
|
| 63 |
def retrieval():
|
|
@@ -161,9 +155,7 @@ def retrieval():
|
|
| 161 |
mol_img = Chem.Draw.MolToImage(mol)
|
| 162 |
st.image(mol_img, caption=f"{results.loc[j + 5*i, 'Prediction']:.2f}")
|
| 163 |
|
| 164 |
-
st.download_button('Download retrieved drug compounds.',
|
| 165 |
-
|
| 166 |
-
st.markdown('## TMP title')
|
| 167 |
|
| 168 |
elif query_embedding is not None:
|
| 169 |
st.markdown('### Inference')
|
|
@@ -213,9 +205,7 @@ def retrieval():
|
|
| 213 |
mol_img = Chem.Draw.MolToImage(mol)
|
| 214 |
st.image(mol_img, caption=f"{results.loc[j + 5*i, 'Prediction']:.2f}")
|
| 215 |
|
| 216 |
-
st.download_button('Download retrieved drug compounds.',
|
| 217 |
-
|
| 218 |
-
st.markdown('## TMP title')
|
| 219 |
|
| 220 |
page_names_to_func = {
|
| 221 |
'Retrieval': retrieval,
|
|
|
|
| 52 |
)
|
| 53 |
|
| 54 |
st.image('figures/hyper-dti.png', caption='Overview of HyperPCM architecture.')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
|
| 57 |
def retrieval():
|
|
|
|
| 155 |
mol_img = Chem.Draw.MolToImage(mol)
|
| 156 |
st.image(mol_img, caption=f"{results.loc[j + 5*i, 'Prediction']:.2f}")
|
| 157 |
|
| 158 |
+
st.download_button('Download retrieved drug compounds.', results.head(selected_k).to_csv().encode('utf-8'), file_name='retrieved_drugs.csv')
|
|
|
|
|
|
|
| 159 |
|
| 160 |
elif query_embedding is not None:
|
| 161 |
st.markdown('### Inference')
|
|
|
|
| 205 |
mol_img = Chem.Draw.MolToImage(mol)
|
| 206 |
st.image(mol_img, caption=f"{results.loc[j + 5*i, 'Prediction']:.2f}")
|
| 207 |
|
| 208 |
+
st.download_button('Download retrieved drug compounds.', results.head(selected_k).to_csv().encode('utf-8'), file_name='retrieved_drugs.csv')
|
|
|
|
|
|
|
| 209 |
|
| 210 |
page_names_to_func = {
|
| 211 |
'Retrieval': retrieval,
|