TEZv commited on
Commit
3786fcc
·
verified ·
1 Parent(s): e1d3e96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +275 -4
app.py CHANGED
@@ -549,7 +549,7 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
549
  with gr.TabItem("🗺️ Lab Map"):
550
  gr.HTML(MAP_HTML)
551
 
552
- # 🧬 S1-A · PHYLO-GENOMICS
553
  with gr.TabItem("S1-A · R1a · OpenVariant"):
554
  gr.HTML(proj_badge("S1-A · R1a", "OpenVariant — SNV Pathogenicity Classifier", "AUC = 0.939"))
555
  hgvs = gr.Textbox(label="HGVS notation", placeholder="BRCA1:p.R1699Q")
@@ -565,12 +565,283 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
565
  ["BRCA2:p.D2723A",0.01,0.98,0.0]], inputs=[hgvs,sift,pp,gn], cache_examples=False)
566
  b_v.click(predict_variant, [hgvs,sift,pp,gn], o_v)
567
 
568
- # РЕШТА ВКЛАДОК ПОКИ ЩО ЗАКОМЕНТОВАНІ ДЛЯ ДІАГНОСТИКИ
 
 
 
 
 
569
  # with gr.TabItem("S1-A · R1b · Somatic Classifier 🔶"):
570
  # gr.HTML(proj_badge("S1-A · R1b", "Somatic Mutation Classifier", "🔶 In progress"))
571
  # gr.Markdown("> This module is in active development. Coming in the next release.")
572
-
573
- # ... (всі інші вкладки закоментуйте аналогічно)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
574
 
575
  # 📓 Journal
576
  with gr.TabItem("📓 Journal"):
 
549
  with gr.TabItem("🗺️ Lab Map"):
550
  gr.HTML(MAP_HTML)
551
 
552
+ # === АКТИВНІ ВКЛАДКИ (працюють) ===
553
  with gr.TabItem("S1-A · R1a · OpenVariant"):
554
  gr.HTML(proj_badge("S1-A · R1a", "OpenVariant — SNV Pathogenicity Classifier", "AUC = 0.939"))
555
  hgvs = gr.Textbox(label="HGVS notation", placeholder="BRCA1:p.R1699Q")
 
565
  ["BRCA2:p.D2723A",0.01,0.98,0.0]], inputs=[hgvs,sift,pp,gn], cache_examples=False)
566
  b_v.click(predict_variant, [hgvs,sift,pp,gn], o_v)
567
 
568
+ # === ВСІ ІНШІ ВКЛАДКИ ЗАКОМЕНТОВАНІ ===
569
+ # Розкоментуйте блок цілком, щоб перевірити, чи викликає помилку
570
+
571
+ # =============================================================================
572
+ # === START: S1-A · R1b · Somatic Classifier 🔶 ===============================
573
+ # =============================================================================
574
  # with gr.TabItem("S1-A · R1b · Somatic Classifier 🔶"):
575
  # gr.HTML(proj_badge("S1-A · R1b", "Somatic Mutation Classifier", "🔶 In progress"))
576
  # gr.Markdown("> This module is in active development. Coming in the next release.")
