TEZv commited on
Commit
30d2ccc
·
verified ·
1 Parent(s): 0a66b1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -22
app.py CHANGED
@@ -466,18 +466,18 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
466
  with gr.Tabs(elem_classes="outer-tabs"):
467
 
468
  # ── 🗺️ MAP ─────────────────────────────────────────
469
- with gr.TabItem("🗺️ Lab Map"):
470
  gr.HTML(MAP_HTML)
471
 
472
  # ── 🧬 S1-A · PHYLO-GENOMICS ───────────────────────
473
- with gr.TabItem("🧬 S1-A PHYLO-GENOMICS"):
474
  gr.HTML(section_header(
475
  "S1-A", "PHYLO-GENOMICS", "— What breaks in DNA",
476
  "S1-R1 OpenVariant ✅  ·  S1-R1b Somatic classifier 🔶  ·  S1-R12a Rare variants 🔴"
477
  ))
478
  with gr.Tabs(elem_classes="inner-tabs"):
479
 
480
- with gr.TabItem("S1-R1 · OpenVariant"):
481
  gr.HTML(proj_badge("S1-A · PHYLO-GENOMICS · S1-R1",
482
  "OpenVariant — SNV Pathogenicity Classifier", "AUC = 0.939"))
483
  hgvs = gr.Textbox(label="HGVS notation", placeholder="BRCA1:p.R1699Q")
@@ -493,20 +493,20 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
493
  ["BRCA2:p.D2723A",0.01,0.98,0.0]], inputs=[hgvs,sift,pp,gn])
494
  b_v.click(predict_variant, [hgvs,sift,pp,gn], o_v)
495
 
496
- with gr.TabItem("S1-R1b · Somatic 🔶"):
497
  gr.HTML(proj_badge("S1-A · PHYLO-GENOMICS · S1-R1b",
498
  "Somatic Mutation Classifier — BRCA · LUAD panels", "🔶 In progress"))
499
  gr.Markdown("> This module is in active development. Coming in the next release.")
500
 
501
  # ── 🔬 S1-B · PHYLO-RNA ────────────────────────────
502
- with gr.TabItem("🔬 S1-B PHYLO-RNA"):
503
  gr.HTML(section_header(
504
  "S1-B", "PHYLO-RNA", "— How to silence it via RNA",
505
  "S1-R2 miRNA ✅  ·  S1-R3 siRNA ✅  ·  S1-R4 lncRNA ✅  ·  S1-R4b ASO ✅"
506
  ))
507
  with gr.Tabs(elem_classes="inner-tabs"):
508
 
509
- with gr.TabItem("S1-R2 · miRNA"):
510
  gr.HTML(proj_badge("S1-B · PHYLO-RNA · S1-R2",
511
  "miRNA Silencing — BRCA1/2 · TP53 tumor suppressors"))
512
  g1 = gr.Dropdown(["BRCA2","BRCA1","TP53"], value="BRCA2", label="Gene")
@@ -515,7 +515,7 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
515
  gr.Examples([["BRCA2"],["BRCA1"],["TP53"]], inputs=[g1])
516
  b1.click(predict_mirna, g1, o1)
517
 
518
- with gr.TabItem("S1-R3 · siRNA"):
519
  gr.HTML(proj_badge("S1-B · PHYLO-RNA · S1-R3",
520
  "siRNA Synthetic Lethal — TP53-null · LUAD · BRCA · COAD"))
521
  g2 = gr.Dropdown(["LUAD","BRCA","COAD"], value="LUAD", label="Cancer type")
@@ -524,7 +524,7 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
524
  gr.Examples([["LUAD"],["BRCA"],["COAD"]], inputs=[g2])
525
  b2.click(predict_sirna, g2, o2)
526
 
527
- with gr.TabItem("S1-R4 · lncRNA + ASO"):
528
  gr.HTML(proj_badge("S1-B · PHYLO-RNA · S1-R4 + S1-R4b",
529
  "lncRNA-TREM2 ceRNA Network + ASO Candidates · Alzheimer neuroinflammation"))
530
  b3 = gr.Button("Load Results", variant="primary")
@@ -533,14 +533,14 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
533
  b3.click(get_lncrna, [], [o3a, o3b])
