Commit
·
e03506a
1
Parent(s):
53d6b90
Initial deployment: Antibody non-specificity predictor
Browse files- ESM-1v (650M) + Logistic Regression
- Trained on Boughter dataset
- Pydantic v2 validation
- Gradio 5.x UI
app.py
CHANGED
|
@@ -246,20 +246,28 @@ with gr.Blocks(theme=theme, title="Antibody Predictor") as app:
|
|
| 246 |
)
|
| 247 |
|
| 248 |
with gr.Accordion("⚙️ Advanced Settings", open=False), gr.Row():
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
|
| 264 |
submit_btn = gr.Button(
|
| 265 |
"🔬 Predict Non-Specificity", variant="primary", size="lg"
|
|
@@ -287,13 +295,17 @@ with gr.Blocks(theme=theme, title="Antibody Predictor") as app:
|
|
| 287 |
)
|
| 288 |
|
| 289 |
# Confidence Bar
|
| 290 |
-
|
| 291 |
-
|
| 292 |
)
|
|
|
|
| 293 |
|
| 294 |
# Detailed JSON
|
| 295 |
with gr.Accordion("📋 Detailed JSON Output", open=False):
|
| 296 |
-
|
|
|
|
|
|
|
|
|
|
| 297 |
|
| 298 |
# Footer
|
| 299 |
gr.HTML(
|
|
|
|
| 246 |
)
|
| 247 |
|
| 248 |
with gr.Accordion("⚙️ Advanced Settings", open=False), gr.Row():
|
| 249 |
+
with gr.Column():
|
| 250 |
+
gr.HTML(
|
| 251 |
+
'<div style="background-color: #3B82F6; color: white; padding: 4px 8px; border-radius: 4px; font-weight: 600; font-size: 0.875rem; display: inline-block; margin-bottom: 4px;">Calibrated Assay</div>'
|
| 252 |
+
)
|
| 253 |
+
assay_input = gr.Dropdown(
|
| 254 |
+
choices=["ELISA", "PSR", "None"],
|
| 255 |
+
value="None",
|
| 256 |
+
show_label=False,
|
| 257 |
+
info="Use threshold calibrated for specific assay",
|
| 258 |
+
)
|
| 259 |
+
with gr.Column():
|
| 260 |
+
gr.HTML(
|
| 261 |
+
'<div style="background-color: #3B82F6; color: white; padding: 4px 8px; border-radius: 4px; font-weight: 600; font-size: 0.875rem; display: inline-block; margin-bottom: 4px;">Decision Threshold</div>'
|
| 262 |
+
)
|
| 263 |
+
threshold_input = gr.Slider(
|
| 264 |
+
minimum=0.0,
|
| 265 |
+
maximum=1.0,
|
| 266 |
+
value=0.5,
|
| 267 |
+
step=0.05,
|
| 268 |
+
show_label=False,
|
| 269 |
+
info="Probability cutoff for non-specificity",
|
| 270 |
+
)
|
| 271 |
|
| 272 |
submit_btn = gr.Button(
|
| 273 |
"🔬 Predict Non-Specificity", variant="primary", size="lg"
|
|
|
|
| 295 |
)
|
| 296 |
|
| 297 |
# Confidence Bar
|
| 298 |
+
gr.HTML(
|
| 299 |
+
'<div style="background-color: #3B82F6; color: white; padding: 4px 8px; border-radius: 4px; font-weight: 600; font-size: 0.875rem; display: inline-block; margin-bottom: 4px;">Model Confidence</div>'
|
| 300 |
)
|
| 301 |
+
confidence_output = gr.Label(num_top_classes=2, show_label=False)
|
| 302 |
|
| 303 |
# Detailed JSON
|
| 304 |
with gr.Accordion("📋 Detailed JSON Output", open=False):
|
| 305 |
+
gr.HTML(
|
| 306 |
+
'<div style="background-color: #3B82F6; color: white; padding: 4px 8px; border-radius: 4px; font-weight: 600; font-size: 0.875rem; display: inline-block; margin-bottom: 4px;">Raw Result</div>'
|
| 307 |
+
)
|
| 308 |
+
json_output = gr.JSON(show_label=False)
|
| 309 |
|
| 310 |
# Footer
|
| 311 |
gr.HTML(
|