Kung-Hsun commited on
Commit
2c2395e
·
verified ·
1 Parent(s): 86a6535

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
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
- def show_eda_img_with_explain(f, c):
211
- df = calc_features(load_table(f), ['ecfp4'], [c], None)
212
- img = plot_desc_dist(df, c)
213
- exp = explain_desc_dist(df, c)
214
- return img, exp
 
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]