534
 
535
  # ── 💊 S1-C · PHYLO-DRUG ───────────────────────────
536
- with gr.TabItem("💊 S1-C PHYLO-DRUG"):
537
  gr.HTML(section_header(
538
  "S1-C", "PHYLO-DRUG", "— Which molecule treats it",
539
  "S1-R5 FGFR3 ✅  ·  S1-R5b SL drug mapping 🔶  ·  S1-R13 m6A×Ferroptosis×Circadian 🔴⭐"
540
  ))
541
  with gr.Tabs(elem_classes="inner-tabs"):
542
 
543
- with gr.TabItem("S1-R5 · FGFR3"):
544
  gr.HTML(proj_badge("S1-C · PHYLO-DRUG · S1-R5",
545
  "FGFR3 RNA-Directed Drug Discovery · ChEMBL screen",
546
  "top score 0.793"))
@@ -552,7 +552,7 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
552
  gr.Examples([["P1 (hairpin loop)"],["P10 (G-quadruplex)"]], inputs=[g4])
553
  b4.click(predict_drug, g4, [o4t, o4p])
554
 
555
- with gr.TabItem("S1-R13 · Frontier 🔴⭐"):
556
  gr.HTML(proj_badge("S1-C · PHYLO-DRUG · S1-R13",
557
  "m6A × Ferroptosis × Circadian — Pan-cancer triad", "🔴 Frontier"))
558
  gr.Markdown(
@@ -562,14 +562,14 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
562
  )
563
 
564
  # ── 🧪 S1-D · PHYLO-LNP ────────────────────────────
565
- with gr.TabItem("🧪 S1-D PHYLO-LNP"):
566
  gr.HTML(section_header(
567
  "S1-D", "PHYLO-LNP", "— How to deliver the drug to the cell",
568
  "S1-R6 Corona ✅ · S1-R7 Flow ✅ · S1-R8 Brain ✅ · S1-R10 NLP ✅ · S1-R11 CSF/BM 🔴⭐"
569
  ))
570
  with gr.Tabs(elem_classes="inner-tabs"):
571
 
572
- with gr.TabItem("S1-R6 · Corona"):
573
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R6",
574
  "LNP Protein Corona (Serum)", "AUC = 0.791"))
575
  with gr.Row():
@@ -582,7 +582,7 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
582
  gr.Examples([[100,-5,1.5,"Ionizable"],[80,5,0.5,"Cationic"]], inputs=[sz,zt,pg,lp])
583
  b6.click(predict_corona, [sz,zt,pg,lp], o6)
584
 
585
- with gr.TabItem("S1-R7 · Flow"):
586
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R7",
587
  "Flow Corona — Vroman Effect · albumin→ApoE kinetics"))
588
  with gr.Row():
@@ -597,7 +597,7 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
597
  gr.Examples([[100,-5,1.5,"Ionizable",40],[150,5,0.5,"Cationic",10]], inputs=[s8,z8,pg8,ch8,fl8])
598
  b8.click(predict_flow, [s8,z8,pg8,ch8,fl8], [o8t,o8p])
599
 
600
- with gr.TabItem("S1-R8 · Brain"):
601
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R8",
602
  "LNP Brain Delivery — ApoE% + BBB probability"))
603
  smi = gr.Textbox(label="Ionizable lipid SMILES",
@@ -610,7 +610,7 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
610
  gr.Examples([["CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C",6.5,-3]], inputs=[smi,pk,zt9])
611
  b9.click(predict_bbb, [smi,pk,zt9], [o9t,o9p])
612
 
613
- with gr.TabItem("S1-R10 · NLP"):
614
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R10",
615
  "AutoCorona NLP — structured data from PMC abstracts", "F1 = 0.71"))
616
  txt = gr.Textbox(lines=5,label="Paper abstract",placeholder="Paste abstract here...")
@@ -624,7 +624,7 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
624
  ]], inputs=[txt])
625
  b10.click(extract_corona, txt, [o10j, o10f])
626
 
627
- with gr.TabItem("S1-R11 · CSF/BM 🔴⭐"):
628
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R11",
629
  "LNP Corona in CSF · Vitreous · Bone Marrow", "🔴 0 prior studies"))
