Update app.py
Browse files
app.py
CHANGED
|
@@ -146,6 +146,47 @@ PROTEINS = ["albumin","apolipoprotein","fibrinogen","vitronectin",
|
|
| 146 |
"clusterin","igm","iga","igg","complement","transferrin",
|
| 147 |
"alpha-2-macroglobulin"]
|
| 148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
# ── LOGIC ─────────────────────────────────────────────────────────────────────
|
| 150 |
def predict_mirna(gene):
|
| 151 |
df = pd.DataFrame(MIRNA_DB.get(gene, []))
|
|
@@ -168,7 +209,7 @@ def predict_drug(pocket):
|
|
| 168 |
ax.barh(df["Compound"], df["Final_score"], color=ACC)
|
| 169 |
ax.set_xlabel("Final Score", color=TXT); ax.tick_params(colors=TXT)
|
| 170 |
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 171 |
-
ax.set_title(f"Top compounds
|
| 172 |
plt.tight_layout()
|
| 173 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 174 |
log_entry("S1-C | S1-R5 | Drug", pocket, f"Top: {df.iloc[0]['Compound'] if len(df) else 'none'}")
|
|
@@ -187,17 +228,18 @@ def predict_variant(hgvs, sift, polyphen, gnomad):
|
|
| 187 |
cls = "Pathogenic" if score > 0.6 else "Likely Pathogenic" if score > 0.4 else "Benign"
|
| 188 |
conf = "High" if (sift < 0.01 or sift > 0.9) else "Moderate"
|
| 189 |
colour = RED if "Pathogenic" in cls else GRN
|
| 190 |
-
icon = "
|
| 191 |
log_entry("S1-A | S1-R1 | OpenVariant", hgvs or f"SIFT={sift}", f"{cls} score={score}")
|
|
|
|
| 192 |
return (
|
| 193 |
-
f"<div style=
|
| 194 |
-
f"<p style=
|
| 195 |
-
f"<h3 style=
|
| 196 |
-
f"<p>Score: <b>{score:.3f}</b>
|
| 197 |
-
f"<div style=
|
| 198 |
-
f"<div style=
|
| 199 |
-
f"<p style=
|
| 200 |
-
f"<p style=
|
| 201 |
)
|
| 202 |
|
| 203 |
def predict_corona(size, zeta, peg, lipid):
|
|
@@ -232,10 +274,10 @@ def predict_cancer(c1,c2,c3,c4,c5,c6,c7,c8,c9,c10):
|
|
| 232 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 233 |
log_entry("S1-E | S1-R9 | LiquidBiopsy", f"CTHRC1={c1},FHL2={c2}", f"{label} {prob:.2f}")
|
| 234 |
return (
|
| 235 |
-
f"<div style=
|
| 236 |
-
f"<p style=
|
| 237 |
-
f"<span style=
|
| 238 |
-
f"<span style=
|
| 239 |
), Image.open(buf)
|
| 240 |
|
| 241 |
def predict_flow(size, zeta, peg, charge, flow_rate):
|
|
@@ -252,11 +294,11 @@ def predict_flow(size, zeta, peg, charge, flow_rate):
|
|
| 252 |
ax.set_xlabel("Time (min)", color=TXT); ax.set_ylabel("% Corona", color=TXT)
|
| 253 |
ax.tick_params(colors=TXT); ax.legend(fontsize=7, labelcolor=TXT, facecolor=CARD)
|
| 254 |
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 255 |
-
ax.set_title("Vroman Effect
|
| 256 |
plt.tight_layout()
|
| 257 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 258 |
log_entry("S1-D | S1-R7 | FlowCorona", f"flow={flow_rate}", f"CSI={csi}")
|
| 259 |
-
return f"**Corona Shift Index: {csi}**
|
| 260 |
|
| 261 |
def predict_bbb(smiles, pka, zeta):
|
| 262 |
logp = smiles.count("C")*0.3 - smiles.count("O")*0.5 + 1.5
|
|
@@ -275,7 +317,7 @@ def predict_bbb(smiles, pka, zeta):
|
|
| 275 |
plt.tight_layout()
|
| 276 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 277 |
log_entry("S1-D | S1-R8 | LNPBrain", f"pka={pka},zeta={zeta}", f"ApoE={apoe_pct:.1f}%")
|
| 278 |
-
return f"**Predicted ApoE:** {apoe_pct:.1f}%
|
| 279 |
|
| 280 |
def extract_corona(text):
|
| 281 |
out = {"nanoparticle_composition":"","size_nm":None,"zeta_mv":None,"PDI":None,
|
|
@@ -300,54 +342,6 @@ def extract_corona(text):
|
|
| 300 |
log_entry("S1-D | S1-R10 | NLP", text[:80], f"proteins={len(out['corona_proteins'])}")
|
| 301 |
return json.dumps(out, indent=2), summary
|
| 302 |
|
| 303 |
-
|
| 304 |
-
# ── S1-F · PHYLO-RARE DATABASES ───────────────────────────────────────────────
|
| 305 |
-
|
| 306 |
-
# S1-R12b · DIPG — H3K27M + CSF LNP + Circadian
|
| 307 |
-
DIPG_VARIANTS = [
|
| 308 |
-
{"Variant":"H3K27M (H3F3A)","Freq_pct":78,"Pathway":"PRC2 inhibition → global H3K27me3 loss","Drug_status":"ONC201 (clinical)","Circadian_gene":"BMAL1 suppressed"},
|
| 309 |
-
{"Variant":"ACVR1 p.R206H","Freq_pct":21,"Pathway":"BMP/SMAD hyperactivation","Drug_status":"LDN-193189 (preclinical)","Circadian_gene":"PER1 disrupted"},
|
| 310 |
-
{"Variant":"PIK3CA p.H1047R","Freq_pct":15,"Pathway":"PI3K/AKT/mTOR","Drug_status":"Copanlisib (clinical)","Circadian_gene":"CRY1 altered"},
|
| 311 |
-
{"Variant":"TP53 p.R248W","Freq_pct":14,"Pathway":"DNA damage response loss","Drug_status":"APR-246 (clinical)","Circadian_gene":"p53-CLOCK axis"},
|
| 312 |
-
{"Variant":"PDGFRA amp","Freq_pct":13,"Pathway":"RTK/RAS signalling","Drug_status":"Avapritinib (clinical)","Circadian_gene":"REV-ERB altered"},
|
| 313 |
-
]
|
| 314 |
-
DIPG_CSF_LNP = [
|
| 315 |
-
{"Formulation":"MC3-DSPC-Chol-PEG","Size_nm":92,"Zeta_mV":-4.1,"CSF_protein":"Beta2-microglobulin","ApoE_pct":12.4,"BBB_est":0.41,"Priority":"HIGH"},
|
| 316 |
-
{"Formulation":"DLin-KC2-DSPE-PEG","Size_nm":87,"Zeta_mV":-3.8,"CSF_protein":"Cystatin C","ApoE_pct":14.1,"BBB_est":0.47,"Priority":"HIGH"},
|
| 317 |
-
{"Formulation":"C12-200-DOPE-PEG","Size_nm":103,"Zeta_mV":-5.2,"CSF_protein":"Albumin (low)","ApoE_pct":9.8,"BBB_est":0.33,"Priority":"MEDIUM"},
|
| 318 |
-
{"Formulation":"DODAP-DSPC-Chol","Size_nm":118,"Zeta_mV":-2.1,"CSF_protein":"Transferrin","ApoE_pct":7.2,"BBB_est":0.24,"Priority":"LOW"},
|
| 319 |
-
]
|
| 320 |
-
|
| 321 |
-
# S1-R12c · UVM — GNAQ/GNA11 + Vitreous corona + m6A
|
| 322 |
-
UVM_VARIANTS = [
|
| 323 |
-
{"Variant":"GNAQ p.Q209L","Freq_pct":46,"Pathway":"PLCβ → PKC → MAPK","Drug_status":"Darovasertib (clinical)","m6A_writer":"METTL3 upregulated"},
|
| 324 |
-
{"Variant":"GNA11 p.Q209L","Freq_pct":32,"Pathway":"PLCβ → PKC → MAPK","Drug_status":"Darovasertib (clinical)","m6A_writer":"WTAP upregulated"},
|
| 325 |
-
{"Variant":"BAP1 loss","Freq_pct":47,"Pathway":"Chromatin remodeling → metastasis","Drug_status":"No approved (HDAC trials)","m6A_writer":"FTO overexpressed"},
|
| 326 |
-
{"Variant":"SF3B1 p.R625H","Freq_pct":19,"Pathway":"Splicing alteration → neoepitopes","Drug_status":"H3B-8800 (clinical)","m6A_writer":"METTL14 altered"},
|
| 327 |
-
{"Variant":"EIF1AX p.A113_splice","Freq_pct":14,"Pathway":"Translation initiation","Drug_status":"Novel — no drug","m6A_writer":"YTHDF2 suppressed"},
|
| 328 |
-
]
|
| 329 |
-
UVM_VITREOUS_LNP = [
|
| 330 |
-
{"Formulation":"SM-102-DSPC-Chol-PEG","Vitreal_protein":"Hyaluronan-binding","Size_nm":95,"Zeta_mV":-3.2,"Retention_h":18,"Priority":"HIGH"},
|
| 331 |
-
{"Formulation":"Lipid-H-DOPE-PEG","Vitreal_protein":"Vitronectin dominant","Size_nm":88,"Zeta_mV":-4.0,"Retention_h":22,"Priority":"HIGH"},
|
| 332 |
-
{"Formulation":"DOTAP-DSPC-PEG","Vitreal_protein":"Albumin wash-out","Size_nm":112,"Zeta_mV":+2.1,"Retention_h":6,"Priority":"LOW"},
|
| 333 |
-
{"Formulation":"MC3-DPPC-Chol","Vitreal_protein":"Clusterin-rich","Size_nm":101,"Zeta_mV":-2.8,"Retention_h":14,"Priority":"MEDIUM"},
|
| 334 |
-
]
|
| 335 |
-
|
| 336 |
-
# S1-R12d · pAML — FLT3-ITD + BM niche corona + Ferroptosis
|
| 337 |
-
PAML_VARIANTS = [
|
| 338 |
-
{"Variant":"FLT3-ITD","Freq_pct":25,"Pathway":"RTK constitutive activation → JAK/STAT","Drug_status":"Midostaurin (approved)","Ferroptosis":"GPX4 suppressed"},
|
| 339 |
-
{"Variant":"NPM1 c.860_863dupTCAG","Freq_pct":30,"Pathway":"Nuclear export deregulation","Drug_status":"APR-548 combo (clinical)","Ferroptosis":"SLC7A11 upregulated"},
|
| 340 |
-
{"Variant":"DNMT3A p.R882H","Freq_pct":18,"Pathway":"Epigenetic dysregulation","Drug_status":"Azacitidine (approved)","Ferroptosis":"ACSL4 altered"},
|
| 341 |
-
{"Variant":"CEBPA biallelic","Freq_pct":8,"Pathway":"Myeloid differentiation block","Drug_status":"Novel target","Ferroptosis":"NRF2 pathway"},
|
| 342 |
-
{"Variant":"IDH1/2 mutation","Freq_pct":15,"Pathway":"2-HG oncometabolite → TET2 inhibition","Drug_status":"Enasidenib (approved)","Ferroptosis":"Iron metabolism disrupted"},
|
| 343 |
-
]
|
| 344 |
-
PAML_BM_LNP = [
|
| 345 |
-
{"Formulation":"ALC-0315-DSPC-Chol-PEG","BM_protein":"ApoE + Clusterin","Size_nm":98,"Zeta_mV":-3.5,"Marrow_uptake_pct":34,"Priority":"HIGH"},
|
| 346 |
-
{"Formulation":"MC3-DOPE-Chol-PEG","BM_protein":"Fibronectin dominant","Size_nm":105,"Zeta_mV":-4.2,"Marrow_uptake_pct":28,"Priority":"HIGH"},
|
| 347 |
-
{"Formulation":"DLin-MC3-DPPC","BM_protein":"Vitronectin-rich","Size_nm":91,"Zeta_mV":-2.9,"Marrow_uptake_pct":19,"Priority":"MEDIUM"},
|
| 348 |
-
{"Formulation":"Cationic-DOTAP-Chol","BM_protein":"Opsonin-heavy","Size_nm":132,"Zeta_mV":+8.1,"Marrow_uptake_pct":8,"Priority":"LOW"},
|
| 349 |
-
]
|
| 350 |
-
|
| 351 |
# ── S1-F · PHYLO-RARE LOGIC ───────────────────────────────────────────────────
|
| 352 |
def dipg_variants(sort_by):
|
| 353 |
df = pd.DataFrame(DIPG_VARIANTS).sort_values(
|
|
@@ -366,7 +360,7 @@ def dipg_csf(peg, size):
|
|
| 366 |
ax.set_xlabel("ApoE% in CSF corona", color=TXT)
|
| 367 |
ax.tick_params(colors=TXT, labelsize=8)
|
| 368 |
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 369 |
-
ax.set_title("DIPG
|
| 370 |
plt.tight_layout()
|
| 371 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 372 |
log_entry("S1-F | S1-R12b | DIPG-CSF", f"peg={peg},size={size}", "formulation ranking")
|
|
@@ -386,7 +380,7 @@ def uvm_vitreous():
|
|
| 386 |
ax.set_xlabel("Vitreous retention (hours)", color=TXT)
|
| 387 |
ax.tick_params(colors=TXT, labelsize=8)
|
| 388 |
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 389 |
-
ax.set_title("UVM
|
| 390 |
plt.tight_layout()
|
| 391 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 392 |
log_entry("S1-F | S1-R12c | UVM-vitreous", "load", "vitreous LNP ranking")
|
|
@@ -394,12 +388,11 @@ def uvm_vitreous():
|
|
| 394 |
|
| 395 |
def paml_ferroptosis(variant):
|
| 396 |
row = next((r for r in PAML_VARIANTS if variant in r["Variant"]), PAML_VARIANTS[0])
|
| 397 |
-
score = 0
|
| 398 |
ferr_map = {"GPX4 suppressed": 0.85, "SLC7A11 upregulated": 0.72,
|
| 399 |
"ACSL4 altered": 0.61, "NRF2 pathway": 0.55, "Iron metabolism disrupted": 0.78}
|
| 400 |
ferr_score = ferr_map.get(row["Ferroptosis"], 0.5)
|
| 401 |
cats = ["Ferroptosis\nsensitivity", "Drug\navailable", "BM niche\ncoverage", "Data\nmaturity", "Target\nnovelty"]
|
| 402 |
-
has_drug = 0.9 if row["Drug_status"]
|
| 403 |
vals = [ferr_score, has_drug, 0.6, 0.55, 1-has_drug+0.2]
|
| 404 |
angles = np.linspace(0, 2*np.pi, len(cats), endpoint=False).tolist()
|
| 405 |
v2, a2 = vals+[vals[0]], angles+[angles[0]]
|
|
@@ -408,7 +401,7 @@ def paml_ferroptosis(variant):
|
|
| 408 |
ax.plot(a2, v2, color=ACC2, linewidth=2); ax.fill(a2, v2, color=ACC2, alpha=0.2)
|
| 409 |
ax.set_xticks(angles); ax.set_xticklabels(cats, color=TXT, fontsize=8)
|
| 410 |
ax.tick_params(colors=TXT)
|
| 411 |
-
ax.set_title(f"pAML
|
| 412 |
plt.tight_layout()
|
| 413 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 414 |
log_entry("S1-F | S1-R12d | pAML-ferroptosis", variant, f"ferr={ferr_score:.2f}")
|
|
@@ -419,7 +412,7 @@ def paml_ferroptosis(variant):
|
|
| 419 |
_fs = f"{ferr_score:.2f}"
|
| 420 |
summary = (
|
| 421 |
f"<div style='background:{CARD};padding:14px;border-radius:8px;font-family:sans-serif;'>"
|
| 422 |
-
f"<p style='color:{DIM};font-size:11px;margin:0 0 6px'>S1-F
|
| 423 |
f"<b style='color:{ACC2};font-size:15px'>{_v}</b><br>"
|
| 424 |
f"<p style='color:{TXT};margin:6px 0'><b>Pathway:</b> {_p}</p>"
|
| 425 |
f"<p style='color:{TXT};margin:0'><b>Drug:</b> {_d}</p>"
|
|
@@ -433,24 +426,24 @@ def paml_ferroptosis(variant):
|
|
| 433 |
# ── HELPERS ───────────────────────────────────────────────────────────────────
|
| 434 |
def section_header(code, name, tagline, projects_html):
|
| 435 |
return (
|
| 436 |
-
f"<div style=
|
| 437 |
-
f"border-radius:8px;margin-bottom:12px;
|
| 438 |
-
f"<div style=
|
| 439 |
-
f"<span style=
|
| 440 |
-
f"<span style=
|
| 441 |
-
f"<span style=
|
| 442 |
-
f"<div style=
|
| 443 |
f"</div>"
|
| 444 |
)
|
| 445 |
|
| 446 |
def proj_badge(code, title, metric=""):
|
| 447 |
-
m = (f"<span style=
|
| 448 |
-
f"font-size:10px;margin-left:6px
|
| 449 |
return (
|
| 450 |
-
f"<div style=
|
| 451 |
-
f"padding:8px 12px;border-radius:0 6px 6px 0;margin-bottom:8px;
|
| 452 |
-
f"<span style=
|
| 453 |
-
f"<span style=
|
| 454 |
f"</div>"
|
| 455 |
)
|
| 456 |
|
|
@@ -458,7 +451,6 @@ def proj_badge(code, title, metric=""):
|
|
| 458 |
css = f"""
|
| 459 |
body, .gradio-container {{ background: {BG} !important; color: {TXT} !important; }}
|
| 460 |
|
| 461 |
-
/* OUTER tab bar — PHYLO categories */
|
| 462 |
.outer-tabs .tab-nav button {{
|
| 463 |
color: {TXT} !important;
|
| 464 |
background: {CARD} !important;
|
|
@@ -473,7 +465,6 @@ body, .gradio-container {{ background: {BG} !important; color: {TXT} !important;
|
|
| 473 |
background: {BG} !important;
|
| 474 |
}}
|
| 475 |
|
| 476 |
-
/* INNER sub-tab bar — individual tools */
|
| 477 |
.inner-tabs .tab-nav button {{
|
| 478 |
color: {DIM} !important;
|
| 479 |
background: {BG} !important;
|
|
@@ -508,108 +499,84 @@ MAP_HTML = f"""
|
|
| 508 |
<div style="background:{CARD};padding:22px;border-radius:8px;font-family:monospace;
|
| 509 |
font-size:13px;line-height:2.0;color:{TXT}">
|
| 510 |
|
| 511 |
-
<span style="color:{ACC};font-size:16px;font-weight:bold">K R&D Lab
|
| 512 |
-
<span style="color:{DIM};font-size:11px;margin-left:12px">Science Sphere
|
| 513 |
<br><br>
|
| 514 |
|
| 515 |
-
<span style="color:{ACC2};font-weight:600">S1-A
|
| 516 |
-
<span style="color:{DIM}">
|
| 517 |
-
|
| 518 |
-
<span style="color:
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
<span style="color:{DIM}">
|
| 523 |
-
|
| 524 |
-
<span style="color:{
|
| 525 |
-
<span style="color:{
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
<span style="color:{
|
| 530 |
-
|
| 531 |
-
<span style="color:
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
<span style="color:{
|
| 536 |
-
<span style="color:{
|
| 537 |
-
|
| 538 |
-
<span style="color:{GRN}">
|
| 539 |
-
|
| 540 |
-
<span style="color:
|
| 541 |
-
|
| 542 |
-
<span style="color:{
|
| 543 |
-
|
| 544 |
-
<span style="color:{
|
| 545 |
-
<span style="color:
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
<span style="color:{
|
| 550 |
-
|
| 551 |
-
<span style="color:
|
| 552 |
-
|
| 553 |
-
<span style="color:{GRN}"> F1=0.71 ✅</span><br>
|
| 554 |
-
└─ <b>S1-R11</b> CSF · Vitreous · Bone Marrow ⭐
|
| 555 |
-
<span style="color:{DIM}"> 🔴 0 prior studies</span><br><br>
|
| 556 |
-
|
| 557 |
-
<span style="color:{ACC2};font-weight:600">S1-E · PHYLO-BIOMARKERS</span>
|
| 558 |
-
<span style="color:{DIM}"> — Detect without biopsy</span><br>
|
| 559 |
-
├─ <b>S1-R9</b> Liquid Biopsy classifier
|
| 560 |
-
<span style="color:{GRN}"> AUC=0.992* ✅</span><br>
|
| 561 |
-
├─ <b>S1-R9b</b> Protein panel validator
|
| 562 |
-
<span style="color:#f59e0b"> 🔶</span><br>
|
| 563 |
-
└─ <b>S1-R9c</b> ctDNA gap analysis
|
| 564 |
-
<span style="color:{DIM}"> 🔴</span><br><br>
|
| 565 |
-
|
| 566 |
-
<span style="color:{ACC2};font-weight:600">S1-F · PHYLO-RARE</span>
|
| 567 |
-
<span style="color:{DIM}"> — Where almost nobody has looked yet (<300 cases/yr)</span><br>
|
| 568 |
-
├─ <b>S1-R12b</b> DIPG toolkit (H3K27M + CSF LNP + Circadian)
|
| 569 |
-
<span style="color:#f59e0b"> 🔶 In development</span><br>
|
| 570 |
-
├─ <b>S1-R12c</b> UVM toolkit (GNAQ/GNA11 + vitreous + m6A)
|
| 571 |
-
<span style="color:#f59e0b"> 🔶 In development</span><br>
|
| 572 |
-
└─ <b>S1-R12d</b> pAML toolkit (FLT3-ITD + BM niche + ferroptosis)
|
| 573 |
-
<span style="color:#f59e0b"> 🔶 In development</span><br><br>
|
| 574 |
|
| 575 |
<span style="color:{DIM};font-size:11px">
|
| 576 |
-
|
| 577 |
-
|
| 578 |
</span>
|
| 579 |
</div>
|
| 580 |
"""
|
| 581 |
|
| 582 |
# ── UI ────────────────────────────────────────────────────────────────────────
|
| 583 |
-
with gr.Blocks(css=css, title="K R&D Lab
|
| 584 |
|
| 585 |
gr.Markdown(
|
| 586 |
-
"#
|
| 587 |
-
"**Oksana Kolisnyk**
|
| 588 |
-
"[GitHub](https://github.com/K-RnD-Lab)
|
| 589 |
-
"[HuggingFace](https://huggingface.co/K-RnD-Lab)
|
| 590 |
"*Research only. Not clinical advice.*"
|
| 591 |
)
|
| 592 |
|
| 593 |
-
# ═══════════════════════════════════════════════════════
|
| 594 |
-
# OUTER TABS — one per PHYLO-* category
|
| 595 |
-
# ═════════════════���═════════════════════════════════════
|
| 596 |
with gr.Tabs(elem_classes="outer-tabs"):
|
| 597 |
|
| 598 |
-
# ──
|
| 599 |
-
with gr.
|
| 600 |
gr.HTML(MAP_HTML)
|
| 601 |
|
| 602 |
-
# ──
|
| 603 |
-
with gr.
|
| 604 |
gr.HTML(section_header(
|
| 605 |
-
"S1-A", "PHYLO-GENOMICS", "
|
| 606 |
-
"S1-R1 OpenVariant
|
| 607 |
))
|
| 608 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 609 |
|
| 610 |
-
with gr.
|
| 611 |
-
gr.HTML(proj_badge("S1-A
|
| 612 |
-
"OpenVariant
|
| 613 |
hgvs = gr.Textbox(label="HGVS notation", placeholder="BRCA1:p.R1699Q")
|
| 614 |
gr.Markdown("**Or enter functional scores manually:**")
|
| 615 |
with gr.Row():
|
|
@@ -623,56 +590,56 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 623 |
["BRCA2:p.D2723A",0.01,0.98,0.0]], inputs=[hgvs,sift,pp,gn])
|
| 624 |
b_v.click(predict_variant, [hgvs,sift,pp,gn], o_v)
|
| 625 |
|
| 626 |
-
with gr.
|
| 627 |
-
gr.HTML(proj_badge("S1-A
|
| 628 |
-
"Somatic Mutation Classifier
|
| 629 |
gr.Markdown("> This module is in active development. Coming in the next release.")
|
| 630 |
|
| 631 |
-
# ──
|
| 632 |
-
with gr.
|
| 633 |
gr.HTML(section_header(
|
| 634 |
-
"S1-B", "PHYLO-RNA", "
|
| 635 |
-
"S1-R2 miRNA
|
| 636 |
))
|
| 637 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 638 |
|
| 639 |
-
with gr.
|
| 640 |
-
gr.HTML(proj_badge("S1-B
|
| 641 |
-
"miRNA Silencing
|
| 642 |
g1 = gr.Dropdown(["BRCA2","BRCA1","TP53"], value="BRCA2", label="Gene")
|
| 643 |
b1 = gr.Button("Find miRNAs", variant="primary")
|
| 644 |
o1 = gr.Dataframe(label="Top 5 downregulated miRNAs")
|
| 645 |
gr.Examples([["BRCA2"],["BRCA1"],["TP53"]], inputs=[g1])
|
| 646 |
b1.click(predict_mirna, g1, o1)
|
| 647 |
|
| 648 |
-
with gr.
|
| 649 |
-
gr.HTML(proj_badge("S1-B
|
| 650 |
-
"siRNA Synthetic Lethal
|
| 651 |
g2 = gr.Dropdown(["LUAD","BRCA","COAD"], value="LUAD", label="Cancer type")
|
| 652 |
b2 = gr.Button("Find Targets", variant="primary")
|
| 653 |
o2 = gr.Dataframe(label="Top 5 synthetic lethal targets")
|
| 654 |
gr.Examples([["LUAD"],["BRCA"],["COAD"]], inputs=[g2])
|
| 655 |
b2.click(predict_sirna, g2, o2)
|
| 656 |
|
| 657 |
-
with gr.
|
| 658 |
-
gr.HTML(proj_badge("S1-B
|
| 659 |
-
"lncRNA-TREM2 ceRNA Network + ASO Candidates
|
| 660 |
b3 = gr.Button("Load Results", variant="primary")
|
| 661 |
o3a = gr.Dataframe(label="ceRNA Network (S1-R4)")
|
| 662 |
o3b = gr.Dataframe(label="ASO Candidates (S1-R4b)")
|
| 663 |
b3.click(get_lncrna, [], [o3a, o3b])
|
| 664 |
|
| 665 |
-
# ──
|
| 666 |
-
with gr.
|
| 667 |
gr.HTML(section_header(
|
| 668 |
-
"S1-C", "PHYLO-DRUG", "
|
| 669 |
-
"S1-R5 FGFR3
|
| 670 |
))
|
| 671 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 672 |
|
| 673 |
-
with gr.
|
| 674 |
-
gr.HTML(proj_badge("S1-C
|
| 675 |
-
"FGFR3 RNA-Directed Drug Discovery
|
| 676 |
"top score 0.793"))
|
| 677 |
g4 = gr.Radio(["P1 (hairpin loop)","P10 (G-quadruplex)"],
|
| 678 |
value="P1 (hairpin loop)", label="Target pocket")
|
|
@@ -682,25 +649,25 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 682 |
gr.Examples([["P1 (hairpin loop)"],["P10 (G-quadruplex)"]], inputs=[g4])
|
| 683 |
b4.click(predict_drug, g4, [o4t, o4p])
|
| 684 |
|
| 685 |
-
with gr.
|
| 686 |
-
gr.HTML(proj_badge("S1-C
|
| 687 |
-
"m6A
|
| 688 |
gr.Markdown(
|
| 689 |
"> **Research gap:** This triple intersection has never been studied as an integrated system.\n\n"
|
| 690 |
-
"> **Planned datasets:** TCGA-PAAD
|
| 691 |
"> **Expected timeline:** Q3 2026"
|
| 692 |
)
|
| 693 |
|
| 694 |
-
# ──
|
| 695 |
-
with gr.
|
| 696 |
gr.HTML(section_header(
|
| 697 |
-
"S1-D", "PHYLO-LNP", "
|
| 698 |
-
"S1-R6 Corona
|
| 699 |
))
|
| 700 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 701 |
|
| 702 |
-
with gr.
|
| 703 |
-
gr.HTML(proj_badge("S1-D
|
| 704 |
"LNP Protein Corona (Serum)", "AUC = 0.791"))
|
| 705 |
with gr.Row():
|
| 706 |
sz = gr.Slider(50,300,value=100,step=1,label="Size (nm)")
|
|
@@ -712,9 +679,9 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 712 |
gr.Examples([[100,-5,1.5,"Ionizable"],[80,5,0.5,"Cationic"]], inputs=[sz,zt,pg,lp])
|
| 713 |
b6.click(predict_corona, [sz,zt,pg,lp], o6)
|
| 714 |
|
| 715 |
-
with gr.
|
| 716 |
-
gr.HTML(proj_badge("S1-D
|
| 717 |
-
"Flow Corona
|
| 718 |
with gr.Row():
|
| 719 |
s8 = gr.Slider(50,300,value=100,step=1,label="Size (nm)")
|
| 720 |
z8 = gr.Slider(-40,10,value=-5,step=1,label="Zeta (mV)")
|
|
@@ -727,9 +694,9 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 727 |
gr.Examples([[100,-5,1.5,"Ionizable",40],[150,5,0.5,"Cationic",10]], inputs=[s8,z8,pg8,ch8,fl8])
|
| 728 |
b8.click(predict_flow, [s8,z8,pg8,ch8,fl8], [o8t,o8p])
|
| 729 |
|
| 730 |
-
with gr.
|
| 731 |
-
gr.HTML(proj_badge("S1-D
|
| 732 |
-
"LNP Brain Delivery
|
| 733 |
smi = gr.Textbox(label="Ionizable lipid SMILES",
|
| 734 |
value="CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C")
|
| 735 |
with gr.Row():
|
|
@@ -740,9 +707,9 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 740 |
gr.Examples([["CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C",6.5,-3]], inputs=[smi,pk,zt9])
|
| 741 |
b9.click(predict_bbb, [smi,pk,zt9], [o9t,o9p])
|
| 742 |
|
| 743 |
-
with gr.
|
| 744 |
-
gr.HTML(proj_badge("S1-D
|
| 745 |
-
"AutoCorona NLP
|
| 746 |
txt = gr.Textbox(lines=5,label="Paper abstract",placeholder="Paste abstract here...")
|
| 747 |
b10 = gr.Button("Extract Data", variant="primary")
|
| 748 |
o10j = gr.Code(label="Extracted JSON", language="json")
|
|
@@ -754,27 +721,27 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 754 |
]], inputs=[txt])
|
| 755 |
b10.click(extract_corona, txt, [o10j, o10f])
|
| 756 |
|
| 757 |
-
with gr.
|
| 758 |
-
gr.HTML(proj_badge("S1-D
|
| 759 |
-
"LNP Corona in CSF
|
| 760 |
gr.Markdown(
|
| 761 |
"> **Research gap:** Protein corona has only been characterized in serum/plasma. "
|
| 762 |
"CSF, vitreous humor, and bone marrow interstitial fluid remain completely unstudied.\n\n"
|
| 763 |
-
"> **Target cancers:** DIPG (CSF)
|
| 764 |
-
"> **Expected timeline:** Q2
|
| 765 |
)
|
| 766 |
|
| 767 |
-
# ──
|
| 768 |
-
with gr.
|
| 769 |
gr.HTML(section_header(
|
| 770 |
-
"S1-E", "PHYLO-BIOMARKERS", "
|
| 771 |
-
"S1-R9 Liquid Biopsy
|
| 772 |
))
|
| 773 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 774 |
|
| 775 |
-
with gr.
|
| 776 |
-
gr.HTML(proj_badge("S1-E
|
| 777 |
-
"Liquid Biopsy Classifier
|
| 778 |
"AUC = 0.992*"))
|
| 779 |
with gr.Row():
|
| 780 |
p1=gr.Slider(-3,3,value=0,step=0.1,label="CTHRC1")
|
|
@@ -794,92 +761,149 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 794 |
inputs=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10])
|
| 795 |
b7.click(predict_cancer, [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10], [o7t,o7p])
|
| 796 |
|
| 797 |
-
with gr.
|
| 798 |
-
gr.HTML(proj_badge("S1-E
|
| 799 |
-
"Protein Panel Validator
|
| 800 |
-
gr.Markdown("> Coming next
|
| 801 |
|
| 802 |
-
# ──
|
| 803 |
-
with gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 804 |
gr.Markdown("### Lab Journal\nEvery tool call auto-logged with project code.")
|
| 805 |
with gr.Row():
|
| 806 |
-
note_text = gr.Textbox(label="
|
| 807 |
note_tab = gr.Textbox(label="Project code (e.g. S1-R1)", value="General")
|
| 808 |
note_last = gr.Textbox(visible=False)
|
| 809 |
-
save_btn = gr.Button("
|
| 810 |
save_msg = gr.Markdown()
|
| 811 |
-
journal_df = gr.Dataframe(label="
|
| 812 |
-
refresh_btn = gr.Button("
|
| 813 |
refresh_btn.click(load_journal, [], journal_df)
|
| 814 |
save_btn.click(save_note, [note_text,note_tab,note_last], [save_msg,journal_df])
|
| 815 |
|
| 816 |
-
# ──
|
| 817 |
-
with gr.
|
| 818 |
gr.Markdown("""
|
| 819 |
-
##
|
| 820 |
-
>
|
| 821 |
|
| 822 |
---
|
| 823 |
-
###
|
| 824 |
**Why does the same position give two different outcomes?**
|
| 825 |
-
1. PHYLO-GENOMICS
|
| 826 |
-
2. Enter `BRCA1:p.R1699W`
|
| 827 |
-
3. Same position, different amino acid
|
| 828 |
|
| 829 |
---
|
| 830 |
-
###
|
| 831 |
**How does PEG% control which protein coats the nanoparticle?**
|
| 832 |
-
1. PHYLO-LNP
|
| 833 |
-
2. Change PEG=
|
| 834 |
-
3. Brain tab
|
| 835 |
|
| 836 |
---
|
| 837 |
-
###
|
| 838 |
**Does blood flow reshape the corona over time?**
|
| 839 |
-
1. PHYLO-LNP
|
| 840 |
-
2. Flow=40 (arterial)
|
| 841 |
3. At what minute does ApoE dominate?
|
| 842 |
|
| 843 |
---
|
| 844 |
-
###
|
| 845 |
**Which cancer has the most novel (undrugged) siRNA targets?**
|
| 846 |
-
1. PHYLO-RNA
|
| 847 |
2. Repeat BRCA, COAD
|
| 848 |
|
| 849 |
---
|
| 850 |
-
###
|
| 851 |
**Minimum protein signal that flips to CANCER?**
|
| 852 |
-
1. PHYLO-BIOMARKERS
|
| 853 |
-
2. Set CTHRC1=2.5, FHL2=2.0, LDHA=1.8
|
| 854 |
3. Reset. Increase only CTHRC1 step by step.
|
| 855 |
|
| 856 |
---
|
| 857 |
-
###
|
| 858 |
-
1. PHYLO-
|
| 859 |
-
2. PHYLO-
|
| 860 |
-
3. PHYLO-
|
| 861 |
|
| 862 |
---
|
| 863 |
-
###
|
| 864 |
| Code | Module | Tool | Metric |
|
| 865 |
|------|--------|------|--------|
|
| 866 |
| S1-R1 | PHYLO-GENOMICS | OpenVariant | AUC=0.939 |
|
| 867 |
| S1-R2 | PHYLO-RNA | miRNA silencing | top: hsa-miR-148a |
|
| 868 |
| S1-R3 | PHYLO-RNA | siRNA SL | SPC24 top LUAD |
|
| 869 |
-
| S1-R4 | PHYLO-RNA | lncRNA-TREM2 | CYTOR
|
| 870 |
| S1-R5 | PHYLO-DRUG | FGFR3 drug | score=0.793 |
|
| 871 |
| S1-R6 | PHYLO-LNP | Corona | AUC=0.791 |
|
| 872 |
-
| S1-R7 | PHYLO-LNP | Flow Vroman | 3
|
| 873 |
-
| S1-R8 | PHYLO-LNP | LNP Brain | pKa 6.2
|
| 874 |
| S1-R9 | PHYLO-BIOMARKERS | Liquid Biopsy | AUC=0.992* |
|
| 875 |
| S1-R10 | PHYLO-LNP | AutoCorona NLP | F1=0.71 |
|
|
|
|
|
|
|
|
|
|
| 876 |
""")
|
| 877 |
|
| 878 |
gr.Markdown(
|
| 879 |
-
"---\n**K R&D Lab**
|
| 880 |
-
"[GitHub](https://github.com/K-RnD-Lab)
|
| 881 |
-
"[HuggingFace](https://huggingface.co/K-RnD-Lab)
|
| 882 |
-
"[KOSATIKS GROUP
|
| 883 |
)
|
| 884 |
|
| 885 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 146 |
"clusterin","igm","iga","igg","complement","transferrin",
|
| 147 |
"alpha-2-macroglobulin"]
|
| 148 |
|
| 149 |
+
# ── S1-F · PHYLO-RARE DATABASES ───────────────────────────────────────────────
|
| 150 |
+
DIPG_VARIANTS = [
|
| 151 |
+
{"Variant":"H3K27M (H3F3A)","Freq_pct":78,"Pathway":"PRC2 inhibition -> global H3K27me3 loss","Drug_status":"ONC201 (clinical)","Circadian_gene":"BMAL1 suppressed"},
|
| 152 |
+
{"Variant":"ACVR1 p.R206H","Freq_pct":21,"Pathway":"BMP/SMAD hyperactivation","Drug_status":"LDN-193189 (preclinical)","Circadian_gene":"PER1 disrupted"},
|
| 153 |
+
{"Variant":"PIK3CA p.H1047R","Freq_pct":15,"Pathway":"PI3K/AKT/mTOR","Drug_status":"Copanlisib (clinical)","Circadian_gene":"CRY1 altered"},
|
| 154 |
+
{"Variant":"TP53 p.R248W","Freq_pct":14,"Pathway":"DNA damage response loss","Drug_status":"APR-246 (clinical)","Circadian_gene":"p53-CLOCK axis"},
|
| 155 |
+
{"Variant":"PDGFRA amp","Freq_pct":13,"Pathway":"RTK/RAS signalling","Drug_status":"Avapritinib (clinical)","Circadian_gene":"REV-ERB altered"},
|
| 156 |
+
]
|
| 157 |
+
DIPG_CSF_LNP = [
|
| 158 |
+
{"Formulation":"MC3-DSPC-Chol-PEG","Size_nm":92,"Zeta_mV":-4.1,"CSF_protein":"Beta2-microglobulin","ApoE_pct":12.4,"BBB_est":0.41,"Priority":"HIGH"},
|
| 159 |
+
{"Formulation":"DLin-KC2-DSPE-PEG","Size_nm":87,"Zeta_mV":-3.8,"CSF_protein":"Cystatin C","ApoE_pct":14.1,"BBB_est":0.47,"Priority":"HIGH"},
|
| 160 |
+
{"Formulation":"C12-200-DOPE-PEG","Size_nm":103,"Zeta_mV":-5.2,"CSF_protein":"Albumin (low)","ApoE_pct":9.8,"BBB_est":0.33,"Priority":"MEDIUM"},
|
| 161 |
+
{"Formulation":"DODAP-DSPC-Chol","Size_nm":118,"Zeta_mV":-2.1,"CSF_protein":"Transferrin","ApoE_pct":7.2,"BBB_est":0.24,"Priority":"LOW"},
|
| 162 |
+
]
|
| 163 |
+
UVM_VARIANTS = [
|
| 164 |
+
{"Variant":"GNAQ p.Q209L","Freq_pct":46,"Pathway":"PLCb -> PKC -> MAPK","Drug_status":"Darovasertib (clinical)","m6A_writer":"METTL3 upregulated"},
|
| 165 |
+
{"Variant":"GNA11 p.Q209L","Freq_pct":32,"Pathway":"PLCb -> PKC -> MAPK","Drug_status":"Darovasertib (clinical)","m6A_writer":"WTAP upregulated"},
|
| 166 |
+
{"Variant":"BAP1 loss","Freq_pct":47,"Pathway":"Chromatin remodeling -> metastasis","Drug_status":"No approved (HDAC trials)","m6A_writer":"FTO overexpressed"},
|
| 167 |
+
{"Variant":"SF3B1 p.R625H","Freq_pct":19,"Pathway":"Splicing alteration -> neoepitopes","Drug_status":"H3B-8800 (clinical)","m6A_writer":"METTL14 altered"},
|
| 168 |
+
{"Variant":"EIF1AX p.A113_splice","Freq_pct":14,"Pathway":"Translation initiation","Drug_status":"Novel -- no drug","m6A_writer":"YTHDF2 suppressed"},
|
| 169 |
+
]
|
| 170 |
+
UVM_VITREOUS_LNP = [
|
| 171 |
+
{"Formulation":"SM-102-DSPC-Chol-PEG","Vitreal_protein":"Hyaluronan-binding","Size_nm":95,"Zeta_mV":-3.2,"Retention_h":18,"Priority":"HIGH"},
|
| 172 |
+
{"Formulation":"Lipid-H-DOPE-PEG","Vitreal_protein":"Vitronectin dominant","Size_nm":88,"Zeta_mV":-4.0,"Retention_h":22,"Priority":"HIGH"},
|
| 173 |
+
{"Formulation":"DOTAP-DSPC-PEG","Vitreal_protein":"Albumin wash-out","Size_nm":112,"Zeta_mV":+2.1,"Retention_h":6,"Priority":"LOW"},
|
| 174 |
+
{"Formulation":"MC3-DPPC-Chol","Vitreal_protein":"Clusterin-rich","Size_nm":101,"Zeta_mV":-2.8,"Retention_h":14,"Priority":"MEDIUM"},
|
| 175 |
+
]
|
| 176 |
+
PAML_VARIANTS = [
|
| 177 |
+
{"Variant":"FLT3-ITD","Freq_pct":25,"Pathway":"RTK constitutive activation -> JAK/STAT","Drug_status":"Midostaurin (approved)","Ferroptosis":"GPX4 suppressed"},
|
| 178 |
+
{"Variant":"NPM1 c.860_863dupTCAG","Freq_pct":30,"Pathway":"Nuclear export deregulation","Drug_status":"APR-548 combo (clinical)","Ferroptosis":"SLC7A11 upregulated"},
|
| 179 |
+
{"Variant":"DNMT3A p.R882H","Freq_pct":18,"Pathway":"Epigenetic dysregulation","Drug_status":"Azacitidine (approved)","Ferroptosis":"ACSL4 altered"},
|
| 180 |
+
{"Variant":"CEBPA biallelic","Freq_pct":8,"Pathway":"Myeloid differentiation block","Drug_status":"Novel target","Ferroptosis":"NRF2 pathway"},
|
| 181 |
+
{"Variant":"IDH1/2 mutation","Freq_pct":15,"Pathway":"2-HG oncometabolite -> TET2 inhibition","Drug_status":"Enasidenib (approved)","Ferroptosis":"Iron metabolism disrupted"},
|
| 182 |
+
]
|
| 183 |
+
PAML_BM_LNP = [
|
| 184 |
+
{"Formulation":"ALC-0315-DSPC-Chol-PEG","BM_protein":"ApoE + Clusterin","Size_nm":98,"Zeta_mV":-3.5,"Marrow_uptake_pct":34,"Priority":"HIGH"},
|
| 185 |
+
{"Formulation":"MC3-DOPE-Chol-PEG","BM_protein":"Fibronectin dominant","Size_nm":105,"Zeta_mV":-4.2,"Marrow_uptake_pct":28,"Priority":"HIGH"},
|
| 186 |
+
{"Formulation":"DLin-MC3-DPPC","BM_protein":"Vitronectin-rich","Size_nm":91,"Zeta_mV":-2.9,"Marrow_uptake_pct":19,"Priority":"MEDIUM"},
|
| 187 |
+
{"Formulation":"Cationic-DOTAP-Chol","BM_protein":"Opsonin-heavy","Size_nm":132,"Zeta_mV":+8.1,"Marrow_uptake_pct":8,"Priority":"LOW"},
|
| 188 |
+
]
|
| 189 |
+
|
| 190 |
# ── LOGIC ─────────────────────────────────────────────────────────────────────
|
| 191 |
def predict_mirna(gene):
|
| 192 |
df = pd.DataFrame(MIRNA_DB.get(gene, []))
|
|
|
|
| 209 |
ax.barh(df["Compound"], df["Final_score"], color=ACC)
|
| 210 |
ax.set_xlabel("Final Score", color=TXT); ax.tick_params(colors=TXT)
|
| 211 |
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 212 |
+
ax.set_title(f"Top compounds - {pocket}", color=TXT, fontsize=10)
|
| 213 |
plt.tight_layout()
|
| 214 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 215 |
log_entry("S1-C | S1-R5 | Drug", pocket, f"Top: {df.iloc[0]['Compound'] if len(df) else 'none'}")
|
|
|
|
| 228 |
cls = "Pathogenic" if score > 0.6 else "Likely Pathogenic" if score > 0.4 else "Benign"
|
| 229 |
conf = "High" if (sift < 0.01 or sift > 0.9) else "Moderate"
|
| 230 |
colour = RED if "Pathogenic" in cls else GRN
|
| 231 |
+
icon = "WARNING" if "Pathogenic" in cls else "OK"
|
| 232 |
log_entry("S1-A | S1-R1 | OpenVariant", hgvs or f"SIFT={sift}", f"{cls} score={score}")
|
| 233 |
+
bar_w = int(score * 100)
|
| 234 |
return (
|
| 235 |
+
f"<div style='background:{CARD};padding:16px;border-radius:8px;font-family:sans-serif;color:{TXT}'>"
|
| 236 |
+
f"<p style='font-size:11px;color:{DIM};margin:0 0 8px'>S1-A · PHYLO-GENOMICS · S1-R1</p>"
|
| 237 |
+
f"<h3 style='color:{colour};margin:0 0 8px'>{icon} {cls}</h3>"
|
| 238 |
+
f"<p>Score: <b>{score:.3f}</b> | Confidence: <b>{conf}</b></p>"
|
| 239 |
+
f"<div style='background:{BORDER};border-radius:4px;height:14px'>"
|
| 240 |
+
f"<div style='background:{colour};height:14px;border-radius:4px;width:{bar_w}%'></div></div>"
|
| 241 |
+
f"<p style='margin-top:12px'>{PLAIN.get(cls,'')}</p>"
|
| 242 |
+
f"<p style='font-size:11px;color:{DIM}'>Research only. Not clinical advice.</p></div>"
|
| 243 |
)
|
| 244 |
|
| 245 |
def predict_corona(size, zeta, peg, lipid):
|
|
|
|
| 274 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 275 |
log_entry("S1-E | S1-R9 | LiquidBiopsy", f"CTHRC1={c1},FHL2={c2}", f"{label} {prob:.2f}")
|
| 276 |
return (
|
| 277 |
+
f"<div style='background:{CARD};padding:14px;border-radius:8px;font-family:sans-serif;'>"
|
| 278 |
+
f"<p style='font-size:11px;color:{DIM};margin:0 0 6px'>S1-E · PHYLO-BIOMARKERS · S1-R9</p>"
|
| 279 |
+
f"<span style='color:{colour};font-size:24px;font-weight:bold'>{label}</span><br>"
|
| 280 |
+
f"<span style='color:{TXT};font-size:14px'>Probability: {prob:.2f}</span></div>"
|
| 281 |
), Image.open(buf)
|
| 282 |
|
| 283 |
def predict_flow(size, zeta, peg, charge, flow_rate):
|
|
|
|
| 294 |
ax.set_xlabel("Time (min)", color=TXT); ax.set_ylabel("% Corona", color=TXT)
|
| 295 |
ax.tick_params(colors=TXT); ax.legend(fontsize=7, labelcolor=TXT, facecolor=CARD)
|
| 296 |
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 297 |
+
ax.set_title("Vroman Effect - flow vs static", color=TXT, fontsize=9)
|
| 298 |
plt.tight_layout()
|
| 299 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 300 |
log_entry("S1-D | S1-R7 | FlowCorona", f"flow={flow_rate}", f"CSI={csi}")
|
| 301 |
+
return f"**Corona Shift Index: {csi}** - {stability}", Image.open(buf)
|
| 302 |
|
| 303 |
def predict_bbb(smiles, pka, zeta):
|
| 304 |
logp = smiles.count("C")*0.3 - smiles.count("O")*0.5 + 1.5
|
|
|
|
| 317 |
plt.tight_layout()
|
| 318 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 319 |
log_entry("S1-D | S1-R8 | LNPBrain", f"pka={pka},zeta={zeta}", f"ApoE={apoe_pct:.1f}%")
|
| 320 |
+
return f"**Predicted ApoE:** {apoe_pct:.1f}% - {tier}\n\n**BBB Probability:** {bbb_prob:.2f}", Image.open(buf)
|
| 321 |
|
| 322 |
def extract_corona(text):
|
| 323 |
out = {"nanoparticle_composition":"","size_nm":None,"zeta_mv":None,"PDI":None,
|
|
|
|
| 342 |
log_entry("S1-D | S1-R10 | NLP", text[:80], f"proteins={len(out['corona_proteins'])}")
|
| 343 |
return json.dumps(out, indent=2), summary
|
| 344 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 345 |
# ── S1-F · PHYLO-RARE LOGIC ───────────────────────────────────────────────────
|
| 346 |
def dipg_variants(sort_by):
|
| 347 |
df = pd.DataFrame(DIPG_VARIANTS).sort_values(
|
|
|
|
| 360 |
ax.set_xlabel("ApoE% in CSF corona", color=TXT)
|
| 361 |
ax.tick_params(colors=TXT, labelsize=8)
|
| 362 |
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 363 |
+
ax.set_title("DIPG - CSF LNP formulations (ApoE%)", color=TXT, fontsize=9)
|
| 364 |
plt.tight_layout()
|
| 365 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 366 |
log_entry("S1-F | S1-R12b | DIPG-CSF", f"peg={peg},size={size}", "formulation ranking")
|
|
|
|
| 380 |
ax.set_xlabel("Vitreous retention (hours)", color=TXT)
|
| 381 |
ax.tick_params(colors=TXT, labelsize=8)
|
| 382 |
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 383 |
+
ax.set_title("UVM - LNP retention in vitreous humor", color=TXT, fontsize=9)
|
| 384 |
plt.tight_layout()
|
| 385 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 386 |
log_entry("S1-F | S1-R12c | UVM-vitreous", "load", "vitreous LNP ranking")
|
|
|
|
| 388 |
|
| 389 |
def paml_ferroptosis(variant):
|
| 390 |
row = next((r for r in PAML_VARIANTS if variant in r["Variant"]), PAML_VARIANTS[0])
|
|
|
|
| 391 |
ferr_map = {"GPX4 suppressed": 0.85, "SLC7A11 upregulated": 0.72,
|
| 392 |
"ACSL4 altered": 0.61, "NRF2 pathway": 0.55, "Iron metabolism disrupted": 0.78}
|
| 393 |
ferr_score = ferr_map.get(row["Ferroptosis"], 0.5)
|
| 394 |
cats = ["Ferroptosis\nsensitivity", "Drug\navailable", "BM niche\ncoverage", "Data\nmaturity", "Target\nnovelty"]
|
| 395 |
+
has_drug = 0.9 if row["Drug_status"] != "Novel target" else 0.3
|
| 396 |
vals = [ferr_score, has_drug, 0.6, 0.55, 1-has_drug+0.2]
|
| 397 |
angles = np.linspace(0, 2*np.pi, len(cats), endpoint=False).tolist()
|
| 398 |
v2, a2 = vals+[vals[0]], angles+[angles[0]]
|
|
|
|
| 401 |
ax.plot(a2, v2, color=ACC2, linewidth=2); ax.fill(a2, v2, color=ACC2, alpha=0.2)
|
| 402 |
ax.set_xticks(angles); ax.set_xticklabels(cats, color=TXT, fontsize=8)
|
| 403 |
ax.tick_params(colors=TXT)
|
| 404 |
+
ax.set_title(f"pAML - {row['Variant'][:20]}", color=TXT, fontsize=9)
|
| 405 |
plt.tight_layout()
|
| 406 |
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 407 |
log_entry("S1-F | S1-R12d | pAML-ferroptosis", variant, f"ferr={ferr_score:.2f}")
|
|
|
|
| 412 |
_fs = f"{ferr_score:.2f}"
|
| 413 |
summary = (
|
| 414 |
f"<div style='background:{CARD};padding:14px;border-radius:8px;font-family:sans-serif;'>"
|
| 415 |
+
f"<p style='color:{DIM};font-size:11px;margin:0 0 6px'>S1-F - PHYLO-RARE - S1-R12d - pAML</p>"
|
| 416 |
f"<b style='color:{ACC2};font-size:15px'>{_v}</b><br>"
|
| 417 |
f"<p style='color:{TXT};margin:6px 0'><b>Pathway:</b> {_p}</p>"
|
| 418 |
f"<p style='color:{TXT};margin:0'><b>Drug:</b> {_d}</p>"
|
|
|
|
| 426 |
# ── HELPERS ───────────────────────────────────────────────────────────────────
|
| 427 |
def section_header(code, name, tagline, projects_html):
|
| 428 |
return (
|
| 429 |
+
f"<div style='background:{BG};border:1px solid {BORDER};padding:14px 18px;"
|
| 430 |
+
f"border-radius:8px;margin-bottom:12px;'>"
|
| 431 |
+
f"<div style='display:flex;align-items:baseline;gap:10px;'>"
|
| 432 |
+
f"<span style='color:{ACC2};font-size:16px;font-weight:700'>{code}</span>"
|
| 433 |
+
f"<span style='color:{TXT};font-size:14px;font-weight:600'>{name}</span>"
|
| 434 |
+
f"<span style='color:{DIM};font-size:12px'>{tagline}</span></div>"
|
| 435 |
+
f"<div style='margin-top:8px;font-size:12px;color:{DIM}'>{projects_html}</div>"
|
| 436 |
f"</div>"
|
| 437 |
)
|
| 438 |
|
| 439 |
def proj_badge(code, title, metric=""):
|
| 440 |
+
m = (f"<span style='background:#0f2a3f;color:{ACC2};padding:1px 7px;border-radius:3px;"
|
| 441 |
+
f"font-size:10px;margin-left:6px'>{metric}</span>") if metric else ""
|
| 442 |
return (
|
| 443 |
+
f"<div style='background:{CARD};border-left:3px solid {ACC};"
|
| 444 |
+
f"padding:8px 12px;border-radius:0 6px 6px 0;margin-bottom:8px;'>"
|
| 445 |
+
f"<span style='color:{DIM};font-size:11px'>{code}</span>{m}<br>"
|
| 446 |
+
f"<span style='color:{TXT};font-size:14px;font-weight:600'>{title}</span>"
|
| 447 |
f"</div>"
|
| 448 |
)
|
| 449 |
|
|
|
|
| 451 |
css = f"""
|
| 452 |
body, .gradio-container {{ background: {BG} !important; color: {TXT} !important; }}
|
| 453 |
|
|
|
|
| 454 |
.outer-tabs .tab-nav button {{
|
| 455 |
color: {TXT} !important;
|
| 456 |
background: {CARD} !important;
|
|
|
|
| 465 |
background: {BG} !important;
|
| 466 |
}}
|
| 467 |
|
|
|
|
| 468 |
.inner-tabs .tab-nav button {{
|
| 469 |
color: {DIM} !important;
|
| 470 |
background: {BG} !important;
|
|
|
|
| 499 |
<div style="background:{CARD};padding:22px;border-radius:8px;font-family:monospace;
|
| 500 |
font-size:13px;line-height:2.0;color:{TXT}">
|
| 501 |
|
| 502 |
+
<span style="color:{ACC};font-size:16px;font-weight:bold">K R&D Lab - S1 Biomedical</span>
|
| 503 |
+
<span style="color:{DIM};font-size:11px;margin-left:12px">Science Sphere - sub-direction 1</span>
|
| 504 |
<br><br>
|
| 505 |
|
| 506 |
+
<span style="color:{ACC2};font-weight:600">S1-A - PHYLO-GENOMICS</span>
|
| 507 |
+
<span style="color:{DIM}"> - What breaks in DNA</span><br>
|
| 508 |
+
|- <b>S1-R1</b> OpenVariant <span style="color:{GRN}"> AUC=0.939 OK</span><br>
|
| 509 |
+
|- <b>S1-R1b</b> Somatic classifier <span style="color:#f59e0b"> In progress</span><br>
|
| 510 |
+
+- <b>S1-R12a</b> Rare variants (DIPG / UVM) <span style="color:{DIM}"> Planned</span><br><br>
|
| 511 |
+
|
| 512 |
+
<span style="color:{ACC2};font-weight:600">S1-B - PHYLO-RNA</span>
|
| 513 |
+
<span style="color:{DIM}"> - How to silence it via RNA</span><br>
|
| 514 |
+
|- <b>S1-R2</b> miRNA silencing (BRCA1/2, TP53) <span style="color:{GRN}"> OK</span><br>
|
| 515 |
+
|- <b>S1-R3</b> siRNA synthetic lethal (LUAD / BRCA / COAD) <span style="color:{GRN}"> OK</span><br>
|
| 516 |
+
|- <b>S1-R4</b> lncRNA-TREM2 ceRNA network <span style="color:{GRN}"> OK</span><br>
|
| 517 |
+
+- <b>S1-R4b</b> ASO designer <span style="color:{GRN}"> OK</span><br><br>
|
| 518 |
+
|
| 519 |
+
<span style="color:{ACC2};font-weight:600">S1-C - PHYLO-DRUG</span>
|
| 520 |
+
<span style="color:{DIM}"> - Which molecule treats it</span><br>
|
| 521 |
+
|- <b>S1-R5</b> FGFR3 RNA-directed compounds <span style="color:{GRN}"> OK</span><br>
|
| 522 |
+
|- <b>S1-R5b</b> Synthetic lethal drug mapping <span style="color:#f59e0b"> In progress</span><br>
|
| 523 |
+
+- <b>S1-R13</b> m6A x Ferroptosis x Circadian * <span style="color:{DIM}"> Frontier</span><br><br>
|
| 524 |
+
|
| 525 |
+
<span style="color:{ACC2};font-weight:600">S1-D - PHYLO-LNP</span>
|
| 526 |
+
<span style="color:{DIM}"> - How to deliver the drug</span><br>
|
| 527 |
+
|- <b>S1-R6</b> LNP corona (serum) <span style="color:{GRN}"> AUC=0.791 OK</span><br>
|
| 528 |
+
|- <b>S1-R7</b> Flow corona - Vroman effect <span style="color:{GRN}"> OK</span><br>
|
| 529 |
+
|- <b>S1-R8</b> LNP brain / BBB / ApoE <span style="color:{GRN}"> OK</span><br>
|
| 530 |
+
|- <b>S1-R10</b> AutoCorona NLP <span style="color:{GRN}"> F1=0.71 OK</span><br>
|
| 531 |
+
+- <b>S1-R11</b> CSF / Vitreous / Bone Marrow * <span style="color:{DIM}"> 0 prior studies</span><br><br>
|
| 532 |
+
|
| 533 |
+
<span style="color:{ACC2};font-weight:600">S1-E - PHYLO-BIOMARKERS</span>
|
| 534 |
+
<span style="color:{DIM}"> - Detect without biopsy</span><br>
|
| 535 |
+
|- <b>S1-R9</b> Liquid Biopsy classifier <span style="color:{GRN}"> AUC=0.992* OK</span><br>
|
| 536 |
+
|- <b>S1-R9b</b> Protein panel validator <span style="color:#f59e0b"> In progress</span><br>
|
| 537 |
+
+- <b>S1-R9c</b> ctDNA gap analysis <span style="color:{DIM}"> Planned</span><br><br>
|
| 538 |
+
|
| 539 |
+
<span style="color:{ACC2};font-weight:600">S1-F - PHYLO-RARE</span>
|
| 540 |
+
<span style="color:{DIM}"> - Where almost nobody has looked yet (<300 cases/yr)</span><br>
|
| 541 |
+
|- <b>S1-R12b</b> DIPG toolkit (H3K27M + CSF LNP + Circadian) <span style="color:#f59e0b"> In development</span><br>
|
| 542 |
+
|- <b>S1-R12c</b> UVM toolkit (GNAQ/GNA11 + vitreous + m6A) <span style="color:#f59e0b"> In development</span><br>
|
| 543 |
+
+- <b>S1-R12d</b> pAML toolkit (FLT3-ITD + BM niche + ferroptosis) <span style="color:#f59e0b"> In development</span><br><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 544 |
|
| 545 |
<span style="color:{DIM};font-size:11px">
|
| 546 |
+
OK = Active in this demo | In progress | Planned / Frontier<br>
|
| 547 |
+
* gap research (0-1 prior studies globally) | * tissue proxy, plasma validation pending
|
| 548 |
</span>
|
| 549 |
</div>
|
| 550 |
"""
|
| 551 |
|
| 552 |
# ── UI ────────────────────────────────────────────────────────────────────────
|
| 553 |
+
with gr.Blocks(css=css, title="K R&D Lab - S1 Biomedical") as demo:
|
| 554 |
|
| 555 |
gr.Markdown(
|
| 556 |
+
"# K R&D Lab - Science Sphere - S1 Biomedical\n"
|
| 557 |
+
"**Oksana Kolisnyk** - [KOSATIKS GROUP](https://kosatiks-group.pp.ua) | "
|
| 558 |
+
"[GitHub](https://github.com/K-RnD-Lab) "
|
| 559 |
+
"[HuggingFace](https://huggingface.co/K-RnD-Lab) | "
|
| 560 |
"*Research only. Not clinical advice.*"
|
| 561 |
)
|
| 562 |
|
|
|
|
|
|
|
|
|
|
| 563 |
with gr.Tabs(elem_classes="outer-tabs"):
|
| 564 |
|
| 565 |
+
# ── MAP ─────────────────────────────────────────────
|
| 566 |
+
with gr.Tab("Lab Map"):
|
| 567 |
gr.HTML(MAP_HTML)
|
| 568 |
|
| 569 |
+
# ── S1-A PHYLO-GENOMICS ─────────────────────────────
|
| 570 |
+
with gr.Tab("S1-A PHYLO-GENOMICS"):
|
| 571 |
gr.HTML(section_header(
|
| 572 |
+
"S1-A", "PHYLO-GENOMICS", "- What breaks in DNA",
|
| 573 |
+
"S1-R1 OpenVariant OK | S1-R1b Somatic classifier in progress | S1-R12a Rare variants planned"
|
| 574 |
))
|
| 575 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 576 |
|
| 577 |
+
with gr.Tab("S1-R1 OpenVariant"):
|
| 578 |
+
gr.HTML(proj_badge("S1-A - PHYLO-GENOMICS - S1-R1",
|
| 579 |
+
"OpenVariant - SNV Pathogenicity Classifier", "AUC = 0.939"))
|
| 580 |
hgvs = gr.Textbox(label="HGVS notation", placeholder="BRCA1:p.R1699Q")
|
| 581 |
gr.Markdown("**Or enter functional scores manually:**")
|
| 582 |
with gr.Row():
|
|
|
|
| 590 |
["BRCA2:p.D2723A",0.01,0.98,0.0]], inputs=[hgvs,sift,pp,gn])
|
| 591 |
b_v.click(predict_variant, [hgvs,sift,pp,gn], o_v)
|
| 592 |
|
| 593 |
+
with gr.Tab("S1-R1b Somatic"):
|
| 594 |
+
gr.HTML(proj_badge("S1-A - PHYLO-GENOMICS - S1-R1b",
|
| 595 |
+
"Somatic Mutation Classifier - BRCA / LUAD panels", "In progress"))
|
| 596 |
gr.Markdown("> This module is in active development. Coming in the next release.")
|
| 597 |
|
| 598 |
+
# ── S1-B PHYLO-RNA ──────────────────────────────────
|
| 599 |
+
with gr.Tab("S1-B PHYLO-RNA"):
|
| 600 |
gr.HTML(section_header(
|
| 601 |
+
"S1-B", "PHYLO-RNA", "- How to silence it via RNA",
|
| 602 |
+
"S1-R2 miRNA OK | S1-R3 siRNA OK | S1-R4 lncRNA OK | S1-R4b ASO OK"
|
| 603 |
))
|
| 604 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 605 |
|
| 606 |
+
with gr.Tab("S1-R2 miRNA"):
|
| 607 |
+
gr.HTML(proj_badge("S1-B - PHYLO-RNA - S1-R2",
|
| 608 |
+
"miRNA Silencing - BRCA1/2 / TP53 tumor suppressors"))
|
| 609 |
g1 = gr.Dropdown(["BRCA2","BRCA1","TP53"], value="BRCA2", label="Gene")
|
| 610 |
b1 = gr.Button("Find miRNAs", variant="primary")
|
| 611 |
o1 = gr.Dataframe(label="Top 5 downregulated miRNAs")
|
| 612 |
gr.Examples([["BRCA2"],["BRCA1"],["TP53"]], inputs=[g1])
|
| 613 |
b1.click(predict_mirna, g1, o1)
|
| 614 |
|
| 615 |
+
with gr.Tab("S1-R3 siRNA"):
|
| 616 |
+
gr.HTML(proj_badge("S1-B - PHYLO-RNA - S1-R3",
|
| 617 |
+
"siRNA Synthetic Lethal - TP53-null / LUAD / BRCA / COAD"))
|
| 618 |
g2 = gr.Dropdown(["LUAD","BRCA","COAD"], value="LUAD", label="Cancer type")
|
| 619 |
b2 = gr.Button("Find Targets", variant="primary")
|
| 620 |
o2 = gr.Dataframe(label="Top 5 synthetic lethal targets")
|
| 621 |
gr.Examples([["LUAD"],["BRCA"],["COAD"]], inputs=[g2])
|
| 622 |
b2.click(predict_sirna, g2, o2)
|
| 623 |
|
| 624 |
+
with gr.Tab("S1-R4 lncRNA ASO"):
|
| 625 |
+
gr.HTML(proj_badge("S1-B - PHYLO-RNA - S1-R4 + S1-R4b",
|
| 626 |
+
"lncRNA-TREM2 ceRNA Network + ASO Candidates - Alzheimer neuroinflammation"))
|
| 627 |
b3 = gr.Button("Load Results", variant="primary")
|
| 628 |
o3a = gr.Dataframe(label="ceRNA Network (S1-R4)")
|
| 629 |
o3b = gr.Dataframe(label="ASO Candidates (S1-R4b)")
|
| 630 |
b3.click(get_lncrna, [], [o3a, o3b])
|
| 631 |
|
| 632 |
+
# ── S1-C PHYLO-DRUG ─────────────────────────────────
|
| 633 |
+
with gr.Tab("S1-C PHYLO-DRUG"):
|
| 634 |
gr.HTML(section_header(
|
| 635 |
+
"S1-C", "PHYLO-DRUG", "- Which molecule treats it",
|
| 636 |
+
"S1-R5 FGFR3 OK | S1-R5b SL drug mapping in progress | S1-R13 m6A x Ferroptosis x Circadian frontier"
|
| 637 |
))
|
| 638 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 639 |
|
| 640 |
+
with gr.Tab("S1-R5 FGFR3"):
|
| 641 |
+
gr.HTML(proj_badge("S1-C - PHYLO-DRUG - S1-R5",
|
| 642 |
+
"FGFR3 RNA-Directed Drug Discovery - ChEMBL screen",
|
| 643 |
"top score 0.793"))
|
| 644 |
g4 = gr.Radio(["P1 (hairpin loop)","P10 (G-quadruplex)"],
|
| 645 |
value="P1 (hairpin loop)", label="Target pocket")
|
|
|
|
| 649 |
gr.Examples([["P1 (hairpin loop)"],["P10 (G-quadruplex)"]], inputs=[g4])
|
| 650 |
b4.click(predict_drug, g4, [o4t, o4p])
|
| 651 |
|
| 652 |
+
with gr.Tab("S1-R13 Frontier"):
|
| 653 |
+
gr.HTML(proj_badge("S1-C - PHYLO-DRUG - S1-R13",
|
| 654 |
+
"m6A x Ferroptosis x Circadian - Pan-cancer triad", "Frontier"))
|
| 655 |
gr.Markdown(
|
| 656 |
"> **Research gap:** This triple intersection has never been studied as an integrated system.\n\n"
|
| 657 |
+
"> **Planned datasets:** TCGA-PAAD - GEO m6A atlases - Circadian gene panels\n\n"
|
| 658 |
"> **Expected timeline:** Q3 2026"
|
| 659 |
)
|
| 660 |
|
| 661 |
+
# ── S1-D PHYLO-LNP ──────────────────────────────────
|
| 662 |
+
with gr.Tab("S1-D PHYLO-LNP"):
|
| 663 |
gr.HTML(section_header(
|
| 664 |
+
"S1-D", "PHYLO-LNP", "- How to deliver the drug to the cell",
|
| 665 |
+
"S1-R6 Corona OK | S1-R7 Flow OK | S1-R8 Brain OK | S1-R10 NLP OK | S1-R11 CSF/BM frontier"
|
| 666 |
))
|
| 667 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 668 |
|
| 669 |
+
with gr.Tab("S1-R6 Corona"):
|
| 670 |
+
gr.HTML(proj_badge("S1-D - PHYLO-LNP - S1-R6",
|
| 671 |
"LNP Protein Corona (Serum)", "AUC = 0.791"))
|
| 672 |
with gr.Row():
|
| 673 |
sz = gr.Slider(50,300,value=100,step=1,label="Size (nm)")
|
|
|
|
| 679 |
gr.Examples([[100,-5,1.5,"Ionizable"],[80,5,0.5,"Cationic"]], inputs=[sz,zt,pg,lp])
|
| 680 |
b6.click(predict_corona, [sz,zt,pg,lp], o6)
|
| 681 |
|
| 682 |
+
with gr.Tab("S1-R7 Flow"):
|
| 683 |
+
gr.HTML(proj_badge("S1-D - PHYLO-LNP - S1-R7",
|
| 684 |
+
"Flow Corona - Vroman Effect - albumin to ApoE kinetics"))
|
| 685 |
with gr.Row():
|
| 686 |
s8 = gr.Slider(50,300,value=100,step=1,label="Size (nm)")
|
| 687 |
z8 = gr.Slider(-40,10,value=-5,step=1,label="Zeta (mV)")
|
|
|
|
| 694 |
gr.Examples([[100,-5,1.5,"Ionizable",40],[150,5,0.5,"Cationic",10]], inputs=[s8,z8,pg8,ch8,fl8])
|
| 695 |
b8.click(predict_flow, [s8,z8,pg8,ch8,fl8], [o8t,o8p])
|
| 696 |
|
| 697 |
+
with gr.Tab("S1-R8 Brain"):
|
| 698 |
+
gr.HTML(proj_badge("S1-D - PHYLO-LNP - S1-R8",
|
| 699 |
+
"LNP Brain Delivery - ApoE% + BBB probability"))
|
| 700 |
smi = gr.Textbox(label="Ionizable lipid SMILES",
|
| 701 |
value="CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C")
|
| 702 |
with gr.Row():
|
|
|
|
| 707 |
gr.Examples([["CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C",6.5,-3]], inputs=[smi,pk,zt9])
|
| 708 |
b9.click(predict_bbb, [smi,pk,zt9], [o9t,o9p])
|
| 709 |
|
| 710 |
+
with gr.Tab("S1-R10 NLP"):
|
| 711 |
+
gr.HTML(proj_badge("S1-D - PHYLO-LNP - S1-R10",
|
| 712 |
+
"AutoCorona NLP - structured data from PMC abstracts", "F1 = 0.71"))
|
| 713 |
txt = gr.Textbox(lines=5,label="Paper abstract",placeholder="Paste abstract here...")
|
| 714 |
b10 = gr.Button("Extract Data", variant="primary")
|
| 715 |
o10j = gr.Code(label="Extracted JSON", language="json")
|
|
|
|
| 721 |
]], inputs=[txt])
|
| 722 |
b10.click(extract_corona, txt, [o10j, o10f])
|
| 723 |
|
| 724 |
+
with gr.Tab("S1-R11 CSF/BM"):
|
| 725 |
+
gr.HTML(proj_badge("S1-D - PHYLO-LNP - S1-R11",
|
| 726 |
+
"LNP Corona in CSF / Vitreous / Bone Marrow", "0 prior studies"))
|
| 727 |
gr.Markdown(
|
| 728 |
"> **Research gap:** Protein corona has only been characterized in serum/plasma. "
|
| 729 |
"CSF, vitreous humor, and bone marrow interstitial fluid remain completely unstudied.\n\n"
|
| 730 |
+
"> **Target cancers:** DIPG (CSF) / UVM (vitreous) / pAML (bone marrow)\n\n"
|
| 731 |
+
"> **Expected timeline:** Q2-Q3 2026"
|
| 732 |
)
|
| 733 |
|
| 734 |
+
# ── S1-E PHYLO-BIOMARKERS ───────────────────────────
|
| 735 |
+
with gr.Tab("S1-E PHYLO-BIOMARKERS"):
|
| 736 |
gr.HTML(section_header(
|
| 737 |
+
"S1-E", "PHYLO-BIOMARKERS", "- Detect cancer without tissue biopsy",
|
| 738 |
+
"S1-R9 Liquid Biopsy OK | S1-R9b Panel validator in progress | S1-R9c ctDNA gap planned"
|
| 739 |
))
|
| 740 |
with gr.Tabs(elem_classes="inner-tabs"):
|
| 741 |
|
| 742 |
+
with gr.Tab("S1-R9 Liquid Biopsy"):
|
| 743 |
+
gr.HTML(proj_badge("S1-E - PHYLO-BIOMARKERS - S1-R9",
|
| 744 |
+
"Liquid Biopsy Classifier - CTHRC1 / FHL2 / LDHA panel",
|
| 745 |
"AUC = 0.992*"))
|
| 746 |
with gr.Row():
|
| 747 |
p1=gr.Slider(-3,3,value=0,step=0.1,label="CTHRC1")
|
|
|
|
| 761 |
inputs=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10])
|
| 762 |
b7.click(predict_cancer, [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10], [o7t,o7p])
|
| 763 |
|
| 764 |
+
with gr.Tab("S1-R9b Validator"):
|
| 765 |
+
gr.HTML(proj_badge("S1-E - PHYLO-BIOMARKERS - S1-R9b",
|
| 766 |
+
"Protein Panel Validator - multi-cancer plasma validation", "In progress"))
|
| 767 |
+
gr.Markdown("> Coming next - validates S1-R9 results against GEO plasma proteomics datasets.")
|
| 768 |
|
| 769 |
+
# ── S1-F PHYLO-RARE ─────────────────────────────────
|
| 770 |
+
with gr.Tab("S1-F PHYLO-RARE"):
|
| 771 |
+
gr.HTML(section_header(
|
| 772 |
+
"S1-F", "PHYLO-RARE", "- Where almost nobody has looked yet (<300 cases/yr)",
|
| 773 |
+
"S1-R12b DIPG in development | S1-R12c UVM in development | S1-R12d pAML in development"
|
| 774 |
+
))
|
| 775 |
+
with gr.Tabs(elem_classes="inner-tabs"):
|
| 776 |
+
|
| 777 |
+
with gr.Tab("S1-R12b DIPG"):
|
| 778 |
+
gr.HTML(proj_badge("S1-F - PHYLO-RARE - S1-R12b",
|
| 779 |
+
"DIPG - H3K27M + CSF LNP + Circadian clock", "In development"))
|
| 780 |
+
gr.Markdown("**Variant landscape:**")
|
| 781 |
+
sort_by = gr.Radio(["Frequency","Drug status"], value="Frequency", label="Sort by")
|
| 782 |
+
b_dv = gr.Button("Load DIPG Variants", variant="primary")
|
| 783 |
+
o_dv = gr.Dataframe(label="DIPG variants")
|
| 784 |
+
b_dv.click(dipg_variants, sort_by, o_dv)
|
| 785 |
+
|
| 786 |
+
gr.Markdown("**CSF LNP formulation screen:**")
|
| 787 |
+
with gr.Row():
|
| 788 |
+
dipg_peg = gr.Slider(0,5,value=1.5,step=0.1,label="PEG mol%")
|
| 789 |
+
dipg_size = gr.Slider(50,200,value=95,step=5,label="Target size (nm)")
|
| 790 |
+
b_dc = gr.Button("Rank CSF Formulations", variant="primary")
|
| 791 |
+
o_dc_t = gr.Dataframe(label="CSF LNP ranking")
|
| 792 |
+
o_dc_p = gr.Image(label="ApoE% in CSF")
|
| 793 |
+
b_dc.click(dipg_csf, [dipg_peg, dipg_size], [o_dc_t, o_dc_p])
|
| 794 |
+
|
| 795 |
+
with gr.Tab("S1-R12c UVM"):
|
| 796 |
+
gr.HTML(proj_badge("S1-F - PHYLO-RARE - S1-R12c",
|
| 797 |
+
"Uveal Melanoma - GNAQ/GNA11 + vitreous corona + m6A", "In development"))
|
| 798 |
+
b_uv = gr.Button("Load UVM Variants", variant="primary")
|
| 799 |
+
o_uv = gr.Dataframe(label="UVM variants + m6A writers")
|
| 800 |
+
b_uv.click(uvm_variants, [], o_uv)
|
| 801 |
+
|
| 802 |
+
gr.Markdown("**Vitreous LNP retention screen:**")
|
| 803 |
+
b_vt = gr.Button("Rank Vitreous Formulations", variant="primary")
|
| 804 |
+
o_vt_t = gr.Dataframe(label="Vitreous LNP ranking")
|
| 805 |
+
o_vt_p = gr.Image(label="Retention time (hours)")
|
| 806 |
+
b_vt.click(uvm_vitreous, [], [o_vt_t, o_vt_p])
|
| 807 |
+
|
| 808 |
+
with gr.Tab("S1-R12d pAML"):
|
| 809 |
+
gr.HTML(proj_badge("S1-F - PHYLO-RARE - S1-R12d",
|
| 810 |
+
"pediatric AML - FLT3-ITD + BM niche + ferroptosis sensitivity", "In development"))
|
| 811 |
+
paml_var = gr.Dropdown(
|
| 812 |
+
["FLT3-ITD","NPM1 c.860_863dupTCAG","DNMT3A p.R882H","CEBPA biallelic","IDH1/2 mutation"],
|
| 813 |
+
value="FLT3-ITD", label="Select variant")
|
| 814 |
+
b_pf = gr.Button("Analyze Ferroptosis Profile", variant="primary")
|
| 815 |
+
o_pf_t = gr.HTML()
|
| 816 |
+
o_pf_p = gr.Image(label="Radar profile")
|
| 817 |
+
gr.Examples([["FLT3-ITD"],["NPM1 c.860_863dupTCAG"],["IDH1/2 mutation"]], inputs=[paml_var])
|
| 818 |
+
b_pf.click(paml_ferroptosis, paml_var, [o_pf_t, o_pf_p])
|
| 819 |
+
|
| 820 |
+
gr.Markdown("**Bone Marrow LNP niche formulations:**")
|
| 821 |
+
gr.Dataframe(value=pd.DataFrame(PAML_BM_LNP), label="BM LNP candidates")
|
| 822 |
+
|
| 823 |
+
# ── JOURNAL ─────��───────────────────────────────────
|
| 824 |
+
with gr.Tab("Journal"):
|
| 825 |
gr.Markdown("### Lab Journal\nEvery tool call auto-logged with project code.")
|
| 826 |
with gr.Row():
|
| 827 |
+
note_text = gr.Textbox(label="Observation", placeholder="What did you discover?", lines=3)
|
| 828 |
note_tab = gr.Textbox(label="Project code (e.g. S1-R1)", value="General")
|
| 829 |
note_last = gr.Textbox(visible=False)
|
| 830 |
+
save_btn = gr.Button("Save", variant="primary")
|
| 831 |
save_msg = gr.Markdown()
|
| 832 |
+
journal_df = gr.Dataframe(label="Full History", value=load_journal(), interactive=False)
|
| 833 |
+
refresh_btn = gr.Button("Refresh")
|
| 834 |
refresh_btn.click(load_journal, [], journal_df)
|
| 835 |
save_btn.click(save_note, [note_text,note_tab,note_last], [save_msg,journal_df])
|
| 836 |
|
| 837 |
+
# ── LEARNING ────────────────────────────────────────
|
| 838 |
+
with gr.Tab("Learning"):
|
| 839 |
gr.Markdown("""
|
| 840 |
+
## Guided Investigations - S1 Biomedical
|
| 841 |
+
> Beginner -> Intermediate -> Advanced
|
| 842 |
|
| 843 |
---
|
| 844 |
+
### Case 1 - S1-A - S1-R1
|
| 845 |
**Why does the same position give two different outcomes?**
|
| 846 |
+
1. PHYLO-GENOMICS -> OpenVariant -> `BRCA1:p.R1699Q` -> Benign
|
| 847 |
+
2. Enter `BRCA1:p.R1699W` -> Pathogenic
|
| 848 |
+
3. Same position, different amino acid - Q (polar) vs W (bulky-aromatic)
|
| 849 |
|
| 850 |
---
|
| 851 |
+
### Case 2 - S1-D - S1-R6 + S1-R8
|
| 852 |
**How does PEG% control which protein coats the nanoparticle?**
|
| 853 |
+
1. PHYLO-LNP -> Corona -> Ionizable, Zeta=-5, PEG=0.5% -> note protein
|
| 854 |
+
2. Change PEG=2.5% -> compare
|
| 855 |
+
3. Brain tab -> pKa=6.5 -> check ApoE%
|
| 856 |
|
| 857 |
---
|
| 858 |
+
### Case 3 - S1-D - S1-R7
|
| 859 |
**Does blood flow reshape the corona over time?**
|
| 860 |
+
1. PHYLO-LNP -> Flow -> Flow=0 -> observe ApoE curve
|
| 861 |
+
2. Flow=40 (arterial) -> compare
|
| 862 |
3. At what minute does ApoE dominate?
|
| 863 |
|
| 864 |
---
|
| 865 |
+
### Case 4 - S1-B - S1-R3
|
| 866 |
**Which cancer has the most novel (undrugged) siRNA targets?**
|
| 867 |
+
1. PHYLO-RNA -> siRNA -> LUAD -> count Novel
|
| 868 |
2. Repeat BRCA, COAD
|
| 869 |
|
| 870 |
---
|
| 871 |
+
### Case 5 - S1-E - S1-R9
|
| 872 |
**Minimum protein signal that flips to CANCER?**
|
| 873 |
+
1. PHYLO-BIOMARKERS -> Liquid Biopsy -> all=0 -> HEALTHY
|
| 874 |
+
2. Set CTHRC1=2.5, FHL2=2.0, LDHA=1.8 -> observe
|
| 875 |
3. Reset. Increase only CTHRC1 step by step.
|
| 876 |
|
| 877 |
---
|
| 878 |
+
### Case 6 - S1-F - S1-R12b + S1-R12d - Rare cancer cross-tool
|
| 879 |
+
1. PHYLO-RARE -> DIPG -> load variants -> note H3K27M frequency (78%)
|
| 880 |
+
2. PHYLO-RARE -> pAML -> FLT3-ITD -> check ferroptosis sensitivity
|
| 881 |
+
3. PHYLO-RARE -> UVM -> vitreous LNP -> which formulation has highest retention?
|
| 882 |
|
| 883 |
---
|
| 884 |
+
### Tool Index
|
| 885 |
| Code | Module | Tool | Metric |
|
| 886 |
|------|--------|------|--------|
|
| 887 |
| S1-R1 | PHYLO-GENOMICS | OpenVariant | AUC=0.939 |
|
| 888 |
| S1-R2 | PHYLO-RNA | miRNA silencing | top: hsa-miR-148a |
|
| 889 |
| S1-R3 | PHYLO-RNA | siRNA SL | SPC24 top LUAD |
|
| 890 |
+
| S1-R4 | PHYLO-RNA | lncRNA-TREM2 | CYTOR->AKT1 |
|
| 891 |
| S1-R5 | PHYLO-DRUG | FGFR3 drug | score=0.793 |
|
| 892 |
| S1-R6 | PHYLO-LNP | Corona | AUC=0.791 |
|
| 893 |
+
| S1-R7 | PHYLO-LNP | Flow Vroman | 3-4x faster |
|
| 894 |
+
| S1-R8 | PHYLO-LNP | LNP Brain | pKa 6.2-6.8 |
|
| 895 |
| S1-R9 | PHYLO-BIOMARKERS | Liquid Biopsy | AUC=0.992* |
|
| 896 |
| S1-R10 | PHYLO-LNP | AutoCorona NLP | F1=0.71 |
|
| 897 |
+
| S1-R12b | PHYLO-RARE | DIPG + CSF LNP | H3K27M=78% |
|
| 898 |
+
| S1-R12c | PHYLO-RARE | UVM vitreous | GNAQ=46% |
|
| 899 |
+
| S1-R12d | PHYLO-RARE | pAML ferroptosis | FLT3-ITD |
|
| 900 |
""")
|
| 901 |
|
| 902 |
gr.Markdown(
|
| 903 |
+
"---\n**K R&D Lab** - Science Sphere - S1 Biomedical - "
|
| 904 |
+
"[GitHub](https://github.com/K-RnD-Lab) - "
|
| 905 |
+
"[HuggingFace](https://huggingface.co/K-RnD-Lab) - "
|
| 906 |
+
"[KOSATIKS GROUP](https://kosatiks-group.pp.ua) - MIT License"
|
| 907 |
)
|
| 908 |
|
| 909 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|