Module 11: Multiplex Compatibility Screening
The Multiplex Compatibility Screening module evaluates the thermodynamic, kinetic, and spectral compatibility of candidate primers and probes designed for different pathogens or segments, allowing them to be combined into a single reaction tube (Multiplex Assay). This module supports Pairwise (dual-target), Triplex (three-way), and generic N-Plex assay compatibility checks across arbitrary combinations of viral targets.All thresholds, weights and the score formula live in one place —
scripts/tools/iupac_utils.py — and are imported by the multiplex screening engine.
Overview of Screening Criteria
To ensure optimal performance and prevent mutual interference of oligos in a multiplex reaction, the screening engine evaluates four criteria:1. Cross-Dimerization Thermodynamics ()
When multiple primers and probes are mixed together, they can bind to one another instead of the target template, forming primer-dimers.- Calculation: The engine expands all degenerate sequences into their canonical variants (up to 16 variants per oligo) and computes the minimum free energy ( in kcal/mol) for every pairwise combination using Primer3’s heterodimerization algorithm.
- Thresholds (evaluated at the 39°C RAA reaction temperature):
- kcal/mol: PASS
- kcal/mol: WARNING (Moderate risk, marginal compatibility).
- kcal/mol: VETO (High risk of stable dimer formation; candidate combination is discarded).
A “−3 kcal/mol” cutoff carried over from 60°C practice would reject 88% of entirely clean pairs. Conversely −9 at 39°C corresponds to roughly −4.7 at 60°C — already stricter than the guidance it came from.
2. 3’-End Anchoring
Only a 3’ terminus that anneals can be extended by the polymerase, and those extension products are what amplify as primer noise — which the TwistAmp manual §2.6 identifies as the factor limiting a primer pair’s sensitivity. A global can look acceptable while it is the 3’ ends that are interacting, so this is screened separately.- Criterion: the length of the longest perfectly complementary run anchored at either oligo’s 3’ terminus. Degenerate oligos are expanded and the worst variant decides — a synthesised pool contains all of them.
- Threshold: more than 5 bp → WARNING.
Deliberate 5, 6 and 8 bp anchors are detected in 100% of cases. Because a multiplex evaluates many oligo pairs at once (9 pairwise, 27 triplex), a per-pair false-positive rate compounds; tolerating up to 5 bp keeps the whole-combination false-warning rate near 4% pairwise / 13% triplex. The figure is still reported as context for a reader comparing two flagged pairs, but nothing is gated on it.
3. Kinetic Temperature Alignment ()
- Calculation: The engine calculates the average across all degenerate variants for each primer. It then computes the maximum difference () between any two primers.
- Thresholds:
- : PASS
- : WARNING (Amplification rates might be unbalanced).
4. Spectral Separation (Dye Assignment)
Probes for different targets must be labeled with fluorophores that have non-overlapping emission spectra to prevent crosstalk. Default channel assignments across targets use a multi-channel palette:- Target 1 (e.g. Influenza A): FAM (green channel, emission ~520 nm).
- Target 2 (e.g. Influenza B): HEX (yellow channel, emission ~556 nm).
- Target 3 (e.g. Measles): Cy5 (far-red channel, emission ~670 nm).
- Target 4+: Cy3 / ROX / Texas Red / Atto 647N (dynamic channel palette extension).
UNKNOWN and does not pass.
Compatibility Score
A heuristic ranking aid on a 0–100 scale — not a percentage and not a probability. It has no experimental calibration; its job is to decide which combinations are worth synthesising, not to predict assay performance. Reports render it as a bare number for that reason. is weighted above because that is where the reaction chemistry points: at 39°C strand invasion is enzyme-driven, so matching matters relatively little, while primer-dimer artefacts compete directly for enzyme, primer and energy. The pairwise checker previously used the opposite weighting (, ); both now share one implementation, so pairwise and triplex scores are directly comparable. !!! tip “Before ordering oligos” Treat the ranking as a shortlist, not a verdict. Following the vendor’s own protocol, order several of the top-ranked combinations rather than rank 1 alone — no in-silico calculation predicts primer noise reliably, and the decisive comparison is sensitivity on the bench.Candidate Selection: Gates First, Then Ranking
The compatibility score decides how well two assays coexist. It does not decide which oligos to order. That decision now runs throughscripts/tools/candidate_selection.py, shared by the pairwise checker, the triplex checker and the supplementary export.
!!! warning “Corrected: the recommendation ignored specificity and coverage entirely”
The first production run recommended FluA_Rank9 × FluB_Rank7 — a pair whose both members were human-specificity grade C, carrying 18 and 11 extensible human off-targets, while grade A candidates with equal coverage went unused. Two causes:
- M11 ranked on multiplex thermodynamics alone.
human_gradewas present in thefinal_candidates.jsonit reads and was never consulted. - Nothing in the pipeline read M10’s coverage output. The number that decides whether an assay detects circulating strains never reached the step that picks what to order. Across the FluA candidates coverage ranged 85.3%–98.1%.
The decision rule
For every criterion, ask whether violating it makes the assay wrong or merely worse. Wrong belongs in a gate; worse belongs in the ranking. A criterion that is already gated must not also appear in the ranking — that invents a trade-off which should not exist. Class 1 gates — never relaxed. An off-target amplicon possible on human DNA, an off-target against another virus, a human binding site with the 3’ end fully anchored, a dye-channel collision, a cross-dimer past the veto limit, or M09 statusFAIL.
These test the mechanism, not a score, and that distinction matters. PrimerLab’s specificity score is an accumulating penalty: one perfectly 3’-anchored off-target costs 20 points and twenty trivial ones also cost 20, so an identical grade can mean either. No grade threshold can rule out a single catastrophic binding site. human_products — off-target amplicons the primer pair could actually produce — can not be masked by aggregation, because a lone primer binding somewhere produces nothing; a false positive needs two primers facing each other within amplicon distance.
Class 2 gates — relaxed stepwise. Specificity grade floor, coverage floor, multiplex status.
The relaxation ladder
Selection tries the strictest profile and walks down only as far as needed, reporting which level was used:
L5 exists so an empty result is impossible unless every candidate violates a Class 1 gate — and that outcome is a finding worth surfacing, not a failure to paper over. An operator facing a difficult target needs the least-bad option, loudly labelled, not silence.
The relative-coverage criterion at L1 matters for intrinsically hard targets: a fixed floor can eliminate every candidate, so a combination also passes when it sits within a few points of the best coverage achievable for that target.
Ranking among survivors
Lexicographic, not a weighted sum — the same reasoning as the M07 core score. Multiplex status (PASS before WARNING), then coverage bucketed to 0.5 pp, then the weakest member’s specificity score, then the compatibility score, then the Primer3 penalty as a deterministic tiebreak. Coverage leads not because it outranks specificity, but because specificity is already guaranteed at the gate. The bucketing is deliberate: unbucketed, a 91.17% vs 91.16% difference — pure noise — would outrank a real difference in specificity further down the key.Effect on the first production run
4.6 points of an uncalibrated heuristic traded for both members moving C→A and the status moving WARNING→PASS.
Auditability
Every report states the level used, whether floors were relaxed, and a table of how many combinations were dropped for each reason. When M10 coverage is missing the gate reports “no data” and rejects rather than silently passing candidates whose sensitivity is unknown. Thresholds live inmultiplex.selection.levels in each config; a malformed block falls back to the built-in ladder rather than running with no floors at all.
Orchestrating a Multiplex Run
The screening is managed by the master batch orchestrator:1. Pairwise Screening (2 Targets)
scripts/m11_multiplex_checker.py to evaluate the top combinations.
2. Triplex Screening (3 Targets)
scripts/m11_triplex_checker.py across all combinations.
Key Outputs
Results are written to target-specific directories:- Pairwise:
results/multiplex-<targetA>_x_<targetB>/multiplex_report.md: Markdown summary report.multiplex_candidates.json: Raw thermodynamic details.
- Triplex:
results/multiplex-triplex-all-3/triplex_report.md: Markdown summary report with synthesis specifications.triplex_candidates.json: Sorted list of triplex candidates.
