In-Vitro Screening System — Complete Architecture + Formal Formula Pack for Deterministic QC and Selection (5HN & CD8)
CASE STUDY
This case study documents an end-to-end, stage-locked screening system: the execution architecture (Stage-1), the delivery/governance pack (IDs, freeze rules, manifests, scenario/verification plan), and a complete Stage-2 mathematical formalization that eliminates ambiguity in QC and selection.
Snapshot
- Domain: In-vitro intervention screening, experimental governance, quality control, deterministic decision engines
- Intervention: Static oscillating magnetic field (sOMF) exposure under a locked exposure specification
- Models: 5HN and CD8 (sham control on every plate and every day)
- Timepoints: 12h and 24h from a strictly defined exposure start (t=0)
- Primary endpoint: MTT viability at 24h (MTT@24h)
- Selection outcomes: Tier-A / Tier-B / Repeat / Inconclusive (after repeat) / No-effect
- Run status: Tri-state: passed / flagged / failed
Why this system was needed
Many in-vitro screens fail in practice for reasons that are not biological: vague definitions of t=0, incomplete sham coverage, silent handling of missing wells, inconsistent normalization, plate drift that is detected but not governed, and decision rules that remain partly verbal—allowing “interpretation drift” after results appear.
The goal here was to build a screening system that is operationally executable and mathematically verifiable: every QC trigger, evaluability condition, normalization rule, and selection gate is explicitly defined, version-locked, and auditable.
What we built
1) Stage-1 Execution Architecture (complete, stage-locked)
A locked protocol + data/QC system + analysis plan that executes single-frequency sOMF exposure on 5HN and CD8 at 12h/24h, screens with MTT@24h, and runs mechanistic endpoints (Annexin, Rh123±ATP, TEM) only on selected conditions. The design includes mandatory randomization/plate-blocking, sham on every plate and every day, locked seeding/confluency rules (range + explicit calculation), a strict definition of exposure start (t=0), a locked normalization policy, locked thresholds for interruption/insufficient tech/plate drift/temperature deviation, and an explicit “no-effect” semantics.
2) Stage-1 Delivery & Governance Pack (implementation-ready)
A hardening pack that locks identifiers, schema/manifest requirements, scenario equivalence checks, and verification tests. It also locks:
(i) the optional qc_flags_reason_codes field behavior (absence never fails validation/run), (ii) equivalence between flags and reason codes when
the field exists, (iii) an operational definition for “flagged” (review vs non-blocking), and (iv) controls for reason-code explosion (hierarchy + cap, if enabled).
3) Stage-2 Formal Formula Pack (complete mathematical specification)
A full “formula extract” that formalizes the system into explicit mathematics: index sets, exposure identifiers, transformations, drift/near-zero semantics, effective NV definitions used by gates, evaluability/exclusion rules, tri-state run status logic, and selection logic (Tier-A/Tier-B/Repeat/Inconclusive/No-effect).
The latest patch (v10.0) preserved the existing structure while applying three non-blocking clarifications to remove residual ambiguity:
(1) Tier-A strength uses an “all days” rule (∀d) rather than a median gate,
(2) Tier-A is explicitly decrease-only (5HN reduction),
(3) CD8_guard is explicitly retained as a safety override even if partially redundant.
Version locks (IDs and freeze discipline)
- ARCH-ID: ARCH-SOMF-ST1-v12.0
- PACK-ID: PACK-SOMF-ST1-v8.0 (FINAL)
- UC-ID: UC-SOMF-HNSCC-ST1-v12
- SCEN-ID: SCEN-SOMF-ST1-v1.7
- VER-ID: VER-SOMF-ST1-v1.7
- SCHEMA-ID: SCHEMA-SOMF-ST1-v1.7
- MANIFEST-ID: MANIFEST-SOMF-ST1-v1.7
A “freeze point” is used to lock the decision system and prevent post-hoc changes to thresholds, gate definitions, and operational policies after data are observed.
Formal system specification (Stage-2) — included inside this case study
A) Notation and index sets
Indices:
r ∈ ℛ (run)
d ∈ 𝒟_r (bio replicate / day)
p ∈ 𝒫_{r,d} (plate_id)
c ∈ 𝒞 = {5HN, CD8}
t ∈ 𝒯 = {12, 24} (hours)
e ∈ ℰ (exposure_id)
k ∈ 𝒦_{r,d,p,c,e,t} (tech replicate / well)
Sham exposure is denoted by e = ∅.
Exposure identifier (locked):
e = (freq_hz, B_target, waveform, duty, distance_cm), ∅ denotes sham.
Primary frequency set at 24h (for primary-set QC rules):
ℱ_prim = {∅, 50, 100, 200, 300}
Primary set (locked): 𝒫SET = {(c, f, 24) : c ∈ 𝒞, f ∈ ℱ_prim}, |𝒫SET| = 10
B) Canonical transformations (MTT)
Raw measurement objects:
rawOD_{r,d,p,c,e,t,k} ∈ ℝ
blankOD_{r,d,p,c,t} ∈ ℝ
Blank subtraction (Corrected OD):
CorrectedOD_{r,d,p,c,e,t,k} = rawOD_{r,d,p,c,e,t,k} − blankOD_{r,d,p,c,t}
Validity mask and counts:
1^{valid}_{r,d,p,c,e,t,k} ∈ {0,1}
𝒦^{valid}_{r,d,p,c,e,t} = {k : 1^{valid}=1}
n^{valid}_{r,d,p,c,e,t} = |𝒦^{valid}_{r,d,p,c,e,t}|
n^{valid,bio}_{r,d,c,e,t} = Σ_{p∈𝒫_{r,d}} n^{valid}_{r,d,p,c,e,t} (split-safe pooling)
Plate mean (after blank subtraction), defined when nvalid>0:
meanOD_{r,d,p,c,e,t} =
(1 / n^{valid}_{r,d,p,c,e,t}) * Σ_{k∈𝒦^{valid}} CorrectedOD_{r,d,p,c,e,t,k}
Day-level (bio replicate) mean OD pooled across plates, defined when nvalid,bio>0:
meanOD^{bio}_{r,d,c,e,t} =
[ Σ_{p} Σ_{k∈𝒦^{valid}} CorrectedOD_{r,d,p,c,e,t,k} ] / [ Σ_{p} n^{valid}_{r,d,p,c,e,t} ]
Pooled-to-sham normalized viability (NVpooled) domain lock:
NV^{pooled}_{r,d,c,e,t} is defined iff
n^{valid,bio}_{r,d,c,e,t} > 0 AND n^{valid,bio}_{r,d,c,∅,t} > 0
Canonical pooled NV (when defined):
NV^{pooled}_{r,d,c,e,t} = meanOD^{bio}_{r,d,c,e,t} / meanOD^{bio}_{r,d,c,∅,t}
C) Plate drift & near-zero semantics (locked)
Drift threshold:
δ_drift = 0.15
drift_eps (OD units) is applied to denominators built from blank-subtracted plate-level sham means meanOD_{r,d,p,c,∅,t}.
Required plate pairs (where sham exists on both plates):
𝒬^{req}_{r,d,c,t} = {(p_i,p_j) : p_i < p_j, n^{valid}_{r,d,p_i,c,∅,t} > 0, n^{valid}_{r,d,p_j,c,∅,t} > 0}
Pairwise drift (when denom > εdrift):
denom(p_i,p_j) = 0.5 * (meanOD_{...,p_i,c,∅,t} + meanOD_{...,p_j,c,∅,t})
drift_percent(p_i,p_j) = |meanOD_{...,p_i,c,∅,t} − meanOD_{...,p_j,c,∅,t}| / denom(p_i,p_j)
Near-zero edge case (RULE-DRIFT-EDGE-01):
near_zero(r,d,c,t) ⇔ ∃(p_i,p_j)∈𝒬^{req} : denom(p_i,p_j) ≤ ε_drift
If |𝒬^{req}| = 0 ⇒ NOT near_zero(r,d,c,t)
If near_zero holds:
qc_flag SHAM_MEAN_NEAR_ZERO is set
drift_percent_day = null
drift_pair_day = null
and PLATE_DRIFT_SUSPECTED is NOT set for that day
Max drift per day (when computable and not near-zero):
drift_percent_day = max_{(p_i,p_j)∈𝒬^{req}} drift_percent(p_i,p_j)
drift_pair_day = argmax_{(p_i,p_j)∈𝒬^{req}} drift_percent(p_i,p_j)
If drift_percent_day > δ_drift ⇒ qc_flag PLATE_DRIFT_SUSPECTED
D) Effective NV used everywhere in gates (NV*)
Within-plate NV (per plate), defined when both exposure and sham exist on that plate:
NV^{within}_{r,d,p,c,e,t} = meanOD_{r,d,p,c,e,t} / meanOD_{r,d,p,c,∅,t}
Day-level within-plate aggregation (weighted by valid exposure wells):
NV^{bio,within}_{r,d,c,e,t} =
[ Σ_{p∈𝒫_{r,d}} n^{valid}_{r,d,p,c,e,t} * NV^{within}_{r,d,p,c,e,t} ] /
[ Σ_{p∈𝒫_{r,d}} n^{valid}_{r,d,p,c,e,t} ]
Effective NV (NV*) used for gate/selection (LOCK):
NV*_{r,d,c,e,t} =
NV^{bio,within}_{r,d,c,e,t} if DriftSuspected(r,d,c,t) = true
NV^{pooled}_{r,d,c,e,t} if DriftSuspected = false and NV^{pooled} is defined
undefined if DriftSuspected = false and NV^{pooled} is undefined
E) Evaluability and exclusion (LOCK)
Day evaluability sets for fixed (r,c,e,t):
𝒟^{eval}_{r,c,e,t} = { d ∈ 𝒟_r : NV*_{r,d,c,e,t} is defined }
24h evaluable days for each cell type and joint evaluability:
𝒟^{eval}_{r,e,5HN} = 𝒟^{eval}_{r,5HN,e,24}
𝒟^{eval}_{r,e,CD8} = 𝒟^{eval}_{r,CD8,e,24}
𝒟^{eval,both}_{r,e} = 𝒟^{eval}_{r,e,5HN} ∩ 𝒟^{eval}_{r,e,CD8}
Minimum evaluable-day threshold:
m_eval = 3
TierEvaluable_5HN(r,e) ⇔ |𝒟^{eval}_{r,e,5HN}| ≥ m_eval
TierEvaluable_CD8(r,e) ⇔ |𝒟^{eval}_{r,e,CD8}| ≥ m_eval
TierEvaluable(r,e) ⇔ TierEvaluable_5HN(r,e) AND TierEvaluable_CD8(r,e) AND |𝒟^{eval,both}_{r,e}| ≥ m_eval
Canonical placement of exclusion reason code (LOCK):
If NOT TierEvaluable(r,e), exposure e is excluded from gate/selection and the run manifest must include: OPS-NV-UNDEFINED-EXCLUDED-01
F) QC rules and tri-state run status (LOCK)
Severe exposure interruption:
exposure_interruption_severe(r) ⇔ (int_sec_r ≥ 300) OR (int_frac_r ≥ 0.02)
Condition-level insufficient tech (per day):
insufficient_tech(r,d,c,e,t) ⇔ n^{valid,bio}_{r,d,c,e,t} < 3
Run-level insufficient-tech count on the primary set (locked):
N_insuff(r) = #{ (c,f,24) ∈ 𝒫SET : ∃d ∈ 𝒟_r : n^{valid,bio}_{r,d,c,e(f),24} < 3 }
insufficient_tech_widespread(r) ⇔ [∃(c,f,24)∈𝒫SET : ∃d : n^{valid,bio} < 3] OR [N_insuff(r) ≥ 3]
Missing sham on plate (critical):
missing_sham_on_plate(r) ⇔ ∃(d,p,c,t) such that
(∃e≠∅ : n^{valid}_{r,d,p,c,e,t} > 0) AND (n^{valid}_{r,d,p,c,∅,t} = 0)
Critical QC flags (failed-triggers):
Q_crit = { missing_sham_on_plate, exposure_interruption_severe, insufficient_tech_widespread, artifact_24h_5HN }
Tri-state run status (LOCK):
run_status(r) = failed if ∃q∈Q_crit : q(r)=true flagged else if qc_flags(r) is non-empty passed else Additionally: SHAM_MEAN_NEAR_ZERO ∈ qc_flags(r) ⇒ run_status(r)=flagged
G) Selection logic (Tier-A / Tier-B / Repeat / Inconclusive / No-effect) — v10
Effect sizes at 24h (defined only on jointly evaluable days d ∈ 𝒟eval,bothr,e):
Δ^{5HN}_{r,d,e} = 1 − NV*_{r,d,5HN,e,24}
Γ^{CD8}_{r,d,e} = | NV*_{r,d,CD8,e,24} − 1 |
Direction counts (5HN at 24h):
N^-_{r,e} = #{ d ∈ 𝒟^{eval,both}_{r,e} : NV*_{r,d,5HN,e,24} < 1 }
N^+_{r,e} = #{ d ∈ 𝒟^{eval,both}_{r,e} : NV*_{r,d,5HN,e,24} > 1 }
Consistency definitions (restricted to jointly evaluable days):
consistencyA(r,e) ⇔ (N^-_{r,e}=3) OR (N^+_{r,e}=3)
consistencyB(r,e) ⇔ (N^-_{r,e}≥2) OR (N^+_{r,e}≥2)
sign_mixed(r,e) ⇔ (N^-_{r,e}≥1) AND (N^+_{r,e}≥1) (RULE-TIE-01)
CD8 guard (safety signal; restricted to jointly evaluable days):
CD8_guard(r,e) ⇔ #{ d ∈ 𝒟^{eval,both}_{r,e} : NV*_{r,d,CD8,e,24} ≤ 0.95 } ≥ 2
Interpretation lock: CD8_guard is a safety override that can block/flag selection even if other CD8 constraints are satisfied.
Median reduction (reporting only; not a Tier-A gate in v10):
MedΔ^{5HN}_{r,e} = median_{d∈𝒟^{eval,both}_{r,e}} Δ^{5HN}_{r,d,e}
Tier-B (unchanged):
TierB(r,e) ⇔
TierEvaluable(r,e)
AND (N^-_{r,e} ≥ 2)
AND consistencyB(r,e)
AND (MedΔ^{5HN}_{r,e} ∈ [0.15, 0.25))
AND (∀d∈𝒟^{eval,both}_{r,e} : Γ^{CD8}_{r,d,e} ≤ 0.15)
Tier-A (UPDATED in v10): ∀d strength + decrease-only + explicit safety override
LOCK: Tier-A is defined only for the decrease direction (5HN reduction), not for viability increases.
TierA(r,e) ⇔
TierEvaluable(r,e)
AND (N^-_{r,e} = 3) (3/3 decrease direction)
AND (∀d∈𝒟^{eval,both}_{r,e} : Δ^{5HN}_{r,d,e} ≥ 0.25) (NEW: all 3 days meet ≥25% reduction)
AND (∀d∈𝒟^{eval,both}_{r,e} : Γ^{CD8}_{r,d,e} ≤ 0.10) (CD8 constraint for Tier-A)
AND NOT CD8_guard(r,e) (safety override blocks Tier-A)
Confirmatory repeat and tie-break (LOCK):
Tier-B exposures must be repeated under the same exposure specification (same exposure_id, same cell types/timepoints,
sham per plate, new day, and new randomization). After repeat, if post-repeat consistency is <2/3 or sign_mixed holds,
the outcome is deterministically Inconclusive (after repeat), and mechanistic assays are not executed for that exposure.
No-effect semantics (LOCK):
ℰ^{eval}_r = { e ∈ ℰ : TierEvaluable(r,e) }
NoEffect(r) ⇔ (|ℰ^{eval}_r| ≥ 1) AND [∀e∈ℰ^{eval}_r : NOT TierB(r,e) AND NOT TierA(r,e)]
If |ℰ^{eval}_r| = 0:
Required report: "No evaluable exposures; selection not performed. See manifest reason codes."
Data contract and audit artifacts
The run manifest is designed to make the system audit-proof: it records run identity, freeze point, repeat lineage, exposure parameters, drift thresholds, interruption metrics, hashed files (sha256), QC flags, run status, and a decision basis with reason codes for both run status and selection. Optional operational control fields exist (e.g., flagged action policy), but their absence never fails validation/run.
- Required (examples): run_id, date, operator_id, freeze_point_id, repeat_group_id, exposure_id (+ params), drift_threshold_percent, drift_eps, interruption_seconds, hashed_files, qc_flags, run_status, run_status_reason_codes, selection_reason_codes
- Optional operational controls: flagged_action_policy, max_active_reason_codes_per_run, reason_code_hierarchy_version
What makes this system defensible (not just “well documented”)
- Determinism: run status and selection outcomes are functions of locked rules; interpretive drift is structurally prevented.
- Auditability: manifest + hashes + reason codes create an explainable decision trail for every run and every exposure.
- Split-safe pooling: pooled valid well counts and within-plate NV preserve correctness under plate splits.
- Drift governance: drift and near-zero are separated with explicit semantics; near-zero flags do not become false drift claims.
- Safety preservation: CD8_guard is explicitly retained as a safety override for rare but unacceptable consistent toxicity signatures.
Current “TBD” items (explicitly tracked, not hidden)
Certain physical/specification parameters remain intentionally marked as TBD until the device/bench constraints are finalized,
without changing the logical architecture: B_target and tolerance, waveform/duty, distance, final tech replicate counts,
seeding density/confluency windows, the exact t=0 offset post-seeding, final plate drift threshold refinements (if any), ΔT threshold,
and TEM template version. These do not alter the stage-locked decision logic.
Outcome
The result is a complete, stage-locked screening system that can be implemented as a reviewable core engine: the architecture specifies how the experiment is executed and logged; the delivery pack locks IDs, scenarios, and verification tests; and the Stage-2 formalization turns every decision into explicit mathematics. This enables reproducible screening outcomes, audit-grade reporting, and clean handoff to implementation without ambiguity.