630
  gr.Markdown(
@@ -635,14 +635,14 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
635
  )
636
 
637
  # ── 🩸 S1-E · PHYLO-BIOMARKERS ─────────────────────
638
- with gr.TabItem("🩸 S1-E PHYLO-BIOMARKERS"):
639
  gr.HTML(section_header(
640
  "S1-E", "PHYLO-BIOMARKERS", "— Detect cancer without tissue biopsy",
641
  "S1-R9 Liquid Biopsy ✅  ·  S1-R9b Panel validator 🔶  ·  S1-R9c ctDNA gap 🔴"
642
  ))
643
  with gr.Tabs(elem_classes="inner-tabs"):
644
 
645
- with gr.TabItem("S1-R9 · Liquid Biopsy"):
646
  gr.HTML(proj_badge("S1-E · PHYLO-BIOMARKERS · S1-R9",
647
  "Liquid Biopsy Classifier — CTHRC1 · FHL2 · LDHA panel",
648
  "AUC = 0.992*"))
@@ -664,13 +664,13 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
664
  inputs=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10])
665
  b7.click(predict_cancer, [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10], [o7t,o7p])
666
 
667
- with gr.TabItem("S1-R9b · Validator 🔶"):
668
  gr.HTML(proj_badge("S1-E · PHYLO-BIOMARKERS · S1-R9b",
669
  "Protein Panel Validator — multi-cancer plasma validation", "🔶 In progress"))
670
  gr.Markdown("> Coming next — validates S1-R9 results against GEO plasma proteomics datasets.")
671
 
672
  # ── 📓 JOURNAL ──────────────────────────────────────
673
- with gr.TabItem("📓 Journal"):
674
  gr.Markdown("### Lab Journal\nEvery tool call auto-logged with project code.")
675
  with gr.Row():
676
  note_text = gr.Textbox(label="📝 Observation", placeholder="What did you discover?", lines=3)
@@ -684,7 +684,7 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
684
  save_btn.click(save_note, [note_text,note_tab,note_last], [save_msg,journal_df])
685
 
686
  # ── 📚 LEARNING ─────────────────────────────────────
