jfaustin commited on
Commit
6255fd6
·
1 Parent(s): 59d012b

make correlation and regression plots visible only after clicking button

Browse files
Files changed (1) hide show
  1. folding_studio_demo/app.py +15 -5
folding_studio_demo/app.py CHANGED
@@ -320,7 +320,7 @@ def create_correlation_tab():
320
  inputs=[prediction_dataframe],
321
  outputs=[prediction_dataframe],
322
  )
323
- with gr.Row():
324
  with gr.Column(scale=0):
325
  with gr.Row():
326
  correlation_type = gr.Radio(
@@ -338,7 +338,7 @@ def create_correlation_tab():
338
  )
339
  with gr.Column():
340
  correlation_ranking_plot = gr.Plot(label="Correlation ranking")
341
- with gr.Row():
342
  with gr.Column(scale=0):
343
 
344
  # User can select the columns to display in the correlation plot
@@ -360,11 +360,21 @@ def create_correlation_tab():
360
  regression_plot = gr.Plot(label="Correlation with binding affinity")
361
 
362
  fake_predict_btn.click(
363
- fn=lambda x: fake_predict_and_correlate(
364
- spr_data_with_scores, SCORE_COLUMNS, ["Antibody Name", "KD (nM)"]
 
 
 
 
365
  ),
366
  inputs=[correlation_type],
367
- outputs=[prediction_dataframe, correlation_ranking_plot, regression_plot],
 
 
 
 
 
 
368
  )
369
 
370
  def update_plots_with_log(correlation_type, score, use_log):
 
320
  inputs=[prediction_dataframe],
321
  outputs=[prediction_dataframe],
322
  )
323
+ with gr.Row(visible=False) as correlation_row:
324
  with gr.Column(scale=0):
325
  with gr.Row():
326
  correlation_type = gr.Radio(
 
338
  )
339
  with gr.Column():
340
  correlation_ranking_plot = gr.Plot(label="Correlation ranking")
341
+ with gr.Row(visible=False) as regression_row:
342
  with gr.Column(scale=0):
343
 
344
  # User can select the columns to display in the correlation plot
 
360
  regression_plot = gr.Plot(label="Correlation with binding affinity")
361
 
362
  fake_predict_btn.click(
363
+ fn=lambda x: (
364
+ *fake_predict_and_correlate(
365
+ spr_data_with_scores, SCORE_COLUMNS, ["Antibody Name", "KD (nM)"]
366
+ ),
367
+ gr.Row(visible=True),
368
+ gr.Row(visible=True)
369
  ),
370
  inputs=[correlation_type],
371
+ outputs=[
372
+ prediction_dataframe,
373
+ correlation_ranking_plot,
374
+ regression_plot,
375
+ correlation_row,
376
+ regression_row,
377
+ ],
378
  )
379
 
380
  def update_plots_with_log(correlation_type, score, use_log):