OpenIslet

scripts/extract_ring1_corpus.py

Step 5B (v0.3 Deep Quantitative & Canonical Graph Upgrade):

script Release v0.8.0 gen-eb955f8266035aba 296 KB · 22 sections

Use this file in any AI chat (paste-only or attachment-capable):

Download as text (.txt) Download section (.txt)

Pinned raw file: https://openislet.org/files/gen-eb955f8266035aba/scripts/extract_ring1_corpus.py · SHA-256: eee6ac565ed0fb16…

# Strict genetic perturbation required for endogenous beta-cell markers (SLC30A8, CHGA, G6PC2, GAD2, PTPRN, INS, IAPP)
# so routine SC-islet differentiation marker checks are never misclassified as genetic edits
STRICT_GENETIC_EDIT_RE = re.compile(
    r"\b(knockout|knock-out|KO\b|-/-|CRISPR|Cas9|Cas12|gRNA|sgRNA|shRNA|siRNA|knockdown|knock-down|"
    r"delet\w+|ablat\w+|loss-of-function|LoF\b|deficien\w+|mutan\w+|mutation|R325W|"
    r"base-edit\w+|prime-edit\w+|signal\s+peptide\s+swap|leader\s+swap|INS-DRiP|WE14|BDC2\.5|pramlintide)\b",
    flags=re.IGNORECASE,
)

ENDOGENOUS_LINEAGE_MARKERS = {"SLC30A8", "CHGA", "G6PC2", "GAD2", "PTPRN", "INS", "IAPP", "GLIS3"}

# Passive marker context that disqualifies a bare mention if no strict genetic edit is in the window
PASSIVE_MARKER_ONLY_RE = re.compile(
    r"\b(immunostaining|immunofluorescence|stained\s+for|staining\s+for|positive\s+for|markers?\s+such\s+as|"
    r"expressing\s+markers|pan-endocrine|beta-cell\s+marker|endocrine\s+marker|maturation\s+marker|"
    r"flow\s+cytometry|FACS\s+analysis|membrane\s+attack\s+complex-inhibitory\s+protein|"
    r"complement\s+inhibitory\s+receptors?|qPCR|RT-qPCR|RNA-seq|scRNA-seq|transcriptom\w+)\b",
    flags=re.IGNORECASE,
)

