Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -206,12 +206,14 @@ with gr.Blocks(title="Cheminformatics Platform") as demo:
|
|
| 206 |
file3 = gr.File(label="分子檔")
|
| 207 |
col_sel = gr.Dropdown(['MolWt','TPSA','NumHDonors','NumHAcceptors','LogP'], label="欄位")
|
| 208 |
eda_img = gr.Image(label="描述子分布圖")
|
|
|
|
| 209 |
eda_btn = gr.Button("產生分布圖")
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
|
|
|
| 215 |
|
| 216 |
eda_btn.click(
|
| 217 |
show_eda_img_with_explain, [file3, col_sel], [eda_img, eda_desc]
|
|
|
|
| 206 |
file3 = gr.File(label="分子檔")
|
| 207 |
col_sel = gr.Dropdown(['MolWt','TPSA','NumHDonors','NumHAcceptors','LogP'], label="欄位")
|
| 208 |
eda_img = gr.Image(label="描述子分布圖")
|
| 209 |
+
eda_desc = gr.Markdown(label="圖像說明") # <<<<<<<< 新增這一行
|
| 210 |
eda_btn = gr.Button("產生分布圖")
|
| 211 |
+
|
| 212 |
+
def show_eda_img_with_explain(file, col):
|
| 213 |
+
df = calc_features(load_table(file), ['ecfp4'], [col], None)
|
| 214 |
+
img = plot_desc_dist(df, col)
|
| 215 |
+
txt = explain_desc_dist(df, col)
|
| 216 |
+
return img, txt
|
| 217 |
|
| 218 |
eda_btn.click(
|
| 219 |
show_eda_img_with_explain, [file3, col_sel], [eda_img, eda_desc]
|