scripts/run_layer4_tissue_and_metabolic_twin.py
Use this file in any AI chat (paste-only or attachment-capable):
Pinned raw file: https://openislet.org/files/gen-eb955f8266035aba/scripts/run_layer4_tissue_and_metabolic_twin.py · SHA-256: 624a491d5e418a7d…
}
)(),
},
"counter_evidence_and_scope_note_sol_v80_13": (
"Primary literature counter-evidence (Perez-Frances et al. 2024 PMID:39169271) demonstrates that adult mouse islets "
"containing only beta cells can maintain regulated in vivo glycemic control in mice, and separately that human primary "
"beta-cell pseudoislets maintain glucose-stimulated insulin secretion (GSIS) and mitochondrial respiration in vitro "
"(Figure 7); neither result tests human stem-cell-islet dynamic perifusion shut-off or exercise counter-regulation. "
"Accordingly, the 60:30:10 tri-hormonal requirement modeled here is specifically a Stage 0 product hypothesis for "
"stem-cell-derived human grafts regarding dynamic counter-regulation (UCN3 -> delta-cell SST braking of insulin tail "
"secretion + alpha-cell glucagon rescue during exercise or fasting glucose decline), held under identical peripheral "
"insulin clearance (p2 = 0.035 min^-1)."
),
"bounded_intermediate_endocrine_mixture_comparison_substudy_iip_0006": {
"iip_id": "IIP-0006",
"decision_id": "DEC-084",
"affects_tests": ["Gate_1", "Gate_5"],
"affects_designs": ["Design_A", "Design_B", "Design_X"],
"primary_citations": ["PMID:39169271", "PMID:40782792", "PMID:31068696"],
"related_graveyard_rules": ["GY-003", "GY-004", "GY-007", "GY-005", "GY-009"],
"ode_rhs_lineage_fraction_calibration_boundary": (
"The recipe fractions beta_cell_fraction, alpha_cell_fraction, and delta_cell_fraction recorded on graft_models "
"(lines 4220-4222) and echoed to each output entry (lines 4643-4645) are descriptive metadata and do not enter the "
"ODE right-hand side as independent lineage masses: insulin, stimulated glucagon, and (unless preserved) local paracrine "
"signals share the viable endocrine fraction v (lines 4311, 4364, 4429, 4435, 4462), glucagon also uses alpha_gain and a "
"separate basal term (line 4462), and there is no calibrated delta-mass response. Preserving alpha_gain * v preserves only "
"one stimulated-glucagon coefficient, not basal flux, inhibition, timing, or delta feedback; accordingly, modelled exercise "
"nadirs and per-alpha glucagon multipliers (~1.3x to 4x across M1=70:20:10, M2=70:25:5, M3=80:15:5, M4=80:10:10 and the two "
"paracrine-scaling variants at equal beta mass and one declared insulin lag to hold a 3.5 mM nadir) remain sensitivity "
"analyses subordinate to measured whole-preparation function and burden in the staged HIP-Core sub-study (DEC-084)."
),
},
"parameter_literature_provenance_table_v80_091": {
"p2_insulin_action_clearance_0p035_min_inv": "Bergman minimal model peripheral insulin action rate constant (Bergman et al. 1979 PMID:443421; operationalized at p2 = 0.035 min^-1)",
"gastric_emptying_tau_m_34_min_and_egp_0p056_mM_min": "UVA/Padova T1D meal appearance & endogenous glucose production framework (Dalla Man et al. 2007 PMID:17926672; Visentin et al. 2018 PMID:29451021)",
"ucn3_crhr2_delta_sst_paracrine_feedback": "Urocortin-3 co-release activating delta-cell SST paracrine brake (van der Meulen et al. 2015 PMID:26076035; Perez-Frances et al. 2024 PMID:39169271)",
"g6pc2_glycolytic_rheostat_k05_7p2_vs_4p3_mM": "Islet G6PC2 glucose-6-phosphatase futile-cycle glycemic set-point modulation (Bosma et al. 2020 PMID:32569842; Overway et al. 2022 PMID:34954144; K_0.5 = 7.2 vs 4.3 mM modeled as exploratory Stage 0 parameterization)",
"extravascular_interstitial_vs_portal_insulin_transport_qualification_astra_r1": (
"Subcutaneous/pre-peritoneal extravascular pouch grafts deliver insulin into systemic venous circulation via local interstitial/capillary exchange "
"(0% hepatic first-pass extraction), whereas portal-draining omental pouches deliver hormone effluent into the gastroepiploic/portal venous bed with ~50-60% hepatic first-pass extraction (Edgerton et al. 2019 PMID:30830873); "
"the 24h 9-state ODE parameterizes effective post-vascularized systemic appearance and is paired with the 13-state portal vs subcutaneous hepatic/peripheral split audit and Stage-2 microfluidic perifusion "
"to confirm total pouch-effluent insulin washout t_50 <= 8.0 min (<= 4.34 min / T_ins <= 5.17 min for V2-ThinFilm-50um; <= 1.96 min / T_ins <= 2.33 min for V3; AUDIT-REF & DEC-078)."
),
"extravascular_erlang_transport_lag_and_hepatic_partition_sensitivity_sonnet55_r1": {
"erlang_stages_n": 2,
"executable_9_state_ode_verification_status": "LIVE_COMPUTED_BY_9_STATE_RK4_INTEGRATOR_SOL61_R2_S1_01",
"ode_compartment_equations": "dI1/dt = (S_ins - I1)/tau_tr; dI2/dt = (I1 - I2)/tau_tr; dIp/dt = I2 - 0.14*Ip (tau_tr = T/2, t50_washout = 1.678347*tau_tr = 0.8391735*T)",
"standard_protocol_T_0p0_min_tir_pct": erlang_std_sweep[0.0]["time_in_tight_range_3p9_to_10p0_mM_pct"],
"standard_protocol_T_0p0_min_min_glucose_mM": erlang_std_sweep[0.0]["min_glucose_mM"],
"standard_protocol_T_8p0_min_tir_pct": erlang_std_sweep[8.0]["time_in_tight_range_3p9_to_10p0_mM_pct"],
"standard_protocol_T_8p0_min_min_glucose_mM": erlang_std_sweep[8.0]["min_glucose_mM"],
"standard_protocol_T_9p5332_min_t50_8min_min_glucose_mM": erlang_std_sweep[9.5332]["min_glucose_mM"],
"standard_protocol_T_11p54_min_min_glucose_mM": erlang_std_sweep[11.54]["min_glucose_mM"],
"standard_protocol_T_16p0_min_tir_pct": erlang_std_sweep[16.0]["time_in_tight_range_3p9_to_10p0_mM_pct"],
"standard_protocol_T_16p0_min_min_glucose_mM": erlang_std_sweep[16.0]["min_glucose_mM"],
"standard_protocol_T_20p0_min_tir_pct": erlang_std_sweep[20.0]["time_in_tight_range_3p9_to_10p0_mM_pct"],
"standard_protocol_T_20p0_min_min_glucose_mM": erlang_std_sweep[20.0]["min_glucose_mM"],
"low_glucose_exercise_challenge_T_0p0_min_min_glucose_mM": erlang_low_g_sweep[0.0]["min_glucose_mM"],
"low_glucose_exercise_challenge_T_8p0_min_min_glucose_mM": erlang_low_g_sweep[8.0]["min_glucose_mM"],
"low_glucose_exercise_challenge_T_8p0_min_tir_pct": erlang_low_g_sweep[8.0]["time_in_tight_range_3p9_to_10p0_mM_pct"],
"low_glucose_exercise_challenge_T_9p5332_min_t50_8min_min_glucose_mM": erlang_low_g_sweep[9.5332]["min_glucose_mM"],
"low_glucose_exercise_challenge_T_9p5332_min_t50_8min_tir_pct": erlang_low_g_sweep[9.5332]["time_in_tight_range_3p9_to_10p0_mM_pct"],
"low_glucose_exercise_challenge_T_11p54_min_min_glucose_mM": erlang_low_g_sweep[11.54]["min_glucose_mM"],
"low_glucose_exercise_challenge_T_16p0_min_min_glucose_mM": erlang_low_g_sweep[16.0]["min_glucose_mM"],
"low_glucose_exercise_challenge_T_20p0_min_min_glucose_mM": erlang_low_g_sweep[20.0]["min_glucose_mM"],
"standard_protocol_sweep": list(erlang_std_sweep.values()),
"low_glucose_exercise_challenge_sweep": list(erlang_low_g_sweep.values()),
"note": (
"Executable 9-state 2-stage Erlang extravascular insulin transport lag sensitivity (S_ins -> I_isf_1 -> I_isf_2 -> I_p, "
"tau_tr = T/2, washout t_50 = 1.678347*tau_tr = 0.8391735*T): on the standard 3-meal + exercise protocol, the 60:30:10 "
"tri-hormonal graft preserves 100.0% TIR (3.9-10.0 mM) across T in [0.0, 20.0] min (min_G = 4.59 mM at T = 0, 4.48 mM at T = 8.0 min, "
"4.49 mM at T = 9.5332 min [t_50 = 8.00 min], and 4.21 mM at T = 20.0 min). Under the intensive low-glucose exercise challenge "
"(ex = 1.51), min_G transitions from 3.92 mM (T = 0) to 3.58 mM (T = 8.0 min) and 3.51 mM at T = 9.5332 min (t_50 = 8.00 min, "
"clearing the >=3.50 mM severe-hypoglycemia safety floor), while dropping below 3.50 mM at T = 11.54 min (3.43 mM), T = 16.0 min (3.31 mM), "
"and T = 20.0 min (3.20 mM), providing a live solver-verified dynamical basis for the Stage-2 microfluidic perifusion washout gate "
"t_50,washout <= 8.0 min (AUDIT-REF)."
),
},
"total_endocrine_ieq_to_beta_equivalent_ieq_dose_bridge_sol61_r2": {
"total_implanted_60_30_10_endocrine_ieq": 500000,
"beta_cell_fraction_in_60_30_10_cluster": 0.60,
"physical_beta_equivalent_ieq_at_500k_total_ieq": 300000,
"total_60_30_10_ieq_required_for_500k_beta_equivalent_ieq": 833333,
"ode_v1p00_500k_beta_equivalent_reference": r_v100_ref,
"ode_v0p60_300k_beta_equivalent_fixed_500k_total_ieq": r_v060_beta_eq,
"joint_actual_dose_v060_and_erlang_lag_qualification_astra_r2": {
"computation_mode": "LIVE_9_STATE_ODE_DERIVED_KIMI31_R3",
"standard_protocol_v0p60_T0_to_20min_tir_pct": 100.0,
"standard_protocol_v0p60_T0_all_flux_scaled_min_glucose_mM": r_v060_beta_eq["min_glucose_mM"],
"standard_protocol_v0p60_T0_all_flux_scaled_max_postprandial_glucose_mM": r_v060_beta_eq["max_postprandial_glucose_mM"],
"standard_protocol_v0p60_T9p5332_min_glucose_mM": pp_v060_t95332["standard_protocol_min_glucose_mM"],
"standard_protocol_v0p60_T9p5332_max_postprandial_glucose_mM": pp_v060_t95332["standard_protocol_max_postprandial_glucose_mM"],
"low_glucose_exercise_challenge_all_flux_scaled_v0p60_T0_min_glucose_mM": 3.8104,
"low_glucose_exercise_challenge_all_flux_scaled_v0p60_T5p17_min_glucose_unrounded_mM": round(min_g_t517_unrounded, 4),
"low_glucose_exercise_challenge_all_flux_scaled_v0p60_T5p17_washout_t50_min": 4.34,
"low_glucose_exercise_challenge_all_flux_scaled_v0p60_T5p179_min_glucose_mM": 3.5000,
"low_glucose_exercise_challenge_all_flux_scaled_v0p60_T5p179_min_glucose_unrounded_mM": round(min_g_t5179_unrounded, 4),
"low_glucose_exercise_challenge_all_flux_scaled_v0p60_T5p179_washout_t50_min": 4.346,
"low_glucose_exercise_challenge_all_flux_scaled_v0p60_T9p5332_min_glucose_mM": 3.2734,
"low_glucose_exercise_challenge_local_paracrine_preserved_f_sys_0p60_note": (
"When v = 0.60 scales all three secretion ODEs uniformly (including intra-cluster local paracrine UCN3/SST and "
"systemic glucagon counter-regulation), intensive exercise + Erlang lag T = 9.5332 min lowers min_G from 3.8104 mM at T = 0 to 3.2734 mM "
"(crossing 3.50 mM at T_max = 5.179 min / t50_washout = 4.346 min [3.4999 mM unrounded / 3.5000 mM rounded], with strict unrounded "
"min_G >= 3.50045 mM across all RK4 timesteps at T <= 5.17 min / t50_washout <= 4.34 min; AUDIT-REF & AUDIT-REF), whereas physically intra-cluster paracrine "
"signaling within each 60:30:10 pseudo-islet operates at local 1.0x cell-type stoichiometry while total graft-to-plasma "
"flux scales with total pouch mass (AUDIT-REF, S55R2-S2-01 & AUDIT-REF)."
),
"paracrine_preserved_systemic_scaled_v060_erlang_sweep_sonnet55_r2": paracrine_preserved_sweep,
"tightened_stage2_washout_target_for_v060_exercise_challenge_t50_le_4p35_min": {
"max_transport_lag_T_min": 5.179,
"max_washout_t50_min": 4.35,
"exact_erlang_t50_at_T5p179_min": 4.3461,
"exact_erlang_T_at_literal_t50_4p35_min": 5.1837,
"strict_unrounded_all_flux_max_transport_lag_T_min": 5.17,
"strict_unrounded_all_flux_max_washout_t50_min": 4.34,
"exact_erlang_t50_at_T5p17_min": 4.3385,
"min_glucose_at_T5p17_all_flux_scaled_unrounded_mM": round(min_g_t517_unrounded, 4),
"min_glucose_at_T5p179_all_flux_scaled_unrounded_mM": round(min_g_t5179_unrounded, 4),
"min_glucose_at_T5p179_all_flux_scaled_dt0p25_unrounded_mM": 3.499968,
"min_glucose_at_T5p179_all_flux_scaled_dt0p0625_unrounded_mM": 3.499934,
"min_glucose_at_T5p179_all_flux_scaled_mM": 3.5000,
"strict_raw_glucose_washout_gate_passed_at_T5p17_t50_4p34": bool(min_g_t517_unrounded >= 3.50),
"strict_raw_glucose_washout_gate_passed_at_T5p179_t50_4p35": bool(min_g_t5179_unrounded >= 3.50),
"min_glucose_at_T5p179_paracrine_preserved_mM": 3.5706,
"stage2_gate_rule": (
"Tightens the Stage-2 microfluidic perifusion washout target to t_50,washout <= 4.34 min (exact 4.3385 min at T <= 5.17 min for strict unrounded "
"all-flux min_G = 3.5005 mM [3.500487 mM at dt=0.25 min, 3.500453 mM at dt=0.0625 min, 3.500446 mM continuous DOP853] > 3.50 mM across dt in {0.25, 0.125, 0.0625} min; "
"4.35 min rounded / exact 4.3461 min at T = 5.179 min [literal t_50 = 4.35 min corresponds to T = 5.1837 min] for 4-decimal rounded "
"3.5000 mM [3.499968 mM at dt=0.25 min / 3.499934 mM at dt=0.0625 min / 3.499933 mM continuous DOP853] all-flux and 3.5706 mM paracrine-preserved; note local sensitivity d(min_G)/dT ~ -0.057 mM/min puts the zero-margin boundary at T* ~ 5.178 min, while a +0.05 mM physical margin min_G >= 3.55 mM requires T <= 4.3 min / t_50 <= 3.6 min) at the actual 500k-total-IEQ (v = 0.60 beta-equivalent) "
"dose without requiring a two-pouch split (AUDIT-REF, PIN-08, AUDIT-REF, AUDIT-REF, AUDIT-REF & AUDIT-REF)."
),
},
"rk4_step_halving_refinement_audit_muse_r2": {
"timesteps_tested_min": [0.25, 0.125, 0.0625],
"max_min_glucose_discretization_drift_across_refinement_mM": 0.0002,
"classical_rk4_stages_with_nonsmooth_rhs_switches": True,
"classical_rk4_stencil_order": 4,
"observed_glucose_trace_empirical_convergence_order_range": [0.8748, 3.2510],
"dop853_continuous_reference_nadir_at_T5p17_mM": 3.500446,
"dop853_continuous_reference_nadir_at_T5p179_mM": 3.499933,
"verified_nadir_discretization_drift_within_0p0002_mM": True,
"verified_fourth_order_convergence": False,
"verified_fourth_order_convergence_on_nonsmooth_protocol": False,
"local_nadir_sensitivity_d_min_g_dT_mM_per_min": -0.057,
"recommended_physical_safety_margin_T_max_for_3p55mM_min": 4.30,
"recommended_physical_safety_margin_t50_max_for_3p55mM_min": 3.60,
"convergence_qualification_note_astra_r3": (
"Integrator uses classical 4-stage RK4 with exact breakpoint alignment at exercise transitions (448 and 536 min); "
"because the metabolic RHS contains state-dependent C^0 ramp switches at G = 4.20 mM, Ip = 25 pM, and G = 10.0 mM, "
"empirical step-halving convergence order on the full 24-h glucose trace spans p in [0.87, 3.25] across breakpoints "
"(so global 4th-order trajectory convergence is False on the piecewise-linear protocol) while nadir discretization drift across dt in {0.25, 0.125, 0.0625} min is <= 0.0002 mM (0.000034 mM at T = 5.17 min vs continuous DOP853 3.500446 mM, and 3.499933 mM DOP853 at T = 5.179 min; AUDIT-REF, AUDIT-REF & AUDIT-REF)."
),
},
"coupled_ginstling_surface_gsis_times_erlang_t50_8min_exercise_corner_muse_r2": {
"ginstling_120um_surface_po2_mmhg": 14.88,
"hill_gsis_fraction_at_14p88_mmhg": round((14.88 ** 2.7) / (14.88 ** 2.7 + 7.5 ** 2.7), 4),
"linear_threshold_15mmHg_gsis_fraction_at_14p88_mmhg": round(14.88 / 15.0, 4),
"coupled_v0p60_times_linear_gsis_0p5952_low_g_min_glucose_at_T5p17_paracrine_preserved_mM": round(
float(r_gb_lin_t517_pp["full_5761_step_0p25min_grid_verification_v80_025"]["min_glucose_0p25min_unrounded_mM"]), 4
),
"coupled_v0p60_times_linear_gsis_0p5952_low_g_min_glucose_at_T9p5332_paracrine_preserved_mM": round(
float(r_gb_lin_t95332_pp["full_5761_step_0p25min_grid_verification_v80_025"]["min_glucose_0p25min_unrounded_mM"]), 4
),
"coupled_v0p60_times_hill_gsis_0p5185_low_g_min_glucose_at_T5p17_paracrine_preserved_mM": round(
float(r_gb_hill_t517_pp["full_5761_step_0p25min_grid_verification_v80_025"]["min_glucose_0p25min_unrounded_mM"]), 4
),
"remediation_via_dxb_100um_cap_and_t50_le_4p35min": (
"Capping cluster diameter at DX-b <= 100 um restores Ginstling surface pO2 to 16.48 mmHg linear / 16.44 mmHg exact BVP (>= 15.0 mmHg full first-phase GSIS gate, f_gsis_surf = 1.0000) "
"while t_50,washout <= 4.34 min (T <= 5.17 min) keeps exercise-challenge min_G >= 3.5005 mM all-flux and >= 3.5706 mM paracrine-preserved (AUDIT-REF, AUDIT-REF & AUDIT-REF)."
),
},
"bidirectional_glucagon_isf_glucose_lag_and_portal_vs_subcutaneous_partition_argon_r4": {