Short-read DNA sequencing cuts genomes into fragments of a few hundred letters. To reconstruct a haplotype, meaning the exact sequence of each separate chromosome copy or each viral strain in a mixed infection, those fragments have to be stitched back together. When two variable sites lie farther apart than any single read, the reads carry no direct evidence about which allele at the first site travels with which allele at the second. Today's tools respond in one of two ways. They stop and emit disconnected "blocks", or they join across the gap anyway and sometimes splice two strains into a chimera that does not exist in nature. In a viral mixture, however, each strain has a characteristic abundance, and that abundance is the same on both sides of a gap. Abundance is a weak, noisy linking signal. Whether to use it should be decided the way an operator decides whether to switch on a generator with uncertain demand ahead: weigh the expected gain of joining against the expected cost of being wrong, look a few steps ahead before committing, and abstain when the evidence is too thin.
We propose a gap-linking layer that sits on top of any within-block phaser. Along the genome, it treats the choice of which local haplotype on the left of a gap continues as which local haplotype on the right as a two-stage stochastic integer program. A stochastic integer program is an optimization with yes/no decisions whose costs depend on random scenarios. Here the scenarios are resamplings of the reads, which perturb both the abundance estimates and the within-block haplotypes. The layer solves this program over a sliding window of several upcoming gaps, commits only the nearest join, and leaves a pair unlinked when no join beats a fragmentation penalty. The claim is narrow and testable. It does not say optimization can create linkage where there is no information, because Read length versus Depth of Coverage for Viral Quasispecies Reconstruction shows depth cannot substitute for read length. It says that the weak information that does exist can be used with a controlled chimera rate, and that the benefit should concentrate exactly where strains have similar abundances.
Core Claim
Gap-crossing in multi-strain phasing is a sequential decision problem with three features that the operations-research literature handles and genomics tools currently do not. First, evidence accumulates downstream. A strain's abundance shows up again in every later block, so seeing $w$ gaps ahead sharpens the decision at the current gap. This is the same "small lookahead buys most of the offline optimum" effect reported for battery control in Learning policies for battery usage optimization in electric vehicles and for data centers in Dynamic Provisioning in Next-Generation Data Centers with On-site Power Production. Second, joins are hard to undo. A wrong join propagates a chimera through every downstream block, which plays the role of a switching cost. Third, the number of strains is unknown. Opening a new strain path is a discrete decision with a cost, much like starting a generator.
For gap $g$, let $y_{ij}\in\{0,1\}$ indicate that local haplotype $i$ left of the gap is joined to local haplotype $j$ on its right, with $y$ constrained to be a partial matching $\mathcal{M}_g$. Let $s$ index read-resampling scenarios. The decision at gap $g$ is
$$\min_{y\in\mathcal{M}_g}\; \sum_{i,j} y_{ij}\,\mathbb{E}_s[c_{ij}(s)] \;+\; \mu\Big(k_g-\sum_{i,j}y_{ij}\Big) \;+\; \mathbb{E}_s\big[Q_{g+1:g+w}(y,s)\big].$$
Here $c_{ij}(s)$ is the abundance mismatch between the two local haplotypes in scenario $s$, plus any bridging-read inconsistency. $\mu$ is the price of leaving a local haplotype unlinked. $k_g$ is the number of local haplotypes at the gap. $Q_{g+1:g+w}$ is the best achievable downstream joining cost over the next $w$ gaps given this decision. Only $y$ at gap $g$ is executed before the window slides forward.
Research Program
The structural observation that makes this tractable comes from Online Vehicle Routing: The Edge of Optimization in Large-Scale Applications. That paper re-optimizes taxi dispatch every 30 seconds and proves that once pickup times are fixed, the routing problem becomes a network flow on a directed acyclic graph, so its linear relaxation returns integer solutions. Our problem has the same structure. Blocks are ordered along the genome, and local haplotypes are nodes in consecutive layers. For a fixed scenario with pairwise arc costs, linking strains across $w$ gaps is a minimum-cost flow on a layered acyclic graph. Each unit of flow from source to sink is one strain, and a per-path opening cost lets the number of strains be chosen rather than supplied. That last property addresses the requirement in Graph Coloring via Neural Networks for Haplotype Assembly and Viral Quasispecies Reconstruction that the user supply $k$ in advance.
Integrality can break once arcs are shared across scenarios. For that case we reuse scenario decomposition from A study of progressive hedging for stochastic integer programming, which solves each scenario as an integral flow and penalizes disagreement between scenarios. Between window positions we warm-start from the previous window, as Bertsimas et al. do with their local backbone method.
The pairwise-arc approximation is a deliberate simplification. True abundance consistency is a property of a whole path, not of individual links. We will measure how much is lost by comparing it against exact path enumeration on small instances.
Three components will be built. The first is a scenario generator that resamples reads, reruns the within-block phaser, and estimates local abundances. The within-block phaser is an existing tool: CAECseq from A Convolutional Auto-Encoder for Haplotype Assembly and Viral Quasispecies Reconstruction, or NeurHap. Our contribution is the layer that links blocks, not a new solver for the within-block error-minimization problem. The second component is the windowed stochastic flow solver. The third is a calibration procedure for $\mu$, which sets the operating point between fragmentation and chimeras.
On the analysis side, we will derive the join/abstain rule for two strains with Gaussian abundance noise. We expect the error of a join to fall roughly like $\exp(-w\,\Delta^2/2\sigma^2)$. Here $\Delta$ is the true abundance gap between strains and $\sigma$ the per-block estimation noise, and the form follows because $w$ independent downstream blocks average the noise. The prediction is that lookahead matters when $\Delta/\sigma$ is near one and is irrelevant when strains are well separated.
The role of each literature thread is distinct. Viral Population Estimation Using Pyrosequencing and Challenges and opportunities in estimating viral genetic diversity from next-generation sequencing data motivate the problem: linkage decays and blocks fragment, especially at low diversity. Zagordi et al. constrain it: no method should claim to beat physical linkage limits. Improved haplotype inference by exploiting long-range linking and allelic imbalance in RNA-seq datasets is the closest precedent. HapTree-X links distant diploid variants through expression imbalance using a hidden Markov model and does not make explicit abstention decisions. We generalize the signal to many strains of unknown number and make the join an explicit, priced decision. The Blind Men and the Elephant: Integrated Offline/Online Optimization Under Uncertainty argues that recourse must be modeled as it will actually be executed. That supports our design choice of committing only the nearest join. Finally, Competitive prediction-aware online algorithms for energy generation scheduling in microgrids shows that accumulating evidence before a threshold-triggered switch beats plain receding-horizon control under noisy forecasts. This motivates a variant of our layer that commits a join only when cumulative evidence over the window crosses a threshold.
Baselines
The naive reference is the "never join" policy that standard block-based phasers produce. It has a chimera rate of zero and the shortest blocks, and it shows how much genome is stranded by gaps.
The strongest published full-pipeline competitors are CAECseq and GAEseq (A Graph Auto-Encoder for Haplotype Assembly and Viral Quasispecies Reconstruction), together with NeurHap. These are the current best reported tools on the shared viral and polyploid benchmarks. On the HIV-1 5-virus mix, CAECseq reports all five strains perfectly reconstructed in 9 of 13 genes. GAEseq reports 8 of 13, and PredictHaplo and TenSQR reach 5 or 6. NeurHap reports an error-correction score (MEC) of 29.9 versus 96.2 for the next method on 5× simulated potato. It also reports an MEC about 160 points below its closest competitor on HIV, but the file gives no gene count for NeurHap. We will run these tools with their published settings on identical read sets. Our layer will use the same tool internally as its within-block phaser, so any difference comes from gap handling. All methods get the same CPU budget and the same tuning budget, measured as the number of hyperparameter evaluations on a held-out simulated split.
The baseline most likely to threaten us is greedy deterministic frequency matching. It runs the same within-block phaser, estimates abundances once, and joins blocks by nearest abundance. We tune its join tolerance to match our block length, so the two methods are compared at an equal fragmentation level.
A second strong baseline is a global deterministic integer program. It optimizes all joins at once with point abundance estimates, with no scenarios and no window. It isolates whether the stochastic and receding-horizon parts matter beyond simply using abundance.
Ablations remove one ingredient at a time. They compare lookahead $w=1$ against larger $w$, scenario expectations against point estimates, and the cumulative-threshold commit rule against always committing the solver's choice.
"Beating" a baseline means fewer cross-gap switch errors at matched block length, or longer correct blocks at a matched chimera rate. For diploid human DNA, beating the baseline means correctly abstaining.
Why not just…?
Why not just sequence deeper? Zagordi et al. show that depth sharpens local variant calls but adds no physical connectivity across gaps longer than a read. Depth does reduce the abundance noise $\sigma$, so it helps our layer specifically. We will include a depth sweep to show that deeper sequencing shifts our operating curve but leaves never-join block lengths unchanged.
Why not just use greedy frequency matching after an existing phaser? This is the real threat, and we treat it as such. When strain abundances are well separated, greedy matching should be as good as our method, and our own analysis predicts so. The experiments are designed to settle this. We stratify every result by the minimum abundance ratio between strains. If greedy matching equals the stochastic layer even in the close-abundance strata, we will report that the extra machinery is unnecessary and keep only the calibrated abstention rule.
Why not just run a global integer program over the whole genome? HIV genomes are about 9 kb, so a global solve is computationally feasible there, and windowing is not needed for speed on viruses. The reason to prefer the windowed, scenario-based version is statistical, not computational. The global deterministic program trusts point abundance estimates. The global-ILP baseline tests this directly. For long human regions, windowing additionally bounds runtime, as in Bertsimas et al.
Why not just use linked or long reads? Co-barcoding such as stLFR in Efficient and unique cobarcoding of second-generation sequencing reads from long DNA molecules enabling cost-effective and accurate sequencing, haplotyping, and de novo assembly removes many gaps when it is available. Our target is the large body of existing and clinical short-read viral data where it is not. We make no claim to compete with physical linkage.
Proposed Experiments
The decisive experiment uses the real HIV-1 5-virus mix with reads computationally truncated to 75, 100, and 150 bases. Truncation creates controlled unbridged gaps while the ground-truth strains remain known. Metrics are the cross-gap switch error rate, the chimera rate (the fraction of output haplotypes that join segments from different true strains), the fraction of each genome covered by correct blocks, MEC, and the count of genes in which all five strains are fully reconstructed. No reported result was found on Lacuna for any method on truncated-read versions of this benchmark, so all such numbers will be produced here, under identical conditions. On the untruncated data, the target is to at least match CAECseq's 9 of 13 genes.
Simulated mixtures provide a dose-response test. We will vary the abundance gap $\Delta$, the depth, and the gap spacing, and check whether the error of a join decays with lookahead $w$ at the predicted rate. A mismatch with the predicted rate would falsify the analysis even if accuracy improves.
The 10-strain hepatitis C and 15-strain Zika benchmarks from NeurHap test strain-count recovery: we report the absolute error in estimated $k$ against NeurHap given the true $k$. The file contains no numbers for these benchmarks.
Simulated potato at 5× through 35× checks that the layer does not damage within-block MEC relative to NeurHap's reported 29.9.
As a negative control, we use GM12878 whole-genome DNA. Its two haplotypes are present at equal abundance, so the correct behavior is near-total abstention with no rise in switch error. On the matched RNA-seq, allelic imbalance does carry signal. There we compare block length and switch error against HapTree-X, which reports up to 25% longer blocks than HapCUT2 and phASER at similar or lower switch error.
The project succeeds if, in the close-abundance strata, the stochastic windowed layer reduces cross-gap switch errors relative to tuned greedy matching at equal block length, and abstains on the diploid DNA control. It fails informatively if greedy matching ties it everywhere.
References
- Read length versus Depth of Coverage for Viral Quasispecies Reconstruction
- Learning policies for battery usage optimization in electric vehicles
- Dynamic provisioning in next-generation data centers with on-site power production
- Online Vehicle Routing: The Edge of Optimization in Large-Scale Applications
- Graph Coloring via Neural Networks for Haplotype Assembly and Viral Quasispecies Reconstruction
- A study of progressive hedging for stochastic integer programming
- A Convolutional Auto-Encoder for Haplotype Assembly and Viral Quasispecies Reconstruction
- Viral Population Estimation Using Pyrosequencing
- Challenges and opportunities in estimating viral genetic diversity from next-generation sequencing data
- Improved haplotype inference by exploiting long-range linking and allelic imbalance in RNA-seq datasets
- The Blind Men and the Elephant: Integrated Offline/Online Optimization Under Uncertainty
- Competitive prediction-aware online algorithms for energy generation scheduling in microgrids
- A Graph Auto-Encoder for Haplotype Assembly and Viral Quasispecies Reconstruction
- Efficient and unique cobarcoding of second-generation sequencing reads from long DNA molecules enabling cost-effective and accurate sequencing, haplotyping, and de novo assembly