When a microbiologist sequences a single stool, soil, or marine sample, the readout is a mixture: several strains of the same bacterial species typically coexist, and those strains — nearly identical in their marker genes — can carry completely different metabolic machinery. This matters clinically: within one genus, some strains promote peptic ulcer disease while others protect against it, so summing abundances at the genus level cancels the causal signal outright (Yu et al.), and the same aggregation produces biomarkers that fail to replicate across cohorts (Jiang et al.). The best existing tool for separating strains, StrainPGC, does so only statistically: it scans hundreds of samples for the rare ones where a single strain makes up at least 95% of a species' abundance, then uses cross-sample correlations to assign genes to lineages (MIDAS v3 and StrainPGC). Hand it one sample and it returns nothing. We propose a generative model that reads one sample's gene-depth profile and, in a single network evaluation, outputs a full posterior distribution over strain-resolved gene content — and therefore over each strain's metabolic pathway capacity.
The design imports three ideas from geometry-informed acoustic modeling, where researchers face a structurally identical problem: recovering fine scene structure from a signal that cannot physically carry it. Audible sound has long wavelengths relative to light, so echoes cannot resolve chair legs — they get smoothed into the background wall (Evaluating Visual-to-Echo Distillation) — exactly as short marker-gene reads cannot resolve strains whose 16S regions are near-identical (Teh et al.; Verbanic et al.). Acoustic models cope by splitting the problem across scales — depth and room volume govern the coarse reverberation envelope, while surface texture governs fine material absorption (Image2Reverb; Visual Acoustic Matching) — and by distilling a strong teacher modality (vision) into a weak single-modality student (echo-only echolocation) (V2E-CCL). We transfer all three moves: a two-scale factorization of the pangenome into a conserved core (well resolved by species-level signal) and an accessory layer (the fine structure below marker-gene bandwidth); a distillation pipeline in which the cohort-scale StrainPGC plays teacher to a single-sample student; and, most importantly, an explicit resolution-limit treatment — the model is built to report, through posterior uncertainty, where the data cannot tell strains apart, rather than pretending to resolve them.
Core Claim
A conditional generative flow with straightened trajectories — trained on ground-truth isolate mixtures and on StrainPGC's cohort-scale calls as pseudo-labels — can recover strain-resolved metabolic gene content from a single shotgun metagenome, matching the accuracy of cohort-based deconvolution on samples where no cohort exists, while producing calibrated uncertainty that correctly widens at the identifiability boundary where two strains are present at equal frequency.
The inference problem is a linear mixing inversion. Let $d_g$ be the observed read depth at gene cluster $g$ of a species' pangenome, $f_i$ the frequency of strain $i$, and $g_{ig} \in \{0,1\}$ whether strain $i$ carries gene $g$:
$$d_g = \sum_{i=1}^{S} f_i \, g_{ig}, \qquad f \in \Delta^{S-1} = \{ f : f_i \ge 0,\ \textstyle\sum_i f_i = 1 \}.$$
When strain frequencies are very unequal the inversion is nearly determined; when they are equal, many $(f, g)$ combinations explain the same $d$, which is precisely the "strain mixing" problem that current tools leave open (MIDAS v3 and StrainPGC). A point predictor must guess in that regime; a generative model can represent the whole posterior. We use average-velocity transport, the one-step formulation of flow matching in which a network regresses the interval-averaged velocity of a straight path. Working in centered log-ratio coordinates $y = \mathrm{clr}(f)$ (so the abundance simplex becomes a vector space where straightness is well defined), the model learns
$$u_\theta(y_t, t, c) \approx y_1 - y_0, \qquad y_t = (1-t)\,y_0 + t\,y_1,$$
where $y_0$ is a simplex-valued base sample, $y_1$ the target strain decomposition, and $c$ a conditioning embedding of the observed depth profile and pangenome. Because the velocity is constant along straight paths, a single Euler step generates a complete posterior sample (3D MeanFlow; Nakkiran et al.) — the same property that lets 3D MeanFlow complete point clouds in about 5 ms, more than 8× faster than prior one-step baselines.
Research Program
Three components get built. First, the architecture: a permutation-equivariant set encoder over gene clusters and strains, since gene-cluster dictionaries and strain orderings are arbitrary labels — the same design lesson demonstrated in community modeling, where ordinary multilayer perceptrons collapse below $R^2 = 0$ under input reordering while equivariant graph networks stay invariant (Modelling Microbial Communities with GNNs). The encoder carries the two-scale split: a core-genome branch that fixes species identity from well-resolved signal, and an accessory branch that proposes strain-specific gene sets. Second, the coupling. Mini-batch optimal transport pairing prevents training trajectories from crossing (Kollovieh et al.; Song et al.), but we deliberately avoid AlignFlow's semi-discrete Laguerre-cell partitioning, which its authors state cannot handle continuous high-dimensional conditioning variables without ad-hoc clustering into discrete pseudo-classes (AlignFlow) — and pangenome embeddings are exactly such a conditioning. We use mini-batch transport plus at most one round of reflow (Guo et al.), capped because iterative self-training on model-generated endpoints causes cumulative drift and support contraction (Analyzing and Mitigating Model Collapse in Reflow Methods); we monitor low-density gene-cluster coverage as a collapse alarm. Third, the supervision, in two stages: ground truth from hCom2 — 117 gut isolates with finished genomes mixed into 276 synthetic metagenomes, with augmentations that sweep strain-frequency ratios so the model can learn calibration as a function of mixing entropy — and then pseudo-labels from StrainPGC's cohort-scale calls on the 1,338 HMP2 metagenomes, where it cataloged 3,511 novel strains across 443 species. This second stage is the direct analogue of V2E-CCL distilling frozen visual teachers into an audio-only student (Evaluating Visual-to-Echo Distillation) — here, a multi-sample teacher into a single-sample student. Precedent for straightened flows on structured non-Euclidean objects exists in rigid-molecule SE(3) generation (3D Molecule Generation from Rigid Motifs); our contribution is the simplex-and-binary-set target space and the continuous pangenome conditioning, neither of which appears there.
Proposed Experiments
The primary benchmark is hCom2, where every mixture has full ground truth. We report strain-level gene-content F1 and false-negative rate, stratified by strain-frequency ratio, against the cohort-based state of the art. The calibration check is central to the claim: empirical coverage of posterior credible sets should track the reported confidence level, and posterior entropy should rise as frequencies approach equality — the information-theoretic analogue of the acoustic over-smoothing regime. Second, on HMP2 we run a leave-one-sample-out protocol: the model must reproduce, for each held-out sample, the strain calls StrainPGC made using the whole cohort — testing whether single-sample inference recovers what currently requires 106 subjects. Third, the UCFMT ulcerative-colitis trial (231 longitudinal samples) offers a known answer key: two donor E. coli strains that both engraft frequently but differ in functional potential (MIDAS v3 and StrainPGC); the model should separate them from individual time-point samples and reproduce their pathway differences. Fourth, the metabolic payoff: predicted strain-resolved pathway (KO) profiles per sample, scored against isolate ground truth on hCom2, replacing the linear taxa-times-reference-matrix multiplication that standard profiling uses (Metformin Alters Gut Microbiota; Gut Microbial Dysbiosis in Chronic Hepatitis B). As a downstream consumer, we feed strain-resolved profiles into the graph-network community model (Modelling Microbial Communities with GNNs) on FRIEDMAN2017 and BARANWALCLARK2022 consortia augmented with synthetic within-species strain mixtures built from hCom2 isolate genomes, testing whether strain resolution improves steady-state abundance prediction over species-level binary inputs. Finally, a cross-domain stress test on BatVision (52,000+ real binaural echo and depth pairs): the same one-step flow machinery, conditioned on echoes, predicts a posterior over depth. The check is not raw accuracy but the design principle — posterior spread should grow precisely in cluttered scenes where the acoustic bandwidth limit binds, and one-step sampling should hold quality at low latency. If the same calibration-with-resolution-limit signature appears in both a physical and an informational domain, that is evidence the principle is general rather than an artifact of one dataset.
Baselines
The naive reference point is standard predictive functional profiling: multiply species-level abundances by a fixed reference genome-to-function matrix, the practice underlying dozens of association studies (Metformin Alters Gut Microbiota). On hCom2 this degenerates to assigning each species its single best reference genome, so it structurally cannot recover any non-reference strain's gene content; beating it means positive strain-level F1 where it has none, which is a floor check rather than a real contest. The strongest competitor is StrainPGC with MIDAS v3 (MIDAS v3 and StrainPGC), which reports a median F1 score of 0.91 on hCom2, outperforming PanPhlAn and StrainPanDA while cutting the false-negative rate to roughly half of PanPhlAn's. It will be run two ways on identical hCom2 splits with the same pangenome database and the same tuning budget: in its intended cohort mode, as the accuracy upper bound our single-sample model should approach, and in a crippled single-sample mode where each mixture is analyzed in isolation — the regime the file gives no reported result for on Lacuna, and where we expect it to fail outright, since its correlation statistics are undefined without a cohort. Beating StrainPGC means matching its cohort-mode F1 within confidence intervals while using only the held-out sample, and providing calibrated uncertainty where it offers only point calls. The ablation that isolates the key ingredient is the same network trained as a conventional curved multi-step diffusion sampler: at an equal compute budget it tests whether trajectory straightening is doing real work (one-step quality and latency) or is decorative; companion ablations remove the core/accessory two-scale factorization and replace the generative head with a deterministic regressor, each isolating one borrowed design choice.
Why not just…?
Why not just run StrainPGC on the whole cohort? If every application provided hundreds of related samples, StrainPGC would win and this proposal would be unnecessary. But its own mechanism requires locating samples where one strain holds at least 95% of a species' abundance, which fails for isolated clinical samples and low-prevalence taxa — a limitation its evaluation makes explicit (MIDAS v3 and StrainPGC). The leave-one-sample-out HMP2 protocol settles the question empirically: if cohort-mode StrainPGC and our single-sample model agree on held-out calls at similar accuracy, the single-sample regime is genuinely served; if StrainPGC's cohort calls prove reproducible from single samples only for high-prevalence species, the scope of our claim narrows accordingly, and we will report that stratification honestly.
Why not just train a plain regression network from gene depths to strain gene content? This is the most serious alternative, and we treat it as a baseline rather than an argument. A deterministic regressor with a fixed coordinate per gene cluster avoids the permutation problem, and deep ensembles can supply some uncertainty. Where it plausibly falls short is the equal-mixing regime: ensembles capture parameter uncertainty, not the multimodal posterior that arises when several distinct strain decompositions explain one depth profile, and regressors trained on mean loss tend to blur across modes. The decisive comparison is calibration (coverage and CRPS of credible sets) stratified by strain-frequency ratio on hCom2, run with identical data, compute, and tuning. We state plainly: if ensemble regression calibrates as well as the flow and matches F1, the flow's remaining contribution is one-step sampling speed and guaranteed simplex validity — a weaker claim, and we would report it as such.
Why not just use a standard multi-step diffusion model, or distill one? A curved-trajectory diffusion model can represent the same posterior, so the question is whether straightening earns its complexity. The evidence in the file says few-step quality is where curvature hurts: on ImageNet-256, standard training gives FID 33.11 at 4 steps versus 30.31 for straightened flows, and coupling straightening with average-velocity transport reaches FID 3.23 in a single step (AlignFlow); 3D MeanFlow achieves one-step generation without any distillation pipeline, where progressive distillation would require training a large teacher first (3D MeanFlow). For this application the posterior is consumed by drawing many samples per metagenome across thousands of samples, so per-sample cost multiplies; the curved-diffusion ablation with matched compute will show directly whether the one-step property matters at our scale or only at image-model scale.
Decisive Checks
The proposal stands or falls on four numbers. Single-sample gene-content F1 on hCom2 within the confidence band of StrainPGC's cohort-mode median F1 of 0.91. Calibration curves whose empirical coverage tracks nominal coverage, with posterior entropy rising near equal strain frequencies. Recovery of the two functionally distinct donor E. coli strains from individual UCFMT samples. And on BatVision, posterior spread that grows in the cluttered-scene regime where the acoustic bandwidth limit binds, without collapsing the point estimate below the reported anchors (V2E-CCL's 0.569 threshold accuracy at $\delta < 1.25$, a 15.8% relative error improvement over SAGENet). If the regression baseline matches the first two, the honest conclusion is that straightened flows here buy speed and manifold validity, not accuracy — a smaller but still useful result, and one we would write up as such.
References
- Association between gut microbiota and peptic ulcer disease, particularly gastric ulcer and duodenal ulcer: a two-sample Mendelian randomization study
- Causal effect between gut microbiota and pancreatic cancer: a two-sample Mendelian randomization study
- Accurate estimation of intraspecific microbial gene content variation in metagenomic data with MIDAS v3 and StrainPGC
- Evaluating Visual-to-Echo Distillation for Binaural Depth Prediction beyond Simulations
- Novel strain-level resolution of Crohn’s disease mucosa-associated microbiota via an ex vivo combination of microbe culture and metagenomic sequencing
- Microbial predictors of healing and short-term effect of debridement on the microbiome of chronic wounds
- Image2Reverb: Cross-Modal Reverb Impulse Response Synthesis
- Visual Acoustic Matching
- 3D MeanFlow: One-Step Point Cloud Completion and Generation via Average-Velocity Transport
- Step-by-Step Diffusion: An Elementary Tutorial
- Modelling Microbial Communities with Graph Neural Networks
- Flow Matching with Gaussian Process Priors for Probabilistic Time Series Forecasting
- Equivariant Flow Matching with Hybrid Probability Transport for 3D Molecule Generation
- AlignFlow: Improving Flow-based Generative Models with Semi-Discrete Optimal Transport
- VoiceFlow: Efficient Text-To-Speech with Rectified Flow Matching
- Analyzing and Mitigating Model Collapse in Reflow Methods
- 3D Molecule Generation from Rigid Motifs via $\mathrm{SE}(3)$ Flows
- Metformin Alters Gut Microbiota of Healthy Mice: Implication for Its Potential Role in Gut Microbiota Homeostasis
- Gut Microbial Dysbiosis Is Associated with Altered Hepatic Functions and Serum Metabolites in Chronic Hepatitis B Patients