Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1288,14 +1288,22 @@ def create_html_report(df, file=None, task=None, opts=(), progress=gr.Progress(t
|
|
1288 |
# Add alert emoji for sequence identity below 0.85
|
1289 |
if unique_df['Max. Sequence Identity to Training Targets'].iloc[0] < 0.85:
|
1290 |
unique_df['Max. Sequence Identity to Training Targets'] = (
|
1291 |
-
unique_df['Max. Sequence Identity to Training Targets'].apply(
|
|
|
|
|
|
|
|
|
1292 |
)
|
1293 |
|
1294 |
if 'Max. Tanimoto Similarity to Training Compounds' in unique_df.columns:
|
1295 |
# Add alert emoji for sequence identity below 0.85
|
1296 |
if unique_df['Max. Tanimoto Similarity to Training Compounds'].iloc[0] < 0.85:
|
1297 |
unique_df['Max. Tanimoto Similarity to Training Compounds'] = (
|
1298 |
-
unique_df['Max. Tanimoto Similarity to Training Compounds'].apply(
|
|
|
|
|
|
|
|
|
1299 |
)
|
1300 |
|
1301 |
if any(unique_df.columns.isin(bool_cols)):
|
@@ -1326,7 +1334,10 @@ def create_html_report(df, file=None, task=None, opts=(), progress=gr.Progress(t
|
|
1326 |
'<% } else { %><% } %>' # Output empty string if value is NaN
|
1327 |
)
|
1328 |
alert_emoji_formatter = HTMLTemplateFormatter(
|
1329 |
-
template='<% if (value < 0.85) {
|
|
|
|
|
|
|
1330 |
)
|
1331 |
bool_formatters = {col: BooleanFormatter() for col in bool_cols}
|
1332 |
float_formatters = {col: NumberFormatter(format='0.000') for col in df_html.select_dtypes('floating').columns}
|
|
|
1288 |
# Add alert emoji for sequence identity below 0.85
|
1289 |
if unique_df['Max. Sequence Identity to Training Targets'].iloc[0] < 0.85:
|
1290 |
unique_df['Max. Sequence Identity to Training Targets'] = (
|
1291 |
+
unique_df['Max. Sequence Identity to Training Targets'].apply(
|
1292 |
+
lambda x: f'<span style="color: red;">{x:.3f}'
|
1293 |
+
f' ⚠️Lower than recommended (0.85)'
|
1294 |
+
f' - predictive reliability may be compromised</span>'
|
1295 |
+
)
|
1296 |
)
|
1297 |
|
1298 |
if 'Max. Tanimoto Similarity to Training Compounds' in unique_df.columns:
|
1299 |
# Add alert emoji for sequence identity below 0.85
|
1300 |
if unique_df['Max. Tanimoto Similarity to Training Compounds'].iloc[0] < 0.85:
|
1301 |
unique_df['Max. Tanimoto Similarity to Training Compounds'] = (
|
1302 |
+
unique_df['Max. Tanimoto Similarity to Training Compounds'].apply(
|
1303 |
+
lambda x: f'<span style="color: red;">{x:.3f}'
|
1304 |
+
f' ⚠️Lower than recommended (0.85)'
|
1305 |
+
f' - predictive reliability may be compromised</span>'
|
1306 |
+
)
|
1307 |
)
|
1308 |
|
1309 |
if any(unique_df.columns.isin(bool_cols)):
|
|
|
1334 |
'<% } else { %><% } %>' # Output empty string if value is NaN
|
1335 |
)
|
1336 |
alert_emoji_formatter = HTMLTemplateFormatter(
|
1337 |
+
template='<% if (value < 0.85) { '
|
1338 |
+
'%><span style="color: red;"><%= value %> '
|
1339 |
+
'⚠️Lower than recommended (0.85) - predictive reliability may be compromised</span><% '
|
1340 |
+
'} else { %><%= value %><% } %>'
|
1341 |
)
|
1342 |
bool_formatters = {col: BooleanFormatter() for col in bool_cols}
|
1343 |
float_formatters = {col: NumberFormatter(format='0.000') for col in df_html.select_dtypes('floating').columns}
|