Update app.py
Browse files
app.py
CHANGED
|
@@ -649,9 +649,9 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 649 |
# =============================================================================
|
| 650 |
# === START: S1-C · R1b · SL Drug Mapping 🔶 =================================
|
| 651 |
# =============================================================================
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
# =============================================================================
|
| 656 |
# === END: S1-C · R1b =========================================================
|
| 657 |
# =============================================================================
|
|
@@ -659,9 +659,9 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 659 |
# =============================================================================
|
| 660 |
# === START: S1-C · R2a · Frontier 🔴 ========================================
|
| 661 |
# =============================================================================
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
# =============================================================================
|
| 666 |
# === END: S1-C · R2a =========================================================
|
| 667 |
# =============================================================================
|
|
@@ -669,18 +669,18 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 669 |
# =============================================================================
|
| 670 |
# === START: S1-D · R1a · LNP Corona =========================================
|
| 671 |
# =============================================================================
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
# =============================================================================
|
| 685 |
# === END: S1-D · R1a =========================================================
|
| 686 |
# =============================================================================
|
|
@@ -688,19 +688,19 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 688 |
# =============================================================================
|
| 689 |
# === START: S1-D · R2a · Flow Corona ========================================
|
| 690 |
# =============================================================================
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
| 704 |
# =============================================================================
|
| 705 |
# === END: S1-D · R2a =========================================================
|
| 706 |
# =============================================================================
|
|
@@ -708,17 +708,17 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 708 |
# =============================================================================
|
| 709 |
# === START: S1-D · R3a · LNP Brain ==========================================
|
| 710 |
# =============================================================================
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
# =============================================================================
|
| 723 |
# === END: S1-D · R3a =========================================================
|
| 724 |
# =============================================================================
|
|
@@ -726,18 +726,18 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 726 |
# =============================================================================
|
| 727 |
# === START: S1-D · R4a · AutoCorona NLP =====================================
|
| 728 |
# =============================================================================
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
# =============================================================================
|
| 742 |
# === END: S1-D · R4a =========================================================
|
| 743 |
# =============================================================================
|
|
@@ -745,9 +745,9 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 745 |
# =============================================================================
|
| 746 |
# === START: S1-D · R5a · CSF/BM 🔴 ==========================================
|
| 747 |
# =============================================================================
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
# =============================================================================
|
| 752 |
# === END: S1-D · R5a =========================================================
|
| 753 |
# =============================================================================
|
|
@@ -755,25 +755,25 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 755 |
# =============================================================================
|
| 756 |
# === START: S1-E · R1a · Liquid Biopsy ======================================
|
| 757 |
# =============================================================================
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
|
| 770 |
-
|
| 771 |
-
|
| 772 |
-
|
| 773 |
-
|
| 774 |
-
|
| 775 |
-
|
| 776 |
-
|
| 777 |
# =============================================================================
|
| 778 |
# === END: S1-E · R1a =========================================================
|
| 779 |
# =============================================================================
|
|
@@ -781,9 +781,9 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 781 |
# =============================================================================
|
| 782 |
# === START: S1-E · R1b · Validator 🔶 =======================================
|
| 783 |
# =============================================================================
|
| 784 |
-
|
| 785 |
-
|
| 786 |
-
|
| 787 |
# =============================================================================
|
| 788 |
# === END: S1-E · R1b =========================================================
|
| 789 |
# =============================================================================
|
|
@@ -791,20 +791,20 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 791 |
# =============================================================================
|
| 792 |
# === START: S1-F · R1a · DIPG Toolkit =======================================
|
| 793 |
# =============================================================================
|
| 794 |
-
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
|
| 801 |
-
|
| 802 |
-
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
-
|
| 808 |
# =============================================================================
|
| 809 |
# === END: S1-F · R1a =========================================================
|
| 810 |
# =============================================================================
|
|
@@ -812,15 +812,15 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 812 |
# =============================================================================
|
| 813 |
# === START: S1-F · R2a · UVM Toolkit ========================================
|
| 814 |
# =============================================================================
|
| 815 |
-
|
| 816 |
-
|
| 817 |
-
|
| 818 |
-
|
| 819 |
-
|
| 820 |
-
|
| 821 |
-
|
| 822 |
-
|
| 823 |
-
|
| 824 |
# =============================================================================
|
| 825 |
# === END: S1-F · R2a =========================================================
|
| 826 |
# =============================================================================
|
|
@@ -828,17 +828,17 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 828 |
# =============================================================================
|
| 829 |
# === START: S1-F · R3a · pAML Toolkit =======================================
|
| 830 |
# =============================================================================
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
|
| 836 |
-
|
| 837 |
-
|
| 838 |
-
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
# =============================================================================
|
| 843 |
# === END: S1-F · R3a =========================================================
|
| 844 |
# =============================================================================
|
|
|
|
| 649 |
# =============================================================================
|
| 650 |
# === START: S1-C · R1b · SL Drug Mapping 🔶 =================================
|
| 651 |
# =============================================================================
|
| 652 |
+
with gr.TabItem("S1-C · R1b · SL Drug Mapping 🔶"):
|
| 653 |
+
gr.HTML(proj_badge("S1-C · R1b", "Synthetic Lethal Drug Mapping", "🔶 In progress"))
|
| 654 |
+
gr.Markdown("> Coming soon.")
|
| 655 |
# =============================================================================
|
| 656 |
# === END: S1-C · R1b =========================================================
|
| 657 |
# =============================================================================
|
|
|
|
| 659 |
# =============================================================================
|
| 660 |
# === START: S1-C · R2a · Frontier 🔴 ========================================
|
| 661 |
# =============================================================================
|
| 662 |
+
with gr.TabItem("S1-C · R2a · Frontier 🔴"):
|
| 663 |
+
gr.HTML(proj_badge("S1-C · R2a", "m6A × Ferroptosis × Circadian", "🔴 Frontier"))
|
| 664 |
+
gr.Markdown("> Planned for Q3 2026")
|
| 665 |
# =============================================================================
|
| 666 |
# === END: S1-C · R2a =========================================================
|
| 667 |
# =============================================================================
|
|
|
|
| 669 |
# =============================================================================
|
| 670 |
# === START: S1-D · R1a · LNP Corona =========================================
|
| 671 |
# =============================================================================
|
| 672 |
+
with gr.TabItem("S1-D · R1a · LNP Corona"):
|
| 673 |
+
gr.HTML(proj_badge("S1-D · R1a", "LNP Protein Corona (Serum)", "AUC = 0.791"))
|
| 674 |
+
with gr.Row():
|
| 675 |
+
sz = gr.Slider(50,300,value=100,step=1,label="Size (nm)")
|
| 676 |
+
zt = gr.Slider(-40,10,value=-5,step=1,label="Zeta (mV)")
|
| 677 |
+
with gr.Row():
|
| 678 |
+
pg = gr.Slider(0,5,value=1.5,step=0.1,label="PEG mol%")
|
| 679 |
+
lp = gr.Dropdown(["Ionizable","Cationic","Anionic","Neutral"],value="Ionizable",label="Lipid type")
|
| 680 |
+
b6 = gr.Button("Predict", variant="primary")
|
| 681 |
+
o6 = gr.Markdown()
|
| 682 |
+
gr.Examples([[100,-5,1.5,"Ionizable"],[80,5,0.5,"Cationic"]], inputs=[sz,zt,pg,lp])
|
| 683 |
+
b6.click(predict_corona, [sz,zt,pg,lp], o6)
|
| 684 |
# =============================================================================
|
| 685 |
# === END: S1-D · R1a =========================================================
|
| 686 |
# =============================================================================
|
|
|
|
| 688 |
# =============================================================================
|
| 689 |
# === START: S1-D · R2a · Flow Corona ========================================
|
| 690 |
# =============================================================================
|
| 691 |
+
with gr.TabItem("S1-D · R2a · Flow Corona"):
|
| 692 |
+
gr.HTML(proj_badge("S1-D · R2a", "Flow Corona — Vroman Effect"))
|
| 693 |
+
with gr.Row():
|
| 694 |
+
s8 = gr.Slider(50,300,value=100,step=1,label="Size (nm)")
|
| 695 |
+
z8 = gr.Slider(-40,10,value=-5,step=1,label="Zeta (mV)")
|
| 696 |
+
pg8 = gr.Slider(0,5,value=1.5,step=0.1,label="PEG mol%")
|
| 697 |
+
with gr.Row():
|
| 698 |
+
ch8 = gr.Dropdown(["Ionizable","Cationic","Anionic","Neutral"],value="Ionizable",label="Charge")
|
| 699 |
+
fl8 = gr.Slider(0,40,value=20,step=1,label="Flow cm/s")
|
| 700 |
+
b8 = gr.Button("Model Vroman Effect", variant="primary")
|
| 701 |
+
o8t = gr.Markdown(); o8p = gr.Image(label="Kinetics")
|
| 702 |
+
gr.Examples([[100,-5,1.5,"Ionizable",40],[150,5,0.5,"Cationic",10]], inputs=[s8,z8,pg8,ch8,fl8])
|
| 703 |
+
b8.click(predict_flow, [s8,z8,pg8,ch8,fl8], [o8t,o8p])
|
| 704 |
# =============================================================================
|
| 705 |
# === END: S1-D · R2a =========================================================
|
| 706 |
# =============================================================================
|
|
|
|
| 708 |
# =============================================================================
|
| 709 |
# === START: S1-D · R3a · LNP Brain ==========================================
|
| 710 |
# =============================================================================
|
| 711 |
+
with gr.TabItem("S1-D · R3a · LNP Brain"):
|
| 712 |
+
gr.HTML(proj_badge("S1-D · R3a", "LNP Brain Delivery — ApoE% + BBB probability"))
|
| 713 |
+
smi = gr.Textbox(label="Ionizable lipid SMILES",
|
| 714 |
+
value="CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C")
|
| 715 |
+
with gr.Row():
|
| 716 |
+
pk = gr.Slider(4,8,value=6.5,step=0.1,label="pKa")
|
| 717 |
+
zt9 = gr.Slider(-20,10,value=-3,step=1,label="Zeta (mV)")
|
| 718 |
+
b9 = gr.Button("Predict BBB Crossing", variant="primary")
|
| 719 |
+
o9t = gr.Markdown(); o9p = gr.Image(label="Radar profile")
|
| 720 |
+
gr.Examples([["CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C",6.5,-3]], inputs=[smi,pk,zt9])
|
| 721 |
+
b9.click(predict_bbb, [smi,pk,zt9], [o9t,o9p])
|
| 722 |
# =============================================================================
|
| 723 |
# === END: S1-D · R3a =========================================================
|
| 724 |
# =============================================================================
|
|
|
|
| 726 |
# =============================================================================
|
| 727 |
# === START: S1-D · R4a · AutoCorona NLP =====================================
|
| 728 |
# =============================================================================
|
| 729 |
+
with gr.TabItem("S1-D · R4a · AutoCorona NLP"):
|
| 730 |
+
gr.HTML(proj_badge("S1-D · R4a", "AutoCorona NLP — from abstracts", "F1 = 0.71"))
|
| 731 |
+
txt = gr.Textbox(lines=5,label="Paper abstract",placeholder="Paste abstract here...")
|
| 732 |
+
b10 = gr.Button("Extract Data", variant="primary")
|
| 733 |
+
o10j = gr.Code(label="Extracted JSON", language="json")
|
| 734 |
+
o10f = gr.Textbox(label="Validation flags")
|
| 735 |
+
gr.Examples([[
|
| 736 |
+
"LNPs composed of MC3, DSPC, Cholesterol (50:10:40 mol%) with 1.5% PEG-DMG. "
|
| 737 |
+
"Hydrodynamic diameter was 98 nm, zeta potential -3.2 mV, PDI 0.12. "
|
| 738 |
+
"Incubated in human plasma. Corona: albumin, apolipoprotein E, fibrinogen."
|
| 739 |
+
]], inputs=[txt])
|
| 740 |
+
b10.click(extract_corona, txt, [o10j, o10f])
|
| 741 |
# =============================================================================
|
| 742 |
# === END: S1-D · R4a =========================================================
|
| 743 |
# =============================================================================
|
|
|
|
| 745 |
# =============================================================================
|
| 746 |
# === START: S1-D · R5a · CSF/BM 🔴 ==========================================
|
| 747 |
# =============================================================================
|
| 748 |
+
with gr.TabItem("S1-D · R5a · CSF/BM 🔴"):
|
| 749 |
+
gr.HTML(proj_badge("S1-D · R5a", "LNP Corona in CSF · Vitreous · Bone Marrow", "🔴 0 prior studies"))
|
| 750 |
+
gr.Markdown("> Planned for Q2–Q3 2026")
|
| 751 |
# =============================================================================
|
| 752 |
# === END: S1-D · R5a =========================================================
|
| 753 |
# =============================================================================
|
|
|
|
| 755 |
# =============================================================================
|
| 756 |
# === START: S1-E · R1a · Liquid Biopsy ======================================
|
| 757 |
# =============================================================================
|
| 758 |
+
with gr.TabItem("S1-E · R1a · Liquid Biopsy"):
|
| 759 |
+
gr.HTML(proj_badge("S1-E · R1a", "Liquid Biopsy Classifier", "AUC = 0.992*"))
|
| 760 |
+
with gr.Row():
|
| 761 |
+
p1=gr.Slider(-3,3,value=0,step=0.1,label="CTHRC1")
|
| 762 |
+
p2=gr.Slider(-3,3,value=0,step=0.1,label="FHL2")
|
| 763 |
+
p3=gr.Slider(-3,3,value=0,step=0.1,label="LDHA")
|
| 764 |
+
p4=gr.Slider(-3,3,value=0,step=0.1,label="P4HA1")
|
| 765 |
+
p5=gr.Slider(-3,3,value=0,step=0.1,label="SERPINH1")
|
| 766 |
+
with gr.Row():
|
| 767 |
+
p6=gr.Slider(-3,3,value=0,step=0.1,label="ABCA8")
|
| 768 |
+
p7=gr.Slider(-3,3,value=0,step=0.1,label="CA4")
|
| 769 |
+
p8=gr.Slider(-3,3,value=0,step=0.1,label="CKB")
|
| 770 |
+
p9=gr.Slider(-3,3,value=0,step=0.1,label="NNMT")
|
| 771 |
+
p10=gr.Slider(-3,3,value=0,step=0.1,label="CACNA2D2")
|
| 772 |
+
b7=gr.Button("Classify", variant="primary")
|
| 773 |
+
o7t=gr.HTML(); o7p=gr.Image(label="Feature contributions")
|
| 774 |
+
gr.Examples([[2,2,1.5,1.8,1.6,-1,-1.2,-0.8,1.4,-1.1],[0]*10],
|
| 775 |
+
inputs=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10])
|
| 776 |
+
b7.click(predict_cancer, [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10], [o7t,o7p])
|
| 777 |
# =============================================================================
|
| 778 |
# === END: S1-E · R1a =========================================================
|
| 779 |
# =============================================================================
|
|
|
|
| 781 |
# =============================================================================
|
| 782 |
# === START: S1-E · R1b · Validator 🔶 =======================================
|
| 783 |
# =============================================================================
|
| 784 |
+
with gr.TabItem("S1-E · R1b · Validator 🔶"):
|
| 785 |
+
gr.HTML(proj_badge("S1-E · R1b", "Protein Panel Validator", "🔶 In progress"))
|
| 786 |
+
gr.Markdown("> Coming next.")
|
| 787 |
# =============================================================================
|
| 788 |
# === END: S1-E · R1b =========================================================
|
| 789 |
# =============================================================================
|
|
|
|
| 791 |
# =============================================================================
|
| 792 |
# === START: S1-F · R1a · DIPG Toolkit =======================================
|
| 793 |
# =============================================================================
|
| 794 |
+
with gr.TabItem("S1-F · R1a · DIPG Toolkit"):
|
| 795 |
+
gr.HTML(proj_badge("S1-F · R1a", "DIPG: H3K27M + CSF LNP + Circadian", "PBTA"))
|
| 796 |
+
sort_d = gr.Radio(["Frequency", "Drug status"], value="Frequency", label="Sort by")
|
| 797 |
+
b_dv = gr.Button("Load DIPG Variants", variant="primary")
|
| 798 |
+
o_dv = gr.Dataframe(label="H3K27M co-mutations")
|
| 799 |
+
b_dv.click(dipg_variants, [sort_d], o_dv)
|
| 800 |
+
gr.Markdown("---")
|
| 801 |
+
with gr.Row():
|
| 802 |
+
d_peg = gr.Slider(0.5, 3.0, value=1.5, step=0.1, label="PEG mol%")
|
| 803 |
+
d_size = gr.Slider(60, 150, value=90, step=5, label="Target size (nm)")
|
| 804 |
+
b_dc = gr.Button("Rank CSF Formulations", variant="primary")
|
| 805 |
+
o_dct = gr.Dataframe(label="CSF LNP ranking")
|
| 806 |
+
o_dcp = gr.Image(label="ApoE% in CSF corona")
|
| 807 |
+
b_dc.click(dipg_csf, [d_peg, d_size], [o_dct, o_dcp])
|
| 808 |
# =============================================================================
|
| 809 |
# === END: S1-F · R1a =========================================================
|
| 810 |
# =============================================================================
|
|
|
|
| 812 |
# =============================================================================
|
| 813 |
# === START: S1-F · R2a · UVM Toolkit ========================================
|
| 814 |
# =============================================================================
|
| 815 |
+
with gr.TabItem("S1-F · R2a · UVM Toolkit"):
|
| 816 |
+
gr.HTML(proj_badge("S1-F · R2a", "UVM: GNAQ/GNA11 + vitreous + m6A", "TCGA-UVM"))
|
| 817 |
+
b_uv = gr.Button("Load UVM Variants", variant="primary")
|
| 818 |
+
o_uv = gr.Dataframe(label="GNAQ/GNA11 map")
|
| 819 |
+
b_uv.click(uvm_variants, [], o_uv)
|
| 820 |
+
b_uw = gr.Button("Rank Vitreous Formulations", variant="primary")
|
| 821 |
+
o_uwt = gr.Dataframe(label="Vitreous LNP retention ranking")
|
| 822 |
+
o_uwp = gr.Image(label="Retention (hours)")
|
| 823 |
+
b_uw.click(uvm_vitreous, [], [o_uwt, o_uwp])
|
| 824 |
# =============================================================================
|
| 825 |
# === END: S1-F · R2a =========================================================
|
| 826 |
# =============================================================================
|
|
|
|
| 828 |
# =============================================================================
|
| 829 |
# === START: S1-F · R3a · pAML Toolkit =======================================
|
| 830 |
# =============================================================================
|
| 831 |
+
with gr.TabItem("S1-F · R3a · pAML Toolkit"):
|
| 832 |
+
gr.HTML(proj_badge("S1-F · R3a", "pAML: FLT3-ITD + BM niche + ferroptosis", "TARGET-AML"))
|
| 833 |
+
var_sel = gr.Dropdown(
|
| 834 |
+
["FLT3-ITD", "NPM1 c.860_863dupTCAG", "DNMT3A p.R882H",
|
| 835 |
+
"CEBPA biallelic", "IDH1/2 mutation"],
|
| 836 |
+
value="FLT3-ITD", label="Select variant"
|
| 837 |
+
)
|
| 838 |
+
b_pf = gr.Button("Analyze Ferroptosis Profile", variant="primary")
|
| 839 |
+
o_pft = gr.HTML()
|
| 840 |
+
o_pfp = gr.Image(label="Target radar")
|
| 841 |
+
b_pf.click(paml_ferroptosis, var_sel, [o_pft, o_pfp])
|
| 842 |
# =============================================================================
|
| 843 |
# === END: S1-F · R3a =========================================================
|
| 844 |
# =============================================================================
|