libokj commited on
Commit
65b3da3
·
verified ·
1 Parent(s): d558ad5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -1100,7 +1100,7 @@ def create_html_report(df, file=None, task=None, opts=(), progress=gr.Progress(t
1100
 
1101
  for i, col in enumerate(num_cols):
1102
  if col in df_html.columns:
1103
- if col not in ['Predicted Binding Affinity', 'Actual Binding Affinity']:
1104
  styled_df = styled_df.background_gradient(
1105
  subset=[col], cmap=sns.light_palette(num_col_colors[i], as_cmap=True))
1106
  else:
@@ -1141,8 +1141,7 @@ def create_html_report(df, file=None, task=None, opts=(), progress=gr.Progress(t
1141
  bool_formatters = {col: BooleanFormatter() for col in bool_cols}
1142
  float_formatters = {col: NumberFormatter(format='0.000') for col in df_html.select_dtypes('floating').columns}
1143
  other_formatters = {
1144
- 'Predicted Interaction Probability': {'type': 'progress', 'max': 1.0, 'legend': True},
1145
- 'Actual Interaction Probability': {'type': 'progress', 'max': 1.0, 'legend': True},
1146
  'Compound': image_zoom_formatter,
1147
  'Scaffold': image_zoom_formatter,
1148
  'Target FASTA': {'type': 'textarea', 'width': 60},
@@ -1162,8 +1161,8 @@ def create_html_report(df, file=None, task=None, opts=(), progress=gr.Progress(t
1162
  disabled=True, sizing_mode='stretch_both', pagination='local', page_size=30)
1163
 
1164
  for i, col in enumerate(num_cols):
1165
- if col not in ['Predicted Binding Affinity', 'Actual Binding Affinity']:
1166
- if col not in ['Predicted Interaction Probability', 'Actual Interaction Probability']:
1167
  report_table.style.background_gradient(
1168
  subset=df_html.columns == col, cmap=sns.light_palette(num_col_colors[i], as_cmap=True))
1169
  else:
@@ -1173,7 +1172,7 @@ def create_html_report(df, file=None, task=None, opts=(), progress=gr.Progress(t
1173
  subset=df_html.columns == col, cmap=sns.light_palette(num_col_colors[i], as_cmap=True).reversed())
1174
 
1175
  pie_charts = {}
1176
- for y in df_html.columns.intersection(['Interaction Probability', 'Binding Affinity']):
1177
  pie_charts[y] = []
1178
  for k in [10, 30, 100]:
1179
  if k < len(df_html):
@@ -2088,9 +2087,12 @@ QALAHAYFAQYHDPDDEPVADPYDQSFESRDLLIDEWKSLTYDEVISFVPPPLDQEEMES
2088
  gr.Dropdown(value='General') if row['Type'] == 'General' else gr.Dropdown(value=family)}
2089
 
2090
 
2091
- screen_preset_recommend_btn.click(fn=screen_recommend_model,
2092
- inputs=[target_fasta, drug_screen_target_family, drug_screen_task],
2093
- outputs=[drug_screen_preset, drug_screen_target_family], show_progress='hidden')
 
 
 
2094
 
2095
 
2096
  def compound_input_type_select(input_type):
 
1100
 
1101
  for i, col in enumerate(num_cols):
1102
  if col in df_html.columns:
1103
+ if col not in ['Binding Affinity (IC50 [nM])']:
1104
  styled_df = styled_df.background_gradient(
1105
  subset=[col], cmap=sns.light_palette(num_col_colors[i], as_cmap=True))
1106
  else:
 
1141
  bool_formatters = {col: BooleanFormatter() for col in bool_cols}
1142
  float_formatters = {col: NumberFormatter(format='0.000') for col in df_html.select_dtypes('floating').columns}
1143
  other_formatters = {
1144
+ 'Interaction Probability': {'type': 'progress', 'max': 1.0, 'legend': True},
 
1145
  'Compound': image_zoom_formatter,
1146
  'Scaffold': image_zoom_formatter,
1147
  'Target FASTA': {'type': 'textarea', 'width': 60},
 
1161
  disabled=True, sizing_mode='stretch_both', pagination='local', page_size=30)
1162
 
1163
  for i, col in enumerate(num_cols):
1164
+ if col not in ['Binding Affinity (IC50 [nM])']:
1165
+ if col not in ['Interaction Probability']:
1166
  report_table.style.background_gradient(
1167
  subset=df_html.columns == col, cmap=sns.light_palette(num_col_colors[i], as_cmap=True))
1168
  else:
 
1172
  subset=df_html.columns == col, cmap=sns.light_palette(num_col_colors[i], as_cmap=True).reversed())
1173
 
1174
  pie_charts = {}
1175
+ for y in df_html.columns.intersection(['Interaction Probability', 'Binding Affinity (IC50 [nM])']):
1176
  pie_charts[y] = []
1177
  for k in [10, 30, 100]:
1178
  if k < len(df_html):
 
2087
  gr.Dropdown(value='General') if row['Type'] == 'General' else gr.Dropdown(value=family)}
2088
 
2089
 
2090
+ screen_preset_recommend_btn.click(
2091
+ fn=screen_recommend_model,
2092
+ inputs=[target_fasta, drug_screen_target_family, drug_screen_task],
2093
+ outputs=[drug_screen_preset, drug_screen_target_family],
2094
+ show_progress='hidden'
2095
+ )
2096
 
2097
 
2098
  def compound_input_type_select(input_type):