scripts/verify_iip0057_foundry_v2_shield_invvax_insl82i_cuffv2.py
Use this file in any AI chat (paste-only or attachment-capable):
Pinned raw file: https://openislet.org/files/gen-eb955f8266035aba/scripts/verify_iip0057_foundry_v2_shield_invvax_insl82i_cuffv2.py · SHA-256: 1c63dcf649c42be4…
record_id="REC_G36_INS_SYNTH_001",
gate_source=CANONICAL_GATE36_MODULE_SOURCES["ins"],
product_id="ISLET1_DESIGN_Y_V3",
lot_id="SYNTH_INS_LOT_001",
bank_id="MCB_Y_SYNTH_01",
bank_origin="allogeneic_hiPSC",
construct_manifest_sha256=ins_csha,
extra_fields={
"study_id": "INS_L82I_DAY1_HLA_PEPTIDOMICS_SYNTH_001",
"editor_class": "PE2max",
"mlh1dn_used": False,
"day1_cpeptide_elisa_kit_records": copy.deepcopy(ins_elisa_kits),
"kit_catalog_ids": {
"Roche Elecsys": "ROCHE-03184897190",
"Mercodia": "MERCODIA-10-1136-01",
"Siemens": "SIEMENS-ADVIA-03649928",
},
"mercodia_low_end_0p05_verified": True,
"mercodia_dilution_linearity_5p00_verified": True,
"hla_binding_verified": True,
"hla_allele_panel_records": copy.deepcopy(ins_hla_panels),
"unique_hla_donor_count": 12,
"hla_peptides_tested": {
"HLA-DRB1*04:01": "GSLQPLAIEGSLQKRGIV",
"HLA-A*02:01": "SLQPLAIEGSL",
"HLA-A*11:01": "LAIEGSLQK",
},
"product_cell_peptidomics_verified": True,
"rna_splicing_delta_psi_pct": 0.2,
"proinsulin_to_insulin_ratio_vs_wt": 1.05,
"per_lot_bystander_edit_pct": 0.0,
"gsis_si": 3.4,
"gsis_pct_of_wt": 96.0,
"hip_reduction_pct": 91.0,
},
),
"editor_class": "PE2max",
"mlh1dn_used": False,
"day1_cpeptide_elisa_kit_records": copy.deepcopy(ins_elisa_kits),
"mercodia_low_end_0p05_verified": True,
"mercodia_dilution_linearity_5p00_verified": True,
"hla_binding_verified": True,
"hla_allele_panel_records": copy.deepcopy(ins_hla_panels),
"product_cell_peptidomics_verified": True,
"rna_splicing_delta_psi_pct": 0.2,
"proinsulin_to_insulin_ratio_vs_wt": 1.05,
"per_lot_bystander_edit_pct": 0.0,
"gsis_si": 3.4,
"gsis_pct_of_wt": 96.0,
"hip_reduction_pct": 91.0,
},
"cuff": {
"evidence_tier": "SYNTHETIC_FIXTURE",
"target_arm_id": "B",
"product_id": "ISLET1_DESIGN_B_V090",
"lot_id": "SYNTH_CUFF_LOT_001",
"bank_id": "MCB_B_SYNTH_01",
"bank_origin": "allogeneic_hiPSC",
"manifest_sha256": EXPECTED_ARM_MANIFEST_SHA256,
"construct_manifest_sha256": cuff_csha,
"design_a_exposed": False,
"study_id": "CUFF_V2_EXACT_STACK_GY025_SYNTH_001",
"upstream_lot_evidence_record": _make_evidence_record_v2(
record_id="REC_G34_SYNTH_CUFF_001",
gate_source=CANONICAL_UPSTREAM_GATE34_SOURCE,
product_id="ISLET1_DESIGN_B_V090",
lot_id="SYNTH_CUFF_LOT_001",
bank_id="MCB_B_SYNTH_01",
bank_origin="allogeneic_hiPSC",
construct_manifest_sha256=cuff_csha,
),
"current_assay_evidence_record": _make_evidence_record_v2(
record_id="REC_G36_CUFF_SYNTH_001",
gate_source=CANONICAL_GATE36_MODULE_SOURCES["cuff"],
product_id="ISLET1_DESIGN_B_V090",
lot_id="SYNTH_CUFF_LOT_001",
bank_id="MCB_B_SYNTH_01",
bank_origin="allogeneic_hiPSC",
construct_manifest_sha256=cuff_csha,
extra_fields={
"study_id": "CUFF_V2_EXACT_STACK_GY025_SYNTH_001",
"core_cuff_proteins": ["sCR1_v2", "THBD-M406L", "CD200-ECD"],
"per_protein_conjugation_records": copy.deepcopy(cuff_conj),
"free_thiol_um": 0.4,
"coimmobilized_cd200r_accessibility_verified": True,
"coimmobilized_cd200r_binding_pct_of_unhindered": 89.0,
"fasl_present": False,
"fasl_lcms_below_llod": True,
"retired_cfh_19_445_absent": True,
"monomer_pct": 97.0,
"retention_30d_pct": 97.5,
"leaching_30d_serum_pct": 1.1,
"paired_igg_depleted_control_included": True,
"adcc_donor_n": 8,
"intact_serum_total_killing_u95_pct": 3.2,
"paired_igg_attributable_cd16_adcc_u95_pct": 2.1,
"classical_c4b2a_residual_l95_pct": 2.0,
"classical_c4b2a_residual_u95_pct": 6.4,
"lectin_c4b2a_residual_l95_pct": 2.4,
"lectin_c4b2a_residual_u95_pct": 7.1,
"alternative_c5b9_residual_u95_pct": 3.2,
"overall_20pct_nhs_c5b9_residual_u95_pct": 3.8,
"classical_c4d_c5b9_drop_pct": 94.0,
"lectin_c4d_c5b9_drop_pct": 93.0,
"alternative_c3b_c5b9_drop_pct": 95.0,
"exact_stack_efferocytosis_abs_pct": 86.5,
"exact_stack_efferocytosis_pct_of_wt": 88.0,
"exact_stack_pericyte_recruitment_pct_of_wt": 84.0,
"plvap_iec_morphogenesis_t50_h": 24.0,
"plvap_iec_viability_pct": 92.0,
"thbd_h2o2_apc_retention_pct": 91.0,
"bulk_aptt_ratio": 1.04,
"pmn_residual_lysis_pct": 3.0,
},
),
"core_cuff_proteins": ["sCR1_v2", "THBD-M406L", "CD200-ECD"],
"per_protein_conjugation_records": copy.deepcopy(cuff_conj),
"free_thiol_um": 0.4,
"coimmobilized_cd200r_accessibility_verified": True,
"coimmobilized_cd200r_binding_pct_of_unhindered": 89.0,
"fasl_present": False,
"fasl_lcms_below_llod": True,
"retired_cfh_19_445_absent": True,
"monomer_pct": 97.0,
"retention_30d_pct": 97.5,
"leaching_30d_serum_pct": 1.1,
"paired_igg_depleted_control_included": True,
"adcc_donor_n": 8,
"intact_serum_total_killing_u95_pct": 3.2,
"paired_igg_attributable_cd16_adcc_u95_pct": 2.1,
"classical_c4b2a_residual_l95_pct": 2.0,
"classical_c4b2a_residual_u95_pct": 6.4,
"lectin_c4b2a_residual_l95_pct": 2.4,
"lectin_c4b2a_residual_u95_pct": 7.1,
"alternative_c5b9_residual_u95_pct": 3.2,
"overall_20pct_nhs_c5b9_residual_u95_pct": 3.8,
"classical_c4d_c5b9_drop_pct": 94.0,
"lectin_c4d_c5b9_drop_pct": 93.0,
"alternative_c3b_c5b9_drop_pct": 95.0,
"exact_stack_efferocytosis_abs_pct": 86.5,
"exact_stack_efferocytosis_pct_of_wt": 88.0,
"exact_stack_pericyte_recruitment_pct_of_wt": 84.0,
"plvap_iec_morphogenesis_t50_h": 24.0,
"plvap_iec_viability_pct": 92.0,
"thbd_h2o2_apc_retention_pct": 91.0,
"bulk_aptt_ratio": 1.04,
"pmn_residual_lysis_pct": 3.0,
},
"invvax": {
"evidence_tier": "SYNTHETIC_FIXTURE",
"target_arm_id": "D",
"product_id": "ISLET1_DESIGN_D1B_LEAN_K2",
"lot_id": "SYNTH_INVVAX_LOT_001",
"bank_id": "MCB_D_SYNTH_01",
"bank_origin": "autologous_hiPSC",
"manifest_sha256": EXPECTED_ARM_MANIFEST_SHA256,
"construct_manifest_sha256": iv_csha,
"design_a_exposed": False,
"study_id": "INVVAX_PRETX_3DOSE_WASHOUT_SYNTH_001",
"upstream_lot_evidence_record": _make_evidence_record_v2(
record_id="REC_G34_SYNTH_INVVAX_001",
gate_source=CANONICAL_UPSTREAM_GATE34_SOURCE,
product_id="ISLET1_DESIGN_D1B_LEAN_K2",
lot_id="SYNTH_INVVAX_LOT_001",
bank_id="MCB_D_SYNTH_01",
bank_origin="autologous_hiPSC",
construct_manifest_sha256=iv_csha,
),
"current_assay_evidence_record": _make_evidence_record_v2(
record_id="REC_G36_INVVAX_SYNTH_001",
gate_source=CANONICAL_GATE36_MODULE_SOURCES["invvax"],
product_id="ISLET1_DESIGN_D1B_LEAN_K2",
lot_id="SYNTH_INVVAX_LOT_001",
bank_id="MCB_D_SYNTH_01",
bank_origin="autologous_hiPSC",
construct_manifest_sha256=iv_csha,
extra_fields={
"study_id": "INVVAX_PRETX_3DOSE_WASHOUT_SYNTH_001",
"administration_days": [-28, -21, -7],
"last_dose_day": -7,
"clearance_sample_day": -4,
"plasma_assay_id": "LCMS_INVVAX_PLASMA_V1",
"lymph_node_assay_id": "LCMS_INVVAX_LYMPH_NODE_V1",
"plasma_llod_ng_ml": 0.05,
"tissue_llod_ng_g": 0.10,
"measured_plasma_conc_ng_ml": 0.01,
"measured_tissue_conc_ng_g": 0.02,
"max_ae_grade": 0,
"day90_cpeptide_retention_pct": 92.0,
"lymphocyte_count_pct_of_baseline": 98.0,
"treg_tr1_fold_expansion": 2.6,
"islet_antigens_suppressed_count": 4,
"islet_ag_elispot_drop_pct": 86.0,
"viral_vaccine_recall_retention_pct": 94.0,
},
),
"administration_days": [-28, -21, -7],
"last_dose_day": -7,
"clearance_sample_day": -4,
"plasma_assay_id": "LCMS_INVVAX_PLASMA_V1",
"lymph_node_assay_id": "LCMS_INVVAX_LYMPH_NODE_V1",
"plasma_llod_ng_ml": 0.05,
"tissue_llod_ng_g": 0.10,
"measured_plasma_conc_ng_ml": 0.01,
"measured_tissue_conc_ng_g": 0.02,
"max_ae_grade": 0,
"day90_cpeptide_retention_pct": 92.0,
"lymphocyte_count_pct_of_baseline": 98.0,
"treg_tr1_fold_expansion": 2.6,
"islet_antigens_suppressed_count": 4,
"islet_ag_elispot_drop_pct": 86.0,
"viral_vaccine_recall_retention_pct": 94.0,
},
}
def build_trusted_store_for_obs(
obs: dict[str, Any],
*,
store_key_mode: str = "record_id",
) -> dict[str, dict[str, Any]]:
"""Build a trusted_evidence_store indexing upstream_lot_evidence_record, current_assay_evidence_record, and (when present) live_gate32_debris_recall_record."""
store: dict[str, dict[str, Any]] = {}
for rk in (
"upstream_lot_evidence_record",
"current_assay_evidence_record",
"live_gate32_debris_recall_record",
):
rec = obs.get(rk)
if isinstance(rec, dict):
if store_key_mode == "both":
if isinstance(rec.get("record_id"), str):
store[rec["record_id"]] = copy.deepcopy(rec)
if isinstance(rec.get("archive_sha256"), str):
store[rec["archive_sha256"]] = copy.deepcopy(rec)
elif store_key_mode == "archive_sha256":
if isinstance(rec.get("archive_sha256"), str):
store[rec["archive_sha256"]] = copy.deepcopy(rec)
else:
if isinstance(rec.get("record_id"), str):
store[rec["record_id"]] = copy.deepcopy(rec)
return store
def make_authenticated_gate34_fixture_and_store(
module_name: str,
*,
arm_id: str | None = None,
arm_manifest: dict[str, Any] | None = None,
upstream_record: dict[str, Any] | None = None,