Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -226,15 +226,28 @@ def gradio_inference(dna_sequence, run_mapping):
|
|
| 226 |
|
| 227 |
return summary, "\n".join(stats_lines), context_output, ""
|
| 228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
# --- THE UI LAYOUT ---
|
| 230 |
-
with gr.Blocks(theme=gr.themes.Soft(), title="𧬠The Genomic Oracle π§¬") as demo:
|
| 231 |
|
| 232 |
-
# 1. The Custom HTML Title
|
| 233 |
gr.HTML(
|
| 234 |
"""
|
| 235 |
<div style="text-align: center; padding-bottom: 10px;">
|
| 236 |
<h1 style="font-size: 3.5rem; font-weight: bold; margin-bottom: 0.2rem;">𧬠The Genomic Oracle π§¬</h1>
|
| 237 |
-
<h3 style="margin-top: 0; font-weight: normal;"><b>University of Maryland Global Campus</b> | Bioinformatics Capstone</h3>
|
| 238 |
</div>
|
| 239 |
<hr>
|
| 240 |
"""
|
|
@@ -246,23 +259,22 @@ with gr.Blocks(theme=gr.themes.Soft(), title="𧬠The Genomic Oracle π§¬") as
|
|
| 246 |
Welcome to the official interface for **The Genomic Oracle**, a cascaded machine learning pipeline designed for high-precision DNA sequence classification.
|
| 247 |
|
| 248 |
### The 4-Stage Cascading Architecture
|
| 249 |
-
1. **The Gatekeeper:** Logistic Regression
|
| 250 |
-
2. **Structural Mapper:** LightGBM
|
| 251 |
-
3. **Phenotype Prediction:** Sequences flagged as Coding are passed through a custom ALiBi BERT transformer
|
| 252 |
-
4. **Regulatory Validation:** Sequences flagged as Non-Coding are routed to a DNABERT-2 spatial attention neural network.
|
|
|
|
|
|
|
| 253 |
---
|
| 254 |
"""
|
| 255 |
)
|
| 256 |
|
| 257 |
with gr.Row():
|
| 258 |
-
# width of textbox: Both columns are now scale=1, giving you a perfect 50/50 split!
|
| 259 |
with gr.Column(scale=1):
|
| 260 |
-
dna_input = gr.Textbox(label="Enter DNA Sequence", placeholder="e.g., ATGCGATCGATCGATCG...", lines=
|
| 261 |
run_mapping_cb = gr.Checkbox(value=False, label="Query NCBI BLAST for spatial mapping (Takes 1β3 mins)")
|
| 262 |
-
|
| 263 |
-
submit_btn = gr.Button("π Initialize Deep Scan", variant={"primary", "stop"})
|
| 264 |
|
| 265 |
-
# width of textbox: Changed from scale=2 to scale=1
|
| 266 |
with gr.Column(scale=1):
|
| 267 |
output_summary = gr.Textbox(label=" Classification Summary", lines=4)
|
| 268 |
stats_panel = gr.Textbox(label=" Internal Pipeline Statistics", lines=4)
|
|
|
|
| 226 |
|
| 227 |
return summary, "\n".join(stats_lines), context_output, ""
|
| 228 |
|
| 229 |
+
# --- CUSTOM CSS ---
|
| 230 |
+
custom_css = """
|
| 231 |
+
#scan_btn {
|
| 232 |
+
background-color: #0d6efd !important; /* Deep Blue */
|
| 233 |
+
color: white !important;
|
| 234 |
+
border: none !important;
|
| 235 |
+
transition: 0.3s ease;
|
| 236 |
+
}
|
| 237 |
+
#scan_btn:hover {
|
| 238 |
+
background-color: #dc3545 !important; /* Striking Red */
|
| 239 |
+
}
|
| 240 |
+
"""
|
| 241 |
+
|
| 242 |
# --- THE UI LAYOUT ---
|
| 243 |
+
with gr.Blocks(theme=gr.themes.Soft(), title="𧬠The Genomic Oracle π§¬", css=custom_css) as demo:
|
| 244 |
|
| 245 |
+
# 1. The Custom HTML Title
|
| 246 |
gr.HTML(
|
| 247 |
"""
|
| 248 |
<div style="text-align: center; padding-bottom: 10px;">
|
| 249 |
<h1 style="font-size: 3.5rem; font-weight: bold; margin-bottom: 0.2rem;">𧬠The Genomic Oracle π§¬</h1>
|
| 250 |
+
<h3 style="margin-top: 0; font-weight: normal;"><b>University of Maryland Global Campus (UMGC)</b> | Bioinformatics Capstone Project</h3>
|
| 251 |
</div>
|
| 252 |
<hr>
|
| 253 |
"""
|
|
|
|
| 259 |
Welcome to the official interface for **The Genomic Oracle**, a cascaded machine learning pipeline designed for high-precision DNA sequence classification.
|
| 260 |
|
| 261 |
### The 4-Stage Cascading Architecture
|
| 262 |
+
1. **The Gatekeeper:** Logistic Regression Model rapidly screens raw k-mer vectors to identify protein-coding vs. non-coding potential.
|
| 263 |
+
2. **Structural Mapper:** LightGBM Model classifies the sequence into 1 of 7 structural features (e.g., Exons, UTRs, Enhancers).
|
| 264 |
+
3. **Phenotype Prediction:** Sequences flagged as Coding are passed through a custom ALiBi BERT transformer to predict specific traits.
|
| 265 |
+
4. **Regulatory Validation:** Sequences flagged as Non-Coding Promoters are routed to a DNABERT-2 spatial attention neural network.
|
| 266 |
+
|
| 267 |
+
Created by: Kadir Galindo, Duncan Hall, Rebecca Mellinger & George Paccione
|
| 268 |
---
|
| 269 |
"""
|
| 270 |
)
|
| 271 |
|
| 272 |
with gr.Row():
|
|
|
|
| 273 |
with gr.Column(scale=1):
|
| 274 |
+
dna_input = gr.Textbox(label="Enter DNA Sequence", placeholder="e.g., ATGCGATCGATCGATCG...", lines=12)
|
| 275 |
run_mapping_cb = gr.Checkbox(value=False, label="Query NCBI BLAST for spatial mapping (Takes 1β3 mins)")
|
| 276 |
+
submit_btn = gr.Button("π Initialize Deep Scan", elem_id="scan_btn")
|
|
|
|
| 277 |
|
|
|
|
| 278 |
with gr.Column(scale=1):
|
| 279 |
output_summary = gr.Textbox(label=" Classification Summary", lines=4)
|
| 280 |
stats_panel = gr.Textbox(label=" Internal Pipeline Statistics", lines=4)
|