Module M07: Diagnostic Bridge Builder & SNP Finder
M07 is the central integration checkpoint of the pipeline. It merges the physical conservation data (Track A) and evolutionary selection pressure scores (Track B) to identify, grade, and export candidate genomic regions suitable for primer and probe design.The Integration Scoring Algorithm
The core score is conservation alone. It is the only quantity that determines whether a primer matches the strains circulating right now: Everything else — evolutionary and biomechanical — modulates it multiplicatively: !!! warning “Changed: purifying selection was an additive term and is now a multiplier” Earlier revisions used with , , where was the FUBAR posterior . Three problems, all measured: 1. Conservation became substitutable. An additive form lets evolutionary evidence compensate for mismatches. Over the full range of the term it could overturn a 25.8 percentage-point gap in conservation — ranking a site at ~14.5% minor-allele frequency above a perfectly conserved one. A primer cannot trade a mismatch today for evidence of constraint tomorrow; it either hybridises or it does not.
2. Having HyPhy data could hurt you. The non-coding branch was
core = C × 0.95 while the coding branch carried the additive term, putting the two on incomparable scales. A perfectly conserved coding region with an unmeasured selection signal scored 0.83 against a non-coding region’s 0.95.
3. The weights had no source. No published scheme combines Shannon entropy with dN/dS posteriors in a weighted sum, so 0.66 / 0.34 could not be justified by citation — the quantity does not exist in the literature. The fix was not to find a citation but to restructure so no arbitrary trade-off needs one. The model now has a single free parameter, and it has a direct reading (see ).
The tier system is unchanged and still uses as an independent gate — the conventional FUBAR criterion, and the classification to cite.
Multipliers
Why uses substitution rate, not dN/dS
The purpose of bringing selection analysis into primer design is to avoid targets that look conserved today but drift away tomorrow. Conservation alone cannot distinguish two situations that are identical in an alignment:- conserved by functional constraint — the site cannot change without breaking the protein;
- conserved by chance — it has not changed yet, but nothing prevents it.
Y turns over 32× faster than X. It is exactly the case the evolutionary analysis was added to catch, and the old metric ranked it as favourably as X.
FUBAR reports and per codon in the same JSON; they were parsed away. The module now computes an expected nucleotide substitution rate,
weighting each channel by roughly how many of a codon’s three nucleotide sites belong to it, and compares a region’s mean against its own gene’s median. FUBAR rates are relative to each alignment’s scaling, so a self-calibrating ratio is the only figure that transfers between genes and builds.
Choosing the floor
floor is the model’s only free parameter, and it is chosen by stating the trade-off it permits rather than by assertion. With floor , the multiplier’s full range can overturn a conservation gap of at most :
Setting
floor: 1.0 disables the durability term entirely, reducing the model to conservation-only — useful as a baseline for comparison.
The default 0.95 states: lack of evidence for nucleotide stability costs at most 5%, which can overturn a conservation gap of about 1.6% MAF. That is a defensible trade — a site at 1.5% MAF under low substitution pressure may well outlast one at 0% that is conserved only by chance in a small sample.
!!! note “Not yet empirically validated”
This is a mechanistically motivated model, not a proven one. Nobody has demonstrated that rate-informed target selection actually extends assay lifetime. The pipeline already has what is needed to test it: M10 computes coverage per year, so a target designed only on data up to year can be scored against sequences from onwards. The hypothesis — regions with low retain coverage better than equally conserved regions with high — is directly testable, and a negative result would be just as informative.
Reported fields
avg_subst_rate, rel_subst_rate and durability_multiplier are written to the region report and CSV so the discount applied to any candidate can be traced.
Grading Tiers
Candidate regions are classified into four tiers based on their average conservation and purifying selection metrics: Two different classifications are emitted, and they must not be confused:tier_grade — the A/B/C/D scheme (read this one)
Keyed on the raw conservation () and purifying selection () metrics, and
reported alongside the numeric tier (1/2/3).
When “Grade A or B are the primary targets for PrimerLab”, this is the field meant.
grade — fine-grained ranking on the composite score
A separate S / A+ / A / A− / B+ / B / C / D ladder keyed on the multiplied
final_score (after MEME, recombination, GC, block and homopolymer multipliers).
It is a ranking aid only. Its letters do not correspond to the table above —
grade: "A" merely means final_score >= 0.85, which says nothing about or
individually.
How to Read the Output Files
Module M07 generates three primary outputs inresults/{BUILD}/m07/:
1. bridge_report.json
This is the master summary of all candidate regions. It is parsed by downstream design scripts and human researchers.
grade: Target regions with GradeAorBare the primary targets for PrimerLab.coding: Indicates if the region lies within a protein-coding sequence (CDS). Non-coding regions (like UTRs) will havecoding: falseand will not have purifying selection () scores.
2. primer_targets_manifest.yaml
This file is the direct input for Module M08 (PrimerLab). It defines the exact coordinates, IUPAC consensus sequences, and exclusion coordinates (variable sites to be avoided by Primer3).
3. conserved_regions.bed
A standard BED format file containing the coordinates of all Grade A, B, and C regions. This file can be loaded directly into genome browsers (like IGV or UCSC) for visual verification.
Visualizing Output in IGV
To verify the candidates visually:- Open the Integrative Genomics Viewer (IGV).
- Load the reference genome:
config/references/flu_a_mp_reference.fasta. - Load the candidate BED file:
results/{BUILD}/m07/conserved_regions.bed. - Load the GFF3 annotation:
config/references/flu_a_mp_annotation.gff.
M1) and avoid regions that sit near splicing boundaries unless targeting spliced transcripts specifically.