Spaces:
Sleeping
Sleeping
Commit
•
865009c
1
Parent(s):
8b94f20
Update layout
Browse files
app.py
CHANGED
@@ -5,17 +5,12 @@ from io import StringIO
|
|
5 |
import joblib
|
6 |
import numpy as np
|
7 |
import pandas as pd
|
8 |
-
|
9 |
# page set up
|
10 |
import streamlit as st
|
11 |
from b3clf.descriptor_padel import compute_descriptors
|
12 |
from b3clf.geometry_opt import geometry_optimize
|
13 |
-
from b3clf.utils import (
|
14 |
-
|
15 |
-
predict_permeability,
|
16 |
-
scale_descriptors,
|
17 |
-
select_descriptors,
|
18 |
-
)
|
19 |
from streamlit_ketcher import st_ketcher
|
20 |
|
21 |
st.set_page_config(
|
@@ -147,38 +142,47 @@ def generate_predictions(
|
|
147 |
st.title(":blue[BBB Permeability Prediction with Imbalanced Learning]")
|
148 |
info_column, upload_column = st.columns(2)
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
# Create a file uploader
|
151 |
|
152 |
with upload_column:
|
153 |
-
st.subheader("
|
154 |
with st.container():
|
155 |
-
|
156 |
-
#
|
157 |
-
|
158 |
-
sample_sdf_column, classifier_col = st.columns(2)
|
159 |
-
with sample_sdf_column:
|
160 |
-
# download sample sdf
|
161 |
-
with open("sample_input.sdf", "r") as file_sdf:
|
162 |
-
btn = st.download_button(
|
163 |
-
label="Download SDF sample file",
|
164 |
-
data=file_sdf,
|
165 |
-
file_name="sample_input.sdf",
|
166 |
-
)
|
167 |
-
with classifier_col:
|
168 |
classifier = st.selectbox(
|
169 |
label="Classification algorithm:",
|
170 |
options=("XGBoost", "kNN", "decision trees", "logsistical regression"),
|
171 |
)
|
172 |
-
|
173 |
-
sample_smiles_column, resampler_col = st.columns(2)
|
174 |
-
with sample_smiles_column:
|
175 |
-
# download sample smiles
|
176 |
-
with open("sample_input_smiles.csv", "r") as file_smi:
|
177 |
-
btn = st.download_button(
|
178 |
-
label="Download SMILES sample file",
|
179 |
-
data=file_smi,
|
180 |
-
file_name="sample_input_smiles.csv",
|
181 |
-
)
|
182 |
with resampler_col:
|
183 |
resampler = st.selectbox(
|
184 |
label="Resampling method:",
|
@@ -206,14 +210,7 @@ with upload_column:
|
|
206 |
# st.write(file.read().decode("utf-8"))
|
207 |
# st.write(file)
|
208 |
|
209 |
-
|
210 |
-
st.subheader("About `B3clf`")
|
211 |
-
# fmt: off
|
212 |
-
st.markdown(
|
213 |
-
"""
|
214 |
-
`B3clf` is a Python package for predicting the blood-brain barrier (BBB) permeability of small molecules using imbalanced learning. Source code is available at https://github.com/theochem/B3clf.""" #
|
215 |
-
)
|
216 |
-
# fmt: on
|
217 |
|
218 |
feature_column, prediction_column = st.columns(2)
|
219 |
with feature_column:
|
|
|
5 |
import joblib
|
6 |
import numpy as np
|
7 |
import pandas as pd
|
|
|
8 |
# page set up
|
9 |
import streamlit as st
|
10 |
from b3clf.descriptor_padel import compute_descriptors
|
11 |
from b3clf.geometry_opt import geometry_optimize
|
12 |
+
from b3clf.utils import (get_descriptors, predict_permeability,
|
13 |
+
scale_descriptors, select_descriptors)
|
|
|
|
|
|
|
|
|
14 |
from streamlit_ketcher import st_ketcher
|
15 |
|
16 |
st.set_page_config(
|
|
|
142 |
st.title(":blue[BBB Permeability Prediction with Imbalanced Learning]")
|
143 |
info_column, upload_column = st.columns(2)
|
144 |
|
145 |
+
# download sample files
|
146 |
+
with info_column:
|
147 |
+
st.subheader("About `B3clf`")
|
148 |
+
# fmt: off
|
149 |
+
st.markdown(
|
150 |
+
"""
|
151 |
+
`B3clf` is a Python package for predicting the blood-brain barrier (BBB) permeability of small molecules using imbalanced learning. Source code is available at https://github.com/theochem/B3clf.""" #
|
152 |
+
)
|
153 |
+
# fmt: on
|
154 |
+
sdf_col, smi_col = st.columns(2)
|
155 |
+
with sdf_col:
|
156 |
+
# uneven columns
|
157 |
+
# st.columns((2, 1, 1, 1))
|
158 |
+
# two subcolumns for sample input files
|
159 |
+
# download sample sdf
|
160 |
+
# st.markdown(" \n \n")
|
161 |
+
with open("sample_input.sdf", "r") as file_sdf:
|
162 |
+
btn = st.download_button(
|
163 |
+
label="Download SDF sample file",
|
164 |
+
data=file_sdf,
|
165 |
+
file_name="sample_input.sdf",
|
166 |
+
)
|
167 |
+
with smi_col:
|
168 |
+
with open("sample_input_smiles.csv", "r") as file_smi:
|
169 |
+
btn = st.download_button(
|
170 |
+
label="Download SMILES sample file",
|
171 |
+
data=file_smi,
|
172 |
+
file_name="sample_input_smiles.csv",
|
173 |
+
)
|
174 |
# Create a file uploader
|
175 |
|
176 |
with upload_column:
|
177 |
+
st.subheader("Model Selection")
|
178 |
with st.container():
|
179 |
+
algorithm_col, resampler_col = st.columns(2)
|
180 |
+
# algorithm and resampling method selection column
|
181 |
+
with algorithm_col:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
classifier = st.selectbox(
|
183 |
label="Classification algorithm:",
|
184 |
options=("XGBoost", "kNN", "decision trees", "logsistical regression"),
|
185 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
with resampler_col:
|
187 |
resampler = st.selectbox(
|
188 |
label="Resampling method:",
|
|
|
210 |
# st.write(file.read().decode("utf-8"))
|
211 |
# st.write(file)
|
212 |
|
213 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
|
215 |
feature_column, prediction_column = st.columns(2)
|
216 |
with feature_column:
|