OpenIslet

scripts/rank_islet1_stacks.py

Step 5 & 6: Project Islet-1 Sign-Sensitive, Endpoint-Oriented & Locus-Penalized Evaluator (v0.6.9).

script Release v0.8.0 gen-eb955f8266035aba 638 KB · 42 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/rank_islet1_stacks.py · SHA-256: c05d5fe606219e88…

            "embodiment_a_star_promoted_locus1_cassette_id": "LOC1_X1P_X2P_ARM1B_ASTAR_4143BP_BIDIR_2AFREE",
            "locus3_basalfloor_promoted_cassette_id": "LOC3_X3P_L3_BFB_4078BP_BASALFLOOR_SCARFREE",
            "decoded_genotype": {
                "X1_MHC_I": "B2M::HLA-E*01:03(VMAPRTLVL)" if x1 == 1 else "B2M-/-",
                "X2_CD47": "Constitutive_HighFloor_3prime_CD47_IgV_GPI_Locked" if x2 == 1 else "Endogenous_B2M_Promoter_CD47_WT",
                "X3_Locus3": "CXCL10::SERPINB9-GSG-tPT2A-PD-L1" if x3 == 1 else "CXCL10+/+",
                "X4_TYK2": "TYK2-/-" if x4 == 1 else "TYK2+/+",
                "X5_TXNIP": "TXNIP-/-" if x5 == 1 else "TXNIP+/+",
                "X6_RNLS": "RNLS-/-" if x6 == 1 else "RNLS+/+",
            },
        })

    for rep_idx, run_number in enumerate((35, 36), start=1):
        x1, x2, x3, x4, x5, x6 = HIP_LEAD_CHASSIS_A_CODED
        factorial_runs.append({
            "run_id": f"HIP_FACTORIAL_RUN_{run_number:02d}",
            "run_number": run_number,
            "stage_block": 1,
            "block": HIP_LEAD_CHASSIS_BLOCK,
            "coded_levels": {"X1": x1, "X2": x2, "X3": x3, "X4": x4, "X5": x5, "X6": x6},
            "locus1_physical_cassette_id": _locus1_physical_cassette_id(x1, x2),
            "embodiment_a_star_promoted_locus1_cassette_id": "LOC1_X1P_X2P_ARM1B_ASTAR_4143BP_BIDIR_2AFREE",
            "locus3_basalfloor_promoted_cassette_id": "LOC3_X3P_L3_BFB_4078BP_BASALFLOOR_SCARFREE",
            "decoded_genotype": {
                "X1_MHC_I": "B2M::HLA-E*01:03(VMAPRTLVL)",
                "X2_CD47": "Constitutive_HighFloor_3prime_CD47_IgV_GPI_Locked",
                "X3_Locus3": "CXCL10::SERPINB9-GSG-tPT2A-PD-L1",
                "X4_TYK2": "TYK2+/+",
                "X5_TXNIP": "TXNIP+/+",
                "X6_RNLS": "RNLS+/+",
            },
        })
    dalg = _hip_protocol_algebra_fields(factorial_runs)


    whole_product_safety_model = {
        "model_status": "Conditional_Preclinical_Safety_Target_Specification (Stage 3 entry gate; NOT demonstrated clinical safety)",
        "patient_level_target_justification": (
            "Targets <10^-3 per-patient probability of any prodrug-resistant clonogenic escape across a full curative pediatric dose "
            "(lambda = N_prolif * p_escape = 8.0e4 * 1.0e-8 = 8.0e-4 under independent single-cell escape, bounded below by the non-i.i.d. common-mode floor)."
        ),
        "effective_denominator_definition": (
            "Effective detectable clonogenic opportunities (N_prolif = 8.0e4 Ki-67+/SOX9+/OCT4+ residual proliferating cells capable of colony formation "
            "across undifferentiated, ductal/progenitor, and off-target states, plus <10^-6 TRA-1-60+/OCT4+ gating on both endocrine and iEC/iPericyte vascular streams), "
            "NOT total post-mitotic endocrine cells dispensed (8.0e8) or total living cells dispensed (9.335e8 = 8.0e8 endocrine + 1.335e8 iEC/iPericytes; R3-SCI-01, R3-SCI-02)."
        ),
        "total_graft_cells_per_curative_dose": 8.0e8,
        "total_endocrine_cells_per_curative_dose": 8.0e8,
        "total_vascular_stromal_cells_per_curative_dose": 1.335e8,
        "total_living_cells_per_curative_dose": 9.335e8,
        "post_mitotic_endocrine_fraction": 0.9999,
        "lot_release_max_residual_proliferating_fraction_f_prolif": 1.0e-4,
        "max_clonogenic_proliferating_cells_per_dose_N_prolif": 8.0e4,
        "target_per_clonogenic_cell_escape_bound_p_escape": 1.0e-8,
        "lot_release_clonogenic_assay_cells_screened_for_95pct_confidence": 3.0e8,
        "exact_clonogenic_assay_cells_for_95pct_confidence_unrounded": 299573227.3553991,
        "required_physical_cells_plated_at_33p4pct_detection_efficiency": 896925831,
        "required_physical_cells_plated_for_literal_300M_effective_cells_at_33p4pct": 898203593,
        "master_cell_bank_pooled_validation_cells_plated": 3.0e8,
        "lot_release_feasible_sub_lot_aliasing_cells_plated": 1.0e7,
        "expected_surviving_clonogenic_cells_per_dose_lambda": 8.0e-4,
        "per_dose_probability_of_any_clonogenic_escape": 0.0007997,
        "whole_product_proliferating_cells_total_N_prolif": 93350,
        "whole_product_expected_surviving_clonogenic_cells_lambda": 0.0009335,
        "whole_product_per_dose_probability_of_any_clonogenic_escape": 0.0009331,
        "pan_lineage_proliferating_cell_budget_sol61_r2": {
            "endocrine_proliferating_cells_at_f_prolif_1e_4": 80000,
            "vascular_iec_pericyte_proliferating_cells_at_f_prolif_1e_4": 13350,
            "total_pan_lineage_proliferating_cells_N_prolif_total": 93350,
            "expected_surviving_clonogenic_cells_pan_lineage_lambda": 0.0009335,
            "per_dose_probability_of_any_clonogenic_escape_pan_lineage": 0.0009331,
            "maximum_common_mode_q_to_keep_pan_lineage_total_risk_below_1e_3": 0.0000670,
            "maximum_common_mode_q_to_keep_pan_lineage_total_risk_below_1e_3_unrounded": 0.0000669981,
            "note": (
                "Explicitly accounts for both the 8.0e8 endocrine cell stream (80,000 residual proliferating cells at f_prolif <= 10^-4) "
                "and the 1.335e8 vascular iEC/iPericyte stream (13,350 residual proliferating cells if f_prolif <= 10^-4, or 93,350 total "
                "pan-lineage clonogenic opportunities per 9.335e8-cell graft): at p_escape <= 1.0e-8, pan-lineage Poisson hazard is "
                "lambda_total = 93,350 * 1.0e-8 = 9.335e-4 < 1.0e-3 (P(>=1 escape) = 0.0009331), keeping P_escape_total = q + (1 - q)*r_iid <= 1.0e-3 "
                "requires q <= (10^-3 - r_iid)/(1 - r_iid) = 0.0000669981 (~6.70e-5, vs 6.696e-5 under linear union-bound subtraction), and achieving N_eff = 299,573,227.36 "
                "effective clonogenic opportunities at empirical spike-in detection efficiency eta_detection = 0.334 requires plating "
                "N_input = 299,573,227.36 / 0.334 = 896,925,831 (~8.97e8) physical clonogenic cells across cumulative MCB qualification lots "
                "(AUDIT-REF & S55R2-D1-05)."
            ),
        },
        "clonogenic_validation_tier_distinction": {
            "routine_per_lot_sub_lot_screen": {
                "cells_plated_n": 1.0e7,
                "cells_plated_n_is_effective_clonogenic_opportunities_legacy_alias": True,
                "cells_plated_n_unit_semantics_note": "Deprecated effective-opportunity alias (N_eff = 1.0e7); use required_physical_cells_plated_at_33p4pct_detection_efficiency (29,940,120) for physical cell plating.",
                "effective_clonogenic_opportunities_n": 1.0e7,
                "physical_cells_plated_n": 29940120,
                "required_physical_cells_plated_at_33p4pct_detection_efficiency": 29940120,
                "zero_event_upper_95pct_per_cell_bound_p95": 2.9957e-7,
                "standalone_per_dose_escape_risk_at_p95_for_N_prolif_8e4": 0.02368,
                "spiked_ipsc_positive_control_denominator_reconciliation": {
                    "spiked_viable_ipscs_per_well_at_0_1pct_of_1_9356e7_cells": 19356,
                    "single_cell_matrigel_clonogenic_plating_efficiency": 0.20,
                    "effective_colony_forming_ipsc_units_n_eff_per_well": 3871,
                    "zero_colony_upper_95pct_bound_per_viable_spiked_ipsc": 0.0001548,
                    "zero_colony_upper_95pct_bound_per_colony_forming_unit": 0.0007739,
                    "note": (
                        "Reconciles the two spiked-iPSC denominators (Finding 055): spiking 0.1% undifferentiated iPSCs into "
                        "1.9356x10^7 Stage 7 cells introduces 19,356 total viable iPSCs per well; at 20% single-cell Matrigel/Y-27632 "
                        "clonogenic plating efficiency, this corresponds to n_eff = 0.20 * 19,356 = 3,871 effective colony-forming iPSC units "
                        "(or 23,227 colony-forming units pooled across 6 replicate wells)."
                    ),
                },
                "role": "Routine per-lot quality-control release screen across N_eff = 1.0x10^7 effective clonogenic opportunities (29,940,120 physical clonogenic cells plated at eta_detection = 0.334) catching gross batch silencing or contamination (cannot by itself prove p_escape <= 10^-8; AUDIT-REF).",
            },
            "master_cell_bank_pooled_validation": {
                "cells_plated_n": 3.0e8,
                "cells_plated_n_is_effective_clonogenic_opportunities_legacy_alias": True,
                "cells_plated_n_unit_semantics_note": "Deprecated effective-opportunity alias (N_eff = 3.0e8); use physical_cells_plated_n (896,925,831 for exact 10^-8 bound or 898,203,593 for literal 300M) for physical cell plating.",
                "effective_clonogenic_opportunities_n": 3.0e8,
                "effective_clonogenic_opportunities_screened_n_eff": 3.0e8,
                "effective_clonogenic_opportunities_for_1e8_bound_unrounded_n": 299573227.3553991,
                "effective_clonogenic_opportunities_at_896925831_physical_cells_n": 299573227.554,
                "physical_cells_plated_n": 896925831,
                "physical_cells_plated_at_eta_0p334_n_input": 896925831,
                "physical_cells_plated_for_1e8_bound_at_eta_0p334_n": 896925831,
                "physical_cells_plated_for_literal_300M_at_eta_0p334_n": 898203593,
                "physical_cells_plated_for_1e8_bound_at_clopper_pearson_eta_l95_0p269610_n": 1111135446,
                "required_physical_cells_plated_at_clopper_pearson_lower_95pct_efficiency_26p961pct": 1111135446,
                "spike_in_detection_efficiency_point_estimate_50_of_150": 0.333333,
                "spike_in_detection_efficiency_nominal_protocol_eta": 0.334,
                "spike_in_detection_efficiency_clopper_pearson_lower_95pct_eta_l95": 0.269610,
                "zero_event_upper_95pct_per_cell_bound_at_299p57M_p95": 1.0000e-8,
                "zero_event_upper_95pct_per_cell_bound_p95": 9.9858e-9,
                "wunderlich_2022_reference_benchmark_cells_tested": 8.0e8,
                "wunderlich_2022_zero_event_upper_95pct_bound": 3.7447e-9,
                "joint_confidence_and_pan_lineage_scope_qualification_astra_r3": (
                    "Reconciles exact vs rounded denominators and qualification scope (AUDIT-REF & S2-L1-06): "
                    "(1) N_eff = -ln(0.05)/10^-8 = 299,573,227.36 effective clonogenic opportunities yields p_95 = 1.0000e-8 and requires ceil(299,573,227.36 / 0.334) = 896,925,831 physical cells at nominal eta = 0.334 "
                    "(whereas literal rounded N_eff = 300,000,000 yields p_95 = 9.9858e-9 and requires ceil(300,000,000 / 0.334) = 898,203,593 physical cells); "
                    "(2) in the 50/150 = 0.333333 empirical spike-in calibration, the one-sided 95% Clopper-Pearson lower bound is eta_L95 = Beta_inv(0.05; 50, 101) = 0.269610 (requiring ceil(299,573,227.36 / 0.269610) = 1,111,135,446 physical cells if propagating eta_L95, with Bonferroni/union-bound simultaneous confidence >= 90% across two independent 95% bounds or >= 85% across three); "
                    "(3) because StemFlex + AP+ colony counting specifically assays residual hPSCs, pan-lineage N_prolif = 93,350 qualification additionally requires parallel post-AP1903 proliferative recovery screening of the 13,350 vascular iEC/iPericyte stream in EGM-2/pericyte medium with CD31+/CD144+/PDGFRB+/EdU+ readout; "
                    "(4) N_prolif = 93,350 represents the implant-time residual Ki67+ clonogenic pool (requiring pre-implant biallelic iCasp9 verification so post-engraftment vascular/stromal turnover cannot expand an unswitched clone)."
                ),
                "lot_release_vs_mcb_qualification_distinction_sonnet55_r2": (
                    "The 8.97x10^8 physical clonogenic cell screen (N_eff = 2.9957x10^8 [~3.0x10^8] at eta_detection = 0.334; 898,203,593 physical cells for literal 3.0000x10^8) is a one-time pre-clinical Master Cell Bank (MCB) "
                    "qualification pooled across 3-5 qualification differentiation campaigns (~1 clinical-dose equivalent total), whereas routine clinical lot release "
                    "uses the N_eff = 1.0x10^7 sub-lot clonogenic assay (29,940,120 physical cells plated at eta = 0.334) paired with targeted duplex sequencing of iCasp9 and promoter CpG methylation bisulfite sequencing (S55R2-D1-09 & AUDIT-REF)."
                ),
                "role": "Cumulative pre-clinical Master Cell Bank (MCB) qualification required to demonstrate p_escape <= 10^-8 across >=2.9957x10^8 (~3.0x10^8) effective clonogenic opportunities (896,925,831 physical clonogenic cells plated at eta_detection = 0.334 for exact 10^-8 bound, or 898,203,593 physical cells for literal 300M effective opportunities; <=0.08% endocrine-only / <=0.0933% pan-lineage i.i.d. per-dose risk; Wunderlich et al. 2022 PMID:35795779).",
            },
            "one_time_mcb_qualification": {
                "cells_plated_n": 3.0e8,
                "cells_plated_n_is_effective_clonogenic_opportunities_legacy_alias": True,
                "cells_plated_n_unit_semantics_note": "Deprecated effective-opportunity alias (N_eff = 3.0e8); use physical_cells_plated_n (896,925,831 for exact 10^-8 bound or 898,203,593 for literal 300M) for physical cell plating.",
                "effective_clonogenic_opportunities_n": 3.0e8,
                "effective_clonogenic_opportunities_screened_n_eff": 3.0e8,
                "effective_clonogenic_opportunities_for_1e8_bound_unrounded_n": 299573227.3553991,
                "physical_cells_plated_n": 896925831,
                "physical_cells_plated_for_literal_300M_at_eta_0p334_n": 898203593,
                "required_physical_cells_plated_at_clopper_pearson_lower_95pct_efficiency_26p961pct": 1111135446,
                "spike_in_detection_efficiency_nominal_protocol_eta": 0.334,
                "spike_in_detection_efficiency_clopper_pearson_lower_95pct_eta_l95": 0.269610,
                "zero_event_upper_95pct_per_cell_bound_at_299p57M_p95": 1.0000e-8,
                "zero_event_upper_95pct_per_cell_bound_p95": 9.9858e-9,
            },
        },
        "quantitative_common_mode_failure_floor": {
            "exact_conditional_mixture_formula": "P_escape_total = q_common_mode + (1 - q_common_mode) * (1 - (1 - p_iid) ** N_prolif)",
            "conservative_union_bound_approximation": "P_escape_total <= min(1.0, (1 - exp(-N_prolif * p_iid)) + q_common_mode)",
            "formula": "P_escape_total = q_common_mode + (1 - q_common_mode) * r_iid (bounded above by min(1, r_iid + q_common_mode))",
            "single_locus_aa_vs1_only_common_mode_floor_estimate": 1.0e-5,
            "dual_unlinked_loci_aavs1_plus_gapdh_common_mode_floor_target": 1.0e-7,
            "maximum_common_mode_q_to_keep_total_risk_below_1e_3": 0.0002005,
            "maximum_common_mode_q_to_keep_pan_lineage_93350_risk_below_1e_3": 0.0000670,
            "exact_unrounded_common_mode_q_max_for_pan_lineage_1e_3": 0.000066998080,
            "total_pan_lineage_escape_risk_at_rounded_q_6p70e_5": 0.0010000019,
            "nonparametric_zero_failure_batches_required_for_95pct_upper_bound_6p70e_5": 44713,
            "nonparametric_zero_failure_batches_required_for_95pct_upper_bound_exact_qmax": 44713,
            "nonparametric_zero_failure_batches_required_for_95pct_upper_bound_literal_6p70e_5": 44711,
            "scenario_assumption_status": (
                "Illustrative conditional engineering scenario assumptions (NOT empirically measured clinical failure frequencies). "
                "When endocrine-only r_iid = 1 - (1 - 10^-8)^(8e4) = 7.9968e-4, keeping P_escape_total = q + (1 - q)*r_iid <= 1.0e-3 requires q <= 2.005e-4; "
                "when pan-lineage r_iid = 1 - (1 - 10^-8)^(93,350) = 9.33064516e-4 (including 13,350 vascular iEC/iPericyte proliferating cells), keeping P_escape_total <= 1.0e-3 "
                "requires exact q <= (10^-3 - r_iid)/(1 - r_iid) = 0.000066998080 (~6.70e-5, where rounded-up 6.70e-5 gives P_escape_total = 0.0010000019 and linear union-bound subtraction gives 6.6935e-5; "
                "plating N_eff = -ln(0.05)/10^-8 = 299,573,227.36 effective cells at point-estimate eta = 0.334 requires 896,925,831 physical cells [or N_eff / eta_95_lower when propagating the Clopper-Pearson lower 95% confidence bound on the 50/150 spike-in recovery], whereas literal N_eff = 300,000,000 requires 898,203,593 physical cells, and if non-proliferating Stage-7 cells do not form colonies in the clonogenic assay then N_eff denominators count MACS-enriched proliferating/Ki67+ cells plated rather than bulk post-mitotic beta cells). "
                "Crucially, q_max = 6.70e-5 is a conditional preclinical risk-budget parameter (proving q_common <= q_max via non-parametric zero-failure batch testing 1 - 0.05^(1/n_batches) <= q_max would require "
                "ceil(ln(0.05)/ln(1 - 0.000066998080)) = 44,713 independent differentiation batches at exact unrounded q_max, or ceil(ln(0.05)/ln(1 - 6.70e-5)) = 44,711 batches at literal rounded 6.70e-5), and the Stage-0 5-aza-dC / BCL2L1 spike-in assay is a mechanistic positive-control challenge rather than an empirical prevalence bound on q_common (AUDIT-REF, AUDIT-REF & AUDIT-REF)."
            ),
            "note": (
                "Even when i.i.d. per-cell escape is <=10^-8, shared batch-level promoter methylation, pre-differentiation clonal mutation, "
                "or avascular prodrug under-exposure creates a non-i.i.d. common-mode floor unless mitigated by unlinked dual-locus insertion and post-differentiation QC."
            ),
            "common_mode_silencing_and_en_bloc_surgical_retrieval_gate_sol61_r5": {
                "finding_id": "AUDIT-REF",
                "decision_id": "DEC-044 / DEC-046",
                "primary_citations": ["PMID:35795779", "PMID:26455413"],
                "single_cell_correlated_escape_formula": "P_escape_cell = p_common_cell + (1 - p_common_cell) * (p_ind ** 2)",
                "per_graft_vs_per_cell_common_mode_distinction_astra6_r5": (
                    "Layer-1 q_common_mode <= 6.6998e-5 is the per-graft/per-batch catastrophic failure probability in P_escape_total = q_common_mode + (1 - q_common_mode)*(1 - (1 - p_cell)^93350), "