577
+ # =============================================================================
578
+ # === END: S1-A · R1b =========================================================
579
+ # =============================================================================
580
+
581
+ # =============================================================================
582
+ # === START: S1-B · R1a · BRCA2 miRNA ========================================
583
+ # =============================================================================
584
+ # with gr.TabItem("S1-B · R1a · BRCA2 miRNA"):
585
+ # gr.HTML(proj_badge("S1-B · R1a", "miRNA Silencing — BRCA1/2 · TP53"))
586
+ # g1 = gr.Dropdown(["BRCA2","BRCA1","TP53"], value="BRCA2", label="Gene")
587
+ # b1 = gr.Button("Find miRNAs", variant="primary")
588
+ # o1 = gr.Dataframe(label="Top 5 downregulated miRNAs")
589
+ # gr.Examples([["BRCA2"],["BRCA1"],["TP53"]], inputs=[g1])
590
+ # b1.click(predict_mirna, [g1], o1)
591
+ # =============================================================================
592
+ # === END: S1-B · R1a =========================================================
593
+ # =============================================================================
594
+
595
+ # =============================================================================
596
+ # === START: S1-B · R2a · TP53 siRNA =========================================
597
+ # =============================================================================
598
+ # with gr.TabItem("S1-B · R2a · TP53 siRNA"):
599
+ # gr.HTML(proj_badge("S1-B · R2a", "siRNA Synthetic Lethal — TP53-null"))
600
+ # g2 = gr.Dropdown(["LUAD","BRCA","COAD"], value="LUAD", label="Cancer type")
601
+ # b2 = gr.Button("Find Targets", variant="primary")
602
+ # o2 = gr.Dataframe(label="Top 5 synthetic lethal targets")
603
+ # gr.Examples([["LUAD"],["BRCA"],["COAD"]], inputs=[g2], cache_examples=False)
604
+ # b2.click(predict_sirna, [g2], o2)
605
+ # =============================================================================
606
+ # === END: S1-B · R2a =========================================================
607
+ # =============================================================================
608
+
609
+ # =============================================================================
610
+ # === START: S1-B · R3a · lncRNA-TREM2 =======================================
611
+ # =============================================================================
612
+ # with gr.TabItem("S1-B · R3a · lncRNA-TREM2"):
613
+ # gr.HTML(proj_badge("S1-B · R3a", "lncRNA-TREM2 ceRNA Network"))
614
+ # b3 = gr.Button("Load Network", variant="primary")
615
+ # o3 = gr.Dataframe(label="ceRNA Network")
616
+ # b3.click(get_lncrna, [], o3)
617
+ # =============================================================================
618
+ # === END: S1-B · R3a =========================================================
619
+ # =============================================================================
620
+
621
+ # =============================================================================
622
+ # === START: S1-B · R3b · ASO Designer =======================================
623
+ # =============================================================================
624
+ # with gr.TabItem("S1-B · R3b · ASO Designer"):
625
+ # gr.HTML(proj_badge("S1-B · R3b", "ASO Candidates"))
626
+ # b4 = gr.Button("Show ASOs", variant="primary")
627
+ # o4 = gr.Dataframe(label="ASO Candidates")
628
+ # b4.click(get_aso, [], o4)
629
+ # =============================================================================
630
+ # === END: S1-B · R3b =========================================================
631
+ # =============================================================================
632
+
633
+ # =============================================================================
634
+ # === START: S1-C · R1a · FGFR3 RNA Drug =====================================
635
+ # =============================================================================
636
+ # with gr.TabItem("S1-C · R1a · FGFR3 RNA Drug"):
637
+ # gr.HTML(proj_badge("S1-C · R1a", "FGFR3 RNA-Directed Drug Discovery", "top score 0.793"))
638
+ # g4 = gr.Radio(["P1 (hairpin loop)","P10 (G-quadruplex)"],
639
+ # value="P1 (hairpin loop)", label="Target pocket")
640
+ # b4 = gr.Button("Screen Compounds", variant="primary")
641
+ # o4t = gr.Dataframe(label="Top 5 candidates")
642
+ # o4p = gr.Image(label="Binding scores")
643
+ # gr.Examples([["P1 (hairpin loop)"],["P10 (G-quadruplex)"]], inputs=[g4])
644
+ # b4.click(predict_drug, [g4], [o4t, o4p])
645
+ # =============================================================================
646
+ # === END: S1-C · R1a =========================================================
647
+ # =============================================================================
648
+
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
+ # =============================================================================
658
+
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
+ # =============================================================================
668
+
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
+ # =============================================================================
687
+
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
+ # =============================================================================
707
+
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
+ # =============================================================================
725
+
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
+ # =============================================================================
744
+
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
+ # =============================================================================
754
+
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
+ # =============================================================================
780
+
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
+ # =============================================================================
790
+
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
+ # =============================================================================
811
+
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
+ # =============================================================================
827
+
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
+ # =============================================================================
845
 
846
  # 📓 Journal
847
  with gr.TabItem("📓 Journal"):