# Comprehensive Target Gene Dictionary for Project Islet-1 / OpenIslet.org (Gates 2, 3, 4, 5)
TARGET_GENE_SPECS: list[dict[str, Any]] = [
    {
        "symbol": "B2M",
        "ensembl": "ENSG00000166710",
        "pattern": r"\b(B2M|beta-2-microglobulin|β2-microglobulin|B2m-/-|B2M-/-)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate2_Allo_HLA_ClassI_or_II",
        "evaded": ["Allogeneic_HLA_DSA_or_TCR"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "CIITA",
        "ensembl": "ENSG00000179583",
        "pattern": r"\b(CIITA|Class II transactivator|Ciita-/-|CIITA-/-)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate2_Allo_HLA_ClassI_or_II",
        "evaded": ["Allogeneic_HLA_DSA_or_TCR"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "NLRC5",
        "ensembl": "ENSG00000140853",
        "pattern": r"\b(NLRC5|CITA)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate2_Allo_HLA_ClassI_or_II",
        "evaded": ["Allogeneic_HLA_DSA_or_TCR"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "CD47",
        "ensembl": "ENSG00000196776",
        "pattern": r"\b(CD47|SIRP\s*alpha|SIRPα)\b",
        "region_class": "Transgene_cDNA_Cassette",
        "functional_gate": "Gate3_NK_MissingSelf_Inhibition",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "Lentiviral_or_Transposon_OE",
        "default_promoter": "Viral_or_Synthetic_CAG_EF1a_CMV",
    },
    {
        "symbol": "HLA-E",
        "ensembl": "ENSG00000204592",
        "pattern": r"\b(HLA-E|Qa-1b)\b",
        "region_class": "Transgene_cDNA_Cassette",
        "functional_gate": "Gate3_NK_MissingSelf_Inhibition",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "SafeHarbor_KI_AAVS1_GAPDH_CLYBL",
        "default_promoter": "Viral_or_Synthetic_CAG_EF1a_CMV",
    },
    {
        "symbol": "HLA-G",
        "ensembl": "ENSG00000204632",
        "pattern": r"\b(HLA-G)\b",
        "region_class": "Transgene_cDNA_Cassette",
        "functional_gate": "Gate3_NK_MissingSelf_Inhibition",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "Lentiviral_or_Transposon_OE",
        "default_promoter": "Viral_or_Synthetic_CAG_EF1a_CMV",
    },
    {
        "symbol": "HLA-C",
        "ensembl": "ENSG00000204525",
        "pattern": r"\b(HLA-C\s*retained|HLA-A\s*and\s*HLA-B\s*knockout|HLA-A-/-HLA-B-/-|HLA-C-retained)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate3_NK_MissingSelf_Inhibition",
        "evaded": ["Allogeneic_HLA_DSA_or_TCR"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Endogenous_Native_Promoter",
    },
    {
        "symbol": "CD274",
        "ensembl": "ENSG00000120217",
        "pattern": r"\b(PD-L1|PDL1|CD274|B7-H1)\b",
        "region_class": "Transgene_cDNA_Cassette",
        "functional_gate": "Gate2_Checkpoint_T_Cell_Inhibition",
        "evaded": ["Allogeneic_HLA_DSA_or_TCR"],
        "default_modality": "Lentiviral_or_Transposon_OE",
        "default_promoter": "Viral_or_Synthetic_CAG_EF1a_CMV",
    },
    {
        "symbol": "FASLG",
        "ensembl": "ENSG00000117560",
        "pattern": r"\b(FasL|SA-FasL|FASLG|CD95L)\b",
        "region_class": "Transgene_cDNA_Cassette",
        "functional_gate": "Gate2_Checkpoint_T_Cell_Inhibition",
        "evaded": ["Allogeneic_HLA_DSA_or_TCR"],
        "default_modality": "Transient_mRNA_or_Surface_Tethering",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "CXCL10",
        "ensembl": "ENSG00000169245",
        "pattern": r"\b(CXCL10|IP-10)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate4_Intrinsic_IFN_JAK_STAT_NFkB_Block",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "TYK2",
        "ensembl": "ENSG00000105397",
        "pattern": r"\b(TYK2|BMS-986165|deucravacitinib|rs34536443|P1104A)\b",
        "region_class": "Catalytic_or_Kinase_Domain",
        "functional_gate": "Gate4_Intrinsic_IFN_JAK_STAT_NFkB_Block",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "PTPN2",
        "ensembl": "ENSG00000175354",
        "pattern": r"\b(PTPN2|TC-PTP)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate4_Intrinsic_IFN_JAK_STAT_NFkB_Block",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Endogenous_Native_Promoter",
    },
    {
        "symbol": "TNFAIP3",
        "ensembl": "ENSG00000118503",
        "pattern": r"(?<!-)\b(TNFAIP3|A20)\b(?!-B\d)",
        "region_class": "Transgene_cDNA_Cassette",
        "functional_gate": "Gate4_Intrinsic_IFN_JAK_STAT_NFkB_Block",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "Lentiviral_or_Transposon_OE",
        "default_promoter": "Viral_or_Synthetic_CAG_EF1a_CMV",
    },
    {
        "symbol": "SOCS1",
        "ensembl": "ENSG00000185338",
        "pattern": r"\b(SOCS1|SOCS-1)\b",
        "region_class": "Transgene_cDNA_Cassette",
        "functional_gate": "Gate4_Intrinsic_IFN_JAK_STAT_NFkB_Block",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "Lentiviral_or_Transposon_OE",
        "default_promoter": "Viral_or_Synthetic_CAG_EF1a_CMV",
    },
    {
        "symbol": "RNLS",
        "ensembl": "ENSG00000184719",
        "pattern": r"\b(RNLS|Rnls|renalase|pargyline)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate4_Intrinsic_ER_Stress_UPR_Shield",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "TXNIP",
        "ensembl": "ENSG00000265972",
        "pattern": r"\b(TXNIP|thioredoxin-interacting protein|verapamil)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate4_Intrinsic_ER_Stress_UPR_Shield",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "MANF",
        "ensembl": "ENSG00000145050",
        "pattern": r"\b(MANF|mesencephalic astrocyte-derived neurotrophic factor)\b",
        "region_class": "Transgene_cDNA_Cassette",
        "functional_gate": "Gate4_Intrinsic_ER_Stress_UPR_Shield",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "SmallMolecule_Pharmacological_Modulator",
        "default_promoter": "Endogenous_Native_Promoter",
    },
    {
        "symbol": "SERPINB9",
        "ensembl": "ENSG00000170542",
        "pattern": r"\b(SERPINB9|PI-9|Spi6|serpin B9)\b",
        "region_class": "Transgene_cDNA_Cassette",
        "functional_gate": "Gate4_Intrinsic_Granzyme_Fas_Apoptosis_Shield",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "Lentiviral_or_Transposon_OE",
        "default_promoter": "Viral_or_Synthetic_CAG_EF1a_CMV",
    },
    {
        "symbol": "RIPK1",
        "ensembl": "ENSG00000137275",
        "pattern": r"\b(RIPK1|RIPK3|MLKL|necrostatin)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate4_Intrinsic_Granzyme_Fas_Apoptosis_Shield",
        "evaded": ["None_Not_Antigen_Specific"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "SLC30A8",
        "ensembl": "ENSG00000164756",
        "pattern": r"\b(SLC30A8|ZnT8|R325W|rs13266634)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate2_Autoantigen_or_Neoantigen_Stealth",
        "evaded": ["ZnT8A_SLC30A8"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "GAD2",
        "ensembl": "ENSG00000136750",
        "pattern": r"\b(GAD2|GAD65|GADA)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate2_Autoantigen_or_Neoantigen_Stealth",
        "evaded": ["GADA_GAD65"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "G6PC2",
        "ensembl": "ENSG00000152254",
        "pattern": r"\b(G6PC2|IGRP)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate2_Autoantigen_or_Neoantigen_Stealth",
        "evaded": ["IGRP_G6PC2"],
        "default_modality": "CRISPR_Cas9_KO",
        "default_promoter": "Not_Applicable_KO",
    },
    {
        "symbol": "PTPRN",
        "ensembl": "ENSG00000054356",
        "pattern": r"\b(PTPRN|IA-2|PTPRN2|phogrin|IA-2beta)\b",
        "region_class": "Whole_Gene_Coding_CDS",
        "functional_gate": "Gate2_Autoantigen_or_Neoantigen_Stealth",
        "evaded": ["IA2A_PTPRN_Phogrin"],
        "default_modality": "CRISPR_Cas9_KO",