687
- with gr.TabItem("📚 Learning"):
688
  gr.Markdown("""
689
  ## 🧪 Guided Investigations — S1 Biomedical
690
  > 🟢 Beginner → 🟡 Intermediate → 🔴 Advanced
 
466
  with gr.Tabs(elem_classes="outer-tabs"):
467
 
468
  # ── 🗺️ MAP ─────────────────────────────────────────
469
+ with gr.Tab("🗺️ Lab Map"):
470
  gr.HTML(MAP_HTML)
471
 
472
  # ── 🧬 S1-A · PHYLO-GENOMICS ───────────────────────
473
+ with gr.Tab("🧬 S1-A PHYLO-GENOMICS"):
474
  gr.HTML(section_header(
475
  "S1-A", "PHYLO-GENOMICS", "— What breaks in DNA",
476
  "S1-R1 OpenVariant ✅  ·  S1-R1b Somatic classifier 🔶  ·  S1-R12a Rare variants 🔴"
477
  ))
478
  with gr.Tabs(elem_classes="inner-tabs"):
479
 
480
+ with gr.Tab("S1-R1 · OpenVariant"):
481
  gr.HTML(proj_badge("S1-A · PHYLO-GENOMICS · S1-R1",
482
  "OpenVariant — SNV Pathogenicity Classifier", "AUC = 0.939"))
483
  hgvs = gr.Textbox(label="HGVS notation", placeholder="BRCA1:p.R1699Q")
 
493
  ["BRCA2:p.D2723A",0.01,0.98,0.0]], inputs=[hgvs,sift,pp,gn])
494
  b_v.click(predict_variant, [hgvs,sift,pp,gn], o_v)
495
 
496
+ with gr.Tab("S1-R1b · Somatic 🔶"):
497
  gr.HTML(proj_badge("S1-A · PHYLO-GENOMICS · S1-R1b",
498
  "Somatic Mutation Classifier — BRCA · LUAD panels", "🔶 In progress"))
499
  gr.Markdown("> This module is in active development. Coming in the next release.")
500
 
501
  # ── 🔬 S1-B · PHYLO-RNA ────────────────────────────
502
+ with gr.Tab("🔬 S1-B PHYLO-RNA"):
503
  gr.HTML(section_header(
504
  "S1-B", "PHYLO-RNA", "— How to silence it via RNA",
505
  "S1-R2 miRNA ✅  ·  S1-R3 siRNA ✅  ·  S1-R4 lncRNA ✅  ·  S1-R4b ASO ✅"
506
  ))
507
  with gr.Tabs(elem_classes="inner-tabs"):
508
 
509
+ with gr.Tab("S1-R2 · miRNA"):
510
  gr.HTML(proj_badge("S1-B · PHYLO-RNA · S1-R2",
511
  "miRNA Silencing — BRCA1/2 · TP53 tumor suppressors"))
512
  g1 = gr.Dropdown(["BRCA2","BRCA1","TP53"], value="BRCA2", label="Gene")
 
515
  gr.Examples([["BRCA2"],["BRCA1"],["TP53"]], inputs=[g1])
516
  b1.click(predict_mirna, g1, o1)
517
 
518
+ with gr.Tab("S1-R3 · siRNA"):
519
  gr.HTML(proj_badge("S1-B · PHYLO-RNA · S1-R3",
520
  "siRNA Synthetic Lethal — TP53-null · LUAD · BRCA · COAD"))
521
  g2 = gr.Dropdown(["LUAD","BRCA","COAD"], value="LUAD", label="Cancer type")
 
524
  gr.Examples([["LUAD"],["BRCA"],["COAD"]], inputs=[g2])
525
  b2.click(predict_sirna, g2, o2)
526
 
527
+ with gr.Tab("S1-R4 · lncRNA + ASO"):
528
  gr.HTML(proj_badge("S1-B · PHYLO-RNA · S1-R4 + S1-R4b",
529
  "lncRNA-TREM2 ceRNA Network + ASO Candidates · Alzheimer neuroinflammation"))
530
  b3 = gr.Button("Load Results", variant="primary")
 
533
  b3.click(get_lncrna, [], [o3a, o3b])
534
 
535
  # ── 💊 S1-C · PHYLO-DRUG ───────────────────────────
536
+ with gr.Tab("💊 S1-C PHYLO-DRUG"):
537
  gr.HTML(section_header(
538
  "S1-C", "PHYLO-DRUG", "— Which molecule treats it",
539
  "S1-R5 FGFR3 ✅  ·  S1-R5b SL drug mapping 🔶  ·  S1-R13 m6A×Ferroptosis×Circadian 🔴⭐"
540
  ))
541
  with gr.Tabs(elem_classes="inner-tabs"):
542
 
543
+ with gr.Tab("S1-R5 · FGFR3"):
544
  gr.HTML(proj_badge("S1-C · PHYLO-DRUG · S1-R5",
545
  "FGFR3 RNA-Directed Drug Discovery · ChEMBL screen",
546
  "top score 0.793"))
 
552
  gr.Examples([["P1 (hairpin loop)"],["P10 (G-quadruplex)"]], inputs=[g4])
553
  b4.click(predict_drug, g4, [o4t, o4p])
554
 
555
+ with gr.Tab("S1-R13 · Frontier 🔴⭐"):
556
  gr.HTML(proj_badge("S1-C · PHYLO-DRUG · S1-R13",
557
  "m6A × Ferroptosis × Circadian — Pan-cancer triad", "🔴 Frontier"))
558
  gr.Markdown(
 
562
  )
563
 
564
  # ── 🧪 S1-D · PHYLO-LNP ────────────────────────────
565
+ with gr.Tab("🧪 S1-D PHYLO-LNP"):
566
  gr.HTML(section_header(
567
  "S1-D", "PHYLO-LNP", "— How to deliver the drug to the cell",
568
  "S1-R6 Corona ✅ · S1-R7 Flow ✅ · S1-R8 Brain ✅ · S1-R10 NLP ✅ · S1-R11 CSF/BM 🔴⭐"
569
  ))
570
  with gr.Tabs(elem_classes="inner-tabs"):
571
 
572
+ with gr.Tab("S1-R6 · Corona"):
573
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R6",
574
  "LNP Protein Corona (Serum)", "AUC = 0.791"))
575
  with gr.Row():
 
582
  gr.Examples([[100,-5,1.5,"Ionizable"],[80,5,0.5,"Cationic"]], inputs=[sz,zt,pg,lp])
583
  b6.click(predict_corona, [sz,zt,pg,lp], o6)
584
 
585
+ with gr.Tab("S1-R7 · Flow"):
586
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R7",
587
  "Flow Corona — Vroman Effect · albumin→ApoE kinetics"))
588
  with gr.Row():
 
597
  gr.Examples([[100,-5,1.5,"Ionizable",40],[150,5,0.5,"Cationic",10]], inputs=[s8,z8,pg8,ch8,fl8])
598
  b8.click(predict_flow, [s8,z8,pg8,ch8,fl8], [o8t,o8p])
599
 
600
+ with gr.Tab("S1-R8 · Brain"):
601
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R8",
602
  "LNP Brain Delivery — ApoE% + BBB probability"))
603
  smi = gr.Textbox(label="Ionizable lipid SMILES",
 
610
  gr.Examples([["CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C",6.5,-3]], inputs=[smi,pk,zt9])
611
  b9.click(predict_bbb, [smi,pk,zt9], [o9t,o9p])
612
 
613
+ with gr.Tab("S1-R10 · NLP"):
614
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R10",
615
  "AutoCorona NLP — structured data from PMC abstracts", "F1 = 0.71"))
616
  txt = gr.Textbox(lines=5,label="Paper abstract",placeholder="Paste abstract here...")
 
624
  ]], inputs=[txt])
625
  b10.click(extract_corona, txt, [o10j, o10f])
626
 
627
+ with gr.Tab("S1-R11 · CSF/BM 🔴⭐"):
628
  gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R11",
629
  "LNP Corona in CSF · Vitreous · Bone Marrow", "🔴 0 prior studies"))
630
  gr.Markdown(
 
635
  )
636
 
637
  # ── 🩸 S1-E · PHYLO-BIOMARKERS ─────────────────────
638
+ with gr.Tab("🩸 S1-E PHYLO-BIOMARKERS"):
639
  gr.HTML(section_header(
640
  "S1-E", "PHYLO-BIOMARKERS", "— Detect cancer without tissue biopsy",
641
  "S1-R9 Liquid Biopsy ✅  ·  S1-R9b Panel validator 🔶  ·  S1-R9c ctDNA gap 🔴"
642
  ))
643
  with gr.Tabs(elem_classes="inner-tabs"):
644
 
645
+ with gr.Tab("S1-R9 · Liquid Biopsy"):
646
  gr.HTML(proj_badge("S1-E · PHYLO-BIOMARKERS · S1-R9",
647
  "Liquid Biopsy Classifier — CTHRC1 · FHL2 · LDHA panel",
648
  "AUC = 0.992*"))
 
664
  inputs=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10])
665
  b7.click(predict_cancer, [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10], [o7t,o7p])
666
 
667
+ with gr.Tab("S1-R9b · Validator 🔶"):
668
  gr.HTML(proj_badge("S1-E · PHYLO-BIOMARKERS · S1-R9b",
669
  "Protein Panel Validator — multi-cancer plasma validation", "🔶 In progress"))
670
  gr.Markdown("> Coming next — validates S1-R9 results against GEO plasma proteomics datasets.")
671
 
672
  # ── 📓 JOURNAL ──────────────────────────────────────
673
+ with gr.Tab("📓 Journal"):
674
  gr.Markdown("### Lab Journal\nEvery tool call auto-logged with project code.")
675
  with gr.Row():
676
  note_text = gr.Textbox(label="📝 Observation", placeholder="What did you discover?", lines=3)
 
684
  save_btn.click(save_note, [note_text,note_tab,note_last], [save_msg,journal_df])
685
 
686
  # ── 📚 LEARNING ─────────────────────────────────────
687
+ with gr.Tab("📚 Learning"):
688
  gr.Markdown("""
689
  ## 🧪 Guided Investigations — S1 Biomedical
690
  > 🟢 Beginner → 🟡 Intermediate → 🔴 Advanced