Preprint
Article

This version is not peer-reviewed.

MARSH: Drift-Robust Microbial Source Tracking via Tree-Wasserstein Optimal Transport

Submitted:

11 September 2026

Posted:

14 September 2026

You are already at the latest version

Abstract
Microbial source tracking (MST) estimates the contributions of candidate source communities to an observed sink community. However, taxon-aligned approaches can degrade when biological turnover or technical differences introduce "drift" between source and sink profiles, because abundance on related but nonmatching taxa is treated as separate features. We present MARSH, a phylogeny-aware MST framework that models source attribution as constrained optimal transport on the microbial tree using the tree-Wasserstein distance. By leveraging evolutionary structure, MARSH allows abundance to be matched across closely related taxa rather than enforcing strict feature identity. The formulation limits the loss to local tree structure so that broad clade-level differences do not dominate the fit, and it estimates unobserved contribution from the residual left by the named-source mixture. Across synthetic and real 16S rRNA benchmarks, MARSH attains the lowest mean attribution error in every evaluated drift condition and remains competitive in the no-drift settings. These results show that integrating tree geometry into community deconvolution can improve source tracking when ecological or experimental drift preserves local phylogenetic structure.
Keywords: 
;  ;  

1. Introduction

Microbial community assembly reflects interacting processes that include dispersal, selection, diversification, and ecological drift [1]. An observed community may also contain microbial contributions from several distinct sources. Understanding these contributions is important in settings where the origin of a community carries biological, environmental, or public-health significance. Microbial source tracking (MST) provides a framework for this task by estimating the relative contributions of candidate source communities to a target, or “sink,” community [2,3]. MST has been used to identify sources of fecal contamination in recreational and environmental waters, where distinguishing human, animal, wastewater, and other inputs can inform pollution control and water-quality management [4,5]. It has also been applied to trace microbial contamination and dispersal in hospitals, laboratories, offices, and other built environments [2,6], and to study the formation of host-associated microbiomes, including the contributions of maternal and early-life communities to the developing infant gut [3]. More broadly, source attribution provides a way to move beyond describing which microbes are present and ask where an observed community came from.
In a typical MST analysis, each source and sink is represented by its relative-abundance profile, and the goal is to estimate the fraction of the sink attributable to each candidate source [2,3]. These profiles are compositional because sequencing data describe the abundance of each taxon relative to the total observed community rather than providing independent absolute abundances [7]. Source attribution is further complicated by the fact that the reference library may not contain every community that contributed to the sink. An environmental or host-associated sample, for example, may contain input from an unsampled reservoir or from a source that was not included when the reference panel was constructed. MST methods must therefore estimate the contributions of the available sources while also allowing part of the sink to originate from an unknown source [2,3].
Beyond incomplete source libraries, MST can also be affected when the microbial composition of the sink no longer aligns exactly with that of the reference sources. We refer to this source–sink mismatch as drift. Drift can arise biologically as microbial communities change over time [8], or technically when source and sink samples are characterized using different 16S regions, primers, or sequencing protocols [9]. In either case, taxa observed in the sink may differ from those in the references even when they are phylogenetically related. Existing MST approaches based on Bayesian mixture models, expectation–maximization, and matrix factorization operate on a shared feature space and match abundance across corresponding taxa [2,3,10]. They therefore cannot directly use the relationship between a taxon present in the sink and a closely related taxon present in a source. As drift increases, this mismatch can lead source contributions to be misestimated or attributed to the unknown component.
Phylogeny provides a natural way to incorporate this relationship. Phylogenetic community distances were developed to distinguish changes among close relatives from changes across deeper lineages [11,12]. Optimal transport makes this distinction explicit by treating microbial communities as probability measures on a phylogenetic tree. In this setting, the tree-based Wasserstein-1, or Kantorovich–Rubinstein, distance coincides with raw weighted UniFrac and has a closed-form edge-sum representation on the tree [12,13]. Transport between nearby taxa therefore costs less than transport between taxa separated by long phylogenetic distances. MARSH uses this geometry directly in the source-mixture estimation problem, allowing phylogenetically local differences between the sink and its references to be treated as drift rather than automatically as evidence for a different or unknown source. Our contributions are threefold:
1.
We formulate MST as a constrained optimal-transport problem on the phylogenetic tree, estimating source mixing weights by minimizing the tree-Wasserstein distance between the source mixture and the sink. The resulting problem is solved as an exact least-absolute-deviations linear program (Section 3.4).
2.
We introduce a fixed locality rule that limits the loss to shallow phylogenetic structure. This preserves the ability to match locally drifted taxa while preventing broad clade-level imbalances from dominating the fit (Section 3.3).
3.
We introduce an estimator of the unknown-source fraction based on the residual mismatch after fitting the known sources. It is designed to distinguish unexplained source contribution from mismatch that can be explained by local phylogenetic drift (Section 3.5).
We evaluate these components against FEAST, SourceID-NMF, and FastST on simulated and real 16S data, including unknown sources, induced phylogenetic drift, and naturally occurring temporal drift.

3. Methods

MARSH estimates the contributions of candidate microbial sources to an observed sink by fitting a mixture model under a phylogeny-aware transport loss. We first define the source-tracking problem and its unknown-source component, then introduce the phylogenetic discrepancy used by MARSH, its locality modification, and the resulting estimators.

3.1. Problem Formulation

Let the observed sink community contain counts y Z 0 n over n taxa, with total sequencing depth N = i y i . We work with the corresponding relative-abundance profile
p = y N Δ n 1 , Δ n 1 = x R 0 n : i x i = 1 .
The reference panel contains K candidate source communities with relative-abundance profiles s 1 , , s K Δ n 1 . The basic MST task is to estimate the proportion of the sink contributed by each of these sources.
Because the reference panel may not contain every community that contributed to the sink, we also allow an unknown source with profile b 0 Δ n 1 and contribution w 0 . We model the sink as
p ( 1 w 0 ) k = 1 K w k s k + w 0 b 0 , w Δ K 1 , 0 w 0 1 ,
where w = ( w 1 , , w K ) gives the relative proportions of the named sources within the explained component of the sink. The final contribution of named source k is therefore ( 1 w 0 ) w k .
The inputs to MARSH are the sink profile p , the candidate source profiles { s k } k = 1 K , and, when available, a phylogenetic tree T relating the observed taxa. The outputs are the estimated named-source contributions and, when unknown-source estimation is enabled, the unknown fraction w ^ 0 and estimated profile b ^ 0 .
The sink and its reference sources need not agree exactly at the taxon level. Under phylogenetically local drift, abundance associated with a source taxon may instead appear at a nearby relative in the sink. A discrepancy based only on matching corresponding taxa treats such a change as an ordinary mismatch and ignores the relationship between the two taxa. MARSH therefore fits the mixture in Eq. (21) using a phylogenetic transport loss, so that mismatches between closely related taxa incur a smaller cost than mismatches between distantly related taxa.

3.2. Phylogenetic Transport Loss

Let T be a rooted phylogenetic tree whose leaves correspond to the n taxa, with edge set E and edge lengths e > 0 . For edge e, let L ( e ) denote the set of descendant taxa and define the cumulative mass below that edge as
m e ( q ) = i L ( e ) q i .
Optimal transport compares two distributions by asking how much mass must be moved, and how far, to transform one distribution into the other [15,16]. When the transport cost between taxa i and j is their patristic distance d T ( i , j ) on the phylogeny, the Wasserstein-1 distance is
W 1 , T ( p , q ) = min Π U ( p , q ) i = 1 n j = 1 n d T ( i , j ) Π i j ,
where U ( p , q ) is the set of non-negative transport plans with marginals p and q .
On a tree, this optimization has the closed form
W 1 , T ( p , q ) = e E e m e ( p ) m e ( q ) .
This quantity is the phylogenetic Kantorovich–Rubinstein distance and is equivalent to raw weighted UniFrac for normalized communities [12,13]. Equation (24) provides the key property needed for source tracking: a mismatch between nearby taxa contributes only the length of the short path separating them, whereas a mismatch between distant taxa incurs a larger cost.
The tree representation is also computationally useful. Since each m e ( q ) is linear in q , the tree-Wasserstein distance is a weighted L 1 norm of a linear transformation of p q . This allows the source-mixture problem to be written directly as a linear program.

3.3. Local Phylogenetic Transport

Full tree-Wasserstein distance incorporates structure at every phylogenetic scale. This is desirable when source–sink differences occur among nearby taxa, but deep edges can also give substantial weight to differences between large clades. For source attribution, we therefore restrict the phylogenetic contribution of the loss to local tree structure.
Let
h = round ( n )
and retain only edges whose descendant subtree contains at most h taxa. Define
˜ e = e 1 | L ( e ) | h .
The resulting local tree loss is
D T ( p , q ) = e E ˜ e m e ( p ) m e ( q ) .
This modification retains all leaf edges and shallow internal edges. Exact taxonomic mismatches therefore remain penalized, while shallow internal edges provide partial tolerance when abundance shifts among nearby phylogenetic relatives. Deep edges are excluded so that broad clade-level imbalances do not dominate the source-mixture fit. The cutoff depends only on the number of taxa represented by the tree and introduces no drift-dependent tuning parameter.
Unless stated otherwise, a phylogenetic tree is supplied to MARSH, which uses the local loss in Eq. (27). The unrestricted tree-Wasserstein loss in Eq. (24) is used as a comparison in our experiments.

3.4. Estimating the Named-Source Proportions

For each edge e and source k, define
M e k = m e ( s k ) , c e = m e ( p ) .
For a candidate mixture k w k s k , linearity gives
m e k w k s k = k w k M e k .
The named-source weights are therefore estimated by
w ^ = arg min w Δ K 1 e E ˜ e k = 1 K w k M e k c e .
Introducing one auxiliary variable t e for each retained edge gives the least-absolute-deviations linear program
min w , t e E ˜ e t e , s . t . t e k w k M e k c e t e , e E , k w k = 1 , w k 0 .
The problem contains K + | E | variables and a number of constraints linear in the number of tree edges, and can therefore be solved directly with a standard linear-programming solver.
When no phylogenetic tree is supplied, the taxa are attached to a flat star scaffold. For the fully observed estimator, this makes the tree-Wasserstein objective equal to coordinate-wise L 1 distance. When the unknown-source estimator is enabled without a phylogenetic tree, its weight update instead uses simplex-constrained least squares. Define s ˜ 0 = b 0 and s ˜ k = s k for k = 1 , , K . Conditional on the current unknown profile, the update is
w ˜ ^ = arg min w ˜ Δ K k = 0 K w ˜ k s ˜ k p 2 2 .
This weight update alternates with a soft responsibility update of b 0 until the weights converge. The residual-based procedure below is used when a phylogenetic tree is supplied. An optional reweighted sparsity penalty may be added when the candidate source library is large; all default experiments use γ = 0 unless otherwise specified.

3.5. Residual-Based Unknown-Source Estimation with a Phylogenetic Tree

Estimating an unknown source introduces an identifiability problem. A discrepancy between the sink and the named-source mixture can arise either because a genuine source is absent from the reference panel or because a known source has changed relative to its reference profile. Treating every unexplained taxon as unknown therefore risks confusing drift with a missing source.
We first fit only the named sources and define
= k = 1 K w ^ k s k , R = D T ( , p ) ,
where R is the residual discrepancy that cannot be eliminated by reweighting the named sources.
We construct a candidate unknown-source profile from the positive taxonomic residual,
b 0 = Π ( p ) + ,
where Π renormalizes a non-zero vector to the simplex. If the residual is zero, we set w 0 = 0 and no unknown profile is required.
The transport loss has a useful scaling property. For any 0 a 1 ,
D T , ( 1 a ) + a b 0 = a D T ( , b 0 ) .
Thus, if the residual were generated entirely by mixing an unknown profile b 0 into the named mixture, its fraction would naturally scale as R / D T ( , b 0 ) . Under heavy drift, however, the residual profile may lie very close to the named mixture, making this denominator small and causing the ratio to overestimate the unknown fraction. We therefore introduce the intrinsic source-separation scale
D ¯ = 1 K k = 1 K D T ( s k , )
and estimate
w ^ 0 = min R max D T ( b 0 , ) , D ¯ , 1 .
The floor prevents a small residual-to-mixture distance from producing a large unknown estimate and is determined entirely by the observed source geometry rather than by a tuned threshold.
After estimating w ^ 0 and b 0 , we remove the estimated unknown contribution,
p = Π ( p w ^ 0 b 0 ) + ,
and refit the named-source weights. In our implementation this update is repeated for three rounds, after which the reported source proportions are
( 1 w ^ 0 ) w ^ 1 , , ( 1 w ^ 0 ) w ^ K , w ^ 0 .
The distinction between drift and an unknown source follows directly from the geometry of the loss. If an amount of mass a r is displaced from taxon i r to taxon j r , then
D T ( , p ) r a r d ˜ T ( i r , j r ) ,
where d ˜ T is the path cost induced by the retained tree edges. Drift between nearby taxa therefore produces a small residual, whereas source mass that cannot be reconciled with the named mixture produces a larger residual. This distinction is not absolute: an unknown source that is itself phylogenetically similar to the named sources may also produce a small transport residual. We return to this identifiability limit in Section 6.

3.6. Uncertainty

For fits without an unknown source, we quantify sampling uncertainty with a multinomial bootstrap. Given sink counts y at sequencing depth N, bootstrap replicate b is drawn as
y ( b ) Multinomial ( N , p ) , b = 1 , , B .
Each reference source is independently resampled in the same way at its observed sequencing depth. The resampled profiles are renormalized and the estimator is rerun to obtain w ( b ) . A 100 ( 1 α ) % confidence interval for each estimated proportion is given by the empirical percentile interval
Q α / 2 , Q 1 α / 2 ,
where Q q denotes the empirical q-quantile of the corresponding B bootstrap estimates. The current implementation reports point estimates, but not bootstrap intervals, when the unknown-source estimator is enabled.

4. Experimental Design

We evaluate MARSH on simulated and real 16S data under three settings: fully observed sources, unknown sources, and source–sink drift. The simulated experiments provide controlled ground truth, while the real-data experiments use observed microbial communities and taxonomy.

4.1. Simulated Data

Each simulated replicate is generated using our export-sim tool. We first draw a random birth–death phylogeny with n leaves and positive edge lengths. For K = 5 sources, the source profiles are sampled as
s k Dirichlet ( α 1 ) , k = 1 , , K .
Ground-truth mixing weights w are then selected. When an unknown source is included, we also generate an unknown profile b 0 with fraction w 0 . The sink distribution is formed using Eq. (21), and observed counts are sampled as
y Multinomial ( N , p ) .
Thus, all methods operate on finite-depth count data rather than the underlying probability vectors.
Three controlled evaluations use this generator. The fully observed scaling evaluation (Section 5.1) uses n { 50 , 500 , 5 , 000 , 50 , 000 } and w 0 = 0 . The unknown-source evaluation without drift (Section 5.2) fixes n = 500 and varies the unknown fraction w 0 { 0.2 , 0.4 , 0.6 , 0.8 } . The simulated drift evaluation (also Section 5.2) fixes n = 200 and w 0 = 0.30 . Each condition is repeated over five independent replicates.

4.2. GlobalPatterns

We use the GlobalPatterns 16S dataset [17], processed using QIIME 2 and phyloseq [18]. The dataset contains eight environment types: Feces, Skin, Tongue, Freshwater, Freshwater (creek), Ocean, Sediment (estuary), and Soil. Samples from each environment are pooled to form a source profile s e .
After filtering low-prevalence taxa, 6 , 231 taxa remain. The accompanying phylogeny is midpoint-rooted. For the drift experiment, we use a 1 , 000 -taxon subtree to reduce the cost of repeated tree-based optimization. We use a leave-one-environment-out design. For each environment U, we remove U from the candidate source set and construct the sink from two retained environments, A and B, together with the withheld environment:
p = 0.40 s A + 0.30 s B + 0.30 s U .
The true sink contributions are ρ A = 0.40 , ρ B = 0.30 , and ρ 0 = 0.30 . The environments A and B are selected using a fixed random seed. The remaining candidate set contains seven environments, including five zero-weight distractors. Since U is withheld from the candidate set, its contribution can only be recovered through the unknown-source estimate. Repeating this procedure for all eight environments gives eight paired trials. The no-drift and genus-drift evaluations are reported in Section 5.3.

4.3. Drift Models

We evaluate two forms of drift. The simulated drift evaluation (Section 5.2) uses the TADA generative model [19] to introduce structured phylogenetic perturbations in the sink. For the GlobalPatterns evaluation (Section 5.3), we define taxonomy-based genus turnover. Each eligible reference taxon i is paired with a source-absent taxon π ( i ) from the same genus. At drift level f, a fraction of the abundance at taxon i is transferred to its congener:
p π ( i ) p π ( i ) + f p i , p i ( 1 f ) p i .
The profile is renormalized after all transfers. At f = 0 , no drift is applied, while at f = 0.5 half of each affected reference taxon’s mass is transferred to its congener. The mapping π is defined using genus annotations rather than distances on the phylogenetic tree used by MARSH. The drift construction is therefore independent of the tree used by the estimator. For both simulated and real data, drift is evaluated at f { 0.1 , 0.2 , 0.3 , 0.4 , 0.5 } ; we do not evaluate or claim behavior beyond f = 0.5 .

4.4. Baselines and Evaluation

We compare MARSH with the published implementations of FEAST [3], SourceID-NMF [10], and FastST [14]. FEAST is run using its R implementation, SourceID-NMF using its Python implementation with 300 iterations, and FastST using its R implementation.
Accuracy is measured using the L 1 error between the estimated and true source proportions:
L 1 = k = 0 K w ^ k w k ,
where k = 0 denotes the unknown-source fraction. Lower values indicate more accurate source recovery.
Simulated results are reported descriptively as means over five independent replicates. Real-data results use paired observations from the eight leave-one-environment-out trials or the 27 Moving Pictures sinks. We compare real-data errors using two-sided paired Wilcoxon signed-rank tests [20]. The two external-method comparisons in each single-condition real-data evaluation are adjusted together using the Benjamini–Hochberg procedure [21]. For the five-level GlobalPatterns drift sweep, the five p-values for each of the two external comparators are combined into one family of ten tests for Benjamini–Hochberg adjustment. Adjusted values are reported as q-values. Exact permutation p-values are computed from the signed-rank statistic using midranks for tied absolute differences; differences smaller than 10 12 are treated as numerical ties. In the real-data tables, superscripts indicate p- or q-value thresholds: * < 0.05 , ** < 0.01 , and *** < 0.001 . No superscript indicates a non-significant difference. The leave-one-environment-out tests quantify consistency across the eight GlobalPatterns environments rather than population-level uncertainty. The Moving Pictures tests treat sinks as the paired analysis units but do not model temporal dependence among repeated samples from the same body site, so those p-values are interpreted as exploratory.

5. Results

5.1. Simulated Data with Fully Observed Sources Across Taxon Counts

No phylogenetic tree is supplied to MARSH in this experiment. With all sources known and no unknown, MARSH is competitive with the best baseline on small tables and attains the lowest mean error as dimensionality grows, while FEAST and SourceID-NMF degrade (Table 1). MARSH and FastST trade the lowest mean error across the sweep: FastST leads at 50 and 500 taxa, while MARSH leads at 5 , 000 and 50 , 000 taxa.

5.2. Simulated Data with an Unknown Source

We first consider the simulated unknown-source setting without drift. No phylogenetic tree is supplied to MARSH for this evaluation. As the true unknown fraction increases from 0.2 to 0.8 , MARSH attains the lowest error at every level (Table 2). FEAST’s error grows sharply as it misattributes the missing mass, while SourceID-NMF trails without leading.
We then introduce TADA drift while holding the true unknown fraction at 0.30 . A phylogenetic tree is supplied to MARSH. Its error remains near 0.15 and is lowest at every drift level (Table 3, Figure 1(a)). The transport loss carries drifted mass back to the correct source, while the floored denominator limits inflation of the estimated unknown fraction when the residual profile lies close to the named-source mixture.

5.3. GlobalPatterns Data with an Unknown Source

We first evaluate GlobalPatterns without drift. No phylogenetic tree is supplied to MARSH in this setting. With one environment withheld as an unknown source with a true fraction of 0.30 , MARSH recovers the unknown fraction as 0.292 and attains an order of magnitude lower L 1 error than the best competitor (Table 4). Two-sided paired Wilcoxon signed-rank tests give q = 0.008 against each competitor, with all eight trials favoring MARSH.
We next introduce genus drift. A phylogenetic tree is supplied to MARSH for this evaluation. Across f { 0.1 , 0.2 , 0.3 , 0.4 , 0.5 } , MARSH’s error rises from 0.06 to 0.28 but remains the lowest throughout (Table 5, Figure 1(b)). SourceID-NMF degrades from 0.12 to 0.66 as exact matching fails, while FEAST’s error changes from 0.33 to 0.38 . After Benjamini–Hochberg correction across all ten external-method comparisons in the drift sweep, the two-sided paired Wilcoxon tests give q = 0.0087 for both external methods at f = 0.1 0.4 . At f = 0.5 , the tests give q = 0.039 for FEAST and q = 0.0087 for SourceID-NMF.

5.4. Moving Pictures Data with Natural Temporal Drift

We evaluate naturally occurring drift using the QIIME 2 Moving Pictures dataset [8], in which the same body sites (gut, tongue, palm) are sampled repeatedly over 15 months. We take each body site’s day-0 community as its source and attribute each later sample (days 84–168) to its body site; the sink has drifted from its own day-0 reference through real turnover, not a synthetic perturbation. Scoring each attribution against its true body site by L 1 (Table 6, n = 27 sinks), MARSH attains the lowest mean error. Sink-level two-sided paired Wilcoxon tests give q = 0.015 versus FEAST and q < 0.001 versus SourceID-NMF; these comparisons are exploratory because temporal dependence within body sites is not modeled. Unlike the induced genus drift, natural gut turnover is dominated by phylogenetically distant novel taxa rather than local congener movement. A phylogenetic tree is supplied to MARSH for the primary evaluation, which produces an error of 0.92 ; omitting the tree produces an error of 0.99 , and the difference is not significant (two-sided paired Wilcoxon, p = 0.812 ). The locality-bounded metric (Section 3.3) avoids the higher mean error observed with an unrestricted tree-Wasserstein loss, which raises MARSH’s L 1 error to 1.18 , while the locality-bounded loss preserves its large advantage under phylogenetically local drift (Table 3 and Table 5).

5.5. Runtime and Peak Memory on Simulated and GlobalPatterns Data

Figure 2 summarizes computational scaling on the fully observed simulated data. Without a phylogenetic tree, MARSH is the fastest method through 5 , 000 taxa. At 50 , 000 taxa its runtime rises to 333.31 seconds because the coordinate-wise L 1 linear program grows with the number of taxa; it remains faster than FastST but is slower than FEAST and SourceID-NMF. MARSH has the lowest measured peak memory at every table size, using 149.9 MB at 50 , 000 taxa.
On the full GlobalPatterns input with 6 , 231 taxa and seven candidate sources, MARSH was run with a phylogenetic tree and unknown-source estimation. It took 86.88 seconds, compared with 29.92 59.49 seconds for the external methods, while using less peak memory: 49.2 MB compared with 131.6 1 , 852.2 MB.

6. Discussion

The experiments show that phylogenetic information is most useful when source and sink profiles differ through local taxonomic replacement. In the simulated TADA and GlobalPatterns genus-drift evaluations (Table 3 and Table 5), tree-Wasserstein distance maps abundance discrepancies along local evolutionary paths [12,13]. The fixed locality cutoff ( h = round ( n ) , Section 3.3) limits the distance calculation to shallow subtree edges, allowing drifted congener counts to remain associated with their reference sources. In the Moving Pictures temporal-drift evaluation (Section 5.4), the paired comparison does not detect an error difference between fits with and without a phylogenetic tree, while MARSH retains its advantage over the external baselines. Under heavier drift, the denominator floor D ¯ prevents collapsed transport distances from inflating the estimated unknown fraction. Together, these results support tree-based optimal transport as a practical, geometry-aware basis for community deconvolution [15,16].
The results also expose several operational trade-offs. When an unobserved source is phylogenetically adjacent to a candidate reference, transport partially absorbs missing mass as local drift, leading to a modest underestimation of the unknown fraction. Integrating multi-sample temporal tracking or lineage-specific priors could resolve this boundary by separating static ancestral divergence from rapid phenotypic drift. Because tree transport assigns low cost to short paths, it can also blur fine differences between near-identical strain variants; hierarchical loss schedules that enforce exact coordinate matching at the leaves while using tree transport across internal nodes could preserve both strain-level precision and clade-level drift tolerance. The present drift evaluations use synthetic perturbations and a congener-enriched panel (92% coverage) to probe the local-transport regime. Benchmarking on field cohorts with diverse, uncurated environmental drift will further map performance across broad taxonomic scales.
The largest simulated evaluation indicates that runtime, rather than memory, is the immediate scaling constraint. A matrix-free primal–dual solver could exploit the convex weighted- L 1 form without constructing the full linear-program constraint matrix; such methods are established for large structured nonsmooth convex problems [22].
Future development will focus on adapting the optimization framework to incorporate relevant biological priors and information, including phylogenetic tree structure, lineage-specific evolutionary rates, sequencing depth, and temporal or environmental context. These additions could make the model more responsive to differences among microbial systems while preserving a common source-tracking framework. Evaluating MARSH across longitudinal environmental systems, including wastewater surveillance, infant gut colonization, and industrial bioreactor tracking, will test its utility across diverse ecological succession dynamics.

7. Conclusion

MARSH reframes microbial source tracking as constrained optimal transport under the tree-Wasserstein metric, coupling phylogenetic geometry with a residual-anchored unknown-source estimator. Across synthetic drift benchmarks and real 16S rRNA genus turnover, this approach attains lower mean L 1 attribution errors than the evaluated coordinate-wise mixture and matrix-factorization baselines at every tested drift level. Limiting the loss to local tree structure improves attribution under the evaluated feature-level drift without the higher mean error observed for unrestricted tree-Wasserstein loss under broad turnover. The denominator floor limits inflation of the unknown-source estimate, and the no-drift evaluations support recovery of withheld-source contributions. Future development will focus on adapting the optimization framework to incorporate relevant biological priors and information, including phylogenetic tree structure, lineage-specific evolutionary rates, sequencing depth, and temporal or environmental context.
Source code and scripts reproducing all tables and figures are available at https://github.com/advaitb/MARSH.

References

  1. Nemergut, D.R.; Schmidt, S.K.; Fukami, T.; O’Neill, S.P.; Bilinski, T.M.; Stanish, L.F.; Knelman, J.E.; Darcy, J.L.; Lynch, R.C.; Wickey, P.; et al. Patterns and processes of microbial community assembly. Microbiol. Mol. Biol. Rev. 2013, 77, 342–356. [Google Scholar] [CrossRef] [PubMed]
  2. Knights, D.; Kuczynski, J.; Charlson, E.S.; Zaneveld, J.; Mozer, M.C.; Collman, R.G.; Bushman, F.D.; Knight, R.; Kelley, S.T. Bayesian community-wide culture-independent microbial source tracking. Nat. Methods 2011, 8, 761–763. [Google Scholar] [CrossRef] [PubMed]
  3. Shenhav, L.; Thompson, M.; Joseph, T.A.; Briscoe, L.; Furman, O.; Bogumil, D.; Mizrahi, I.; Pe’er, I.; Halperin, E. FEAST: fast expectation-maximization for microbial source tracking. Nat. Methods 2019, 16, 627–632. [Google Scholar] [CrossRef] [PubMed]
  4. Field, K.G.; Samadpour, M. Fecal source tracking, the indicator paradigm, and managing water quality. Water Res. 2007, 41, 3517–3538. [Google Scholar] [CrossRef] [PubMed]
  5. Henry, R.; Schang, C.; Coutts, S.; Kolotelo, P.; Prosser, T.; Crosbie, N.; Grant, T.; Cottam, D.; O’Brien, P.; Deletic, A.; et al. Into the deep: Evaluation of SourceTracker for assessment of faecal contamination of coastal waters. Water Res. 2016, 93, 242–253. [Google Scholar] [CrossRef] [PubMed]
  6. Flores, G.E.; Bates, S.T.; Knights, D.; Lauber, C.L.; Stombaugh, J.; Knight, R.; Fierer, N. Microbial biogeography of public restroom surfaces. PLoS ONE 2011, 6, e28132. [Google Scholar] [CrossRef] [PubMed]
  7. Gloor, G.B.; Macklaim, J.M.; Pawlowsky-Glahn, V.; Egozcue, J.J. Microbiome datasets are compositional: and this is not optional. Front. Microbiol. 2017, 8, 2224. [Google Scholar] [CrossRef] [PubMed]
  8. Caporaso, J.G.; Lauber, C.L.; Costello, E.K.; Berg-Lyons, D.; Gonzalez, A.; Stombaugh, J.; Knights, D.; Gajer, P.; Ravel, J.; Fierer, N.; et al. Moving pictures of the human microbiome. Genome Biol. 2011, 12, R50. [Google Scholar] [CrossRef] [PubMed]
  9. Tremblay, J.; Singh, K.; Fern, A.; Kirton, E.S.; He, S.; Woyke, T.; Lee, J.; Chen, F.; Dangl, J.L.; Tringe, S.G. Primer and platform effects on 16S rRNA tag sequencing. Front. Microbiol. 2015, 6, 771. [Google Scholar] [CrossRef] [PubMed]
  10. Huang, Z.; Cai, D.; Sun, Y. Towards more accurate microbial source tracking via non-negative matrix factorization (NMF). Bioinformatics 2024, 40, i68–i78. [Google Scholar] [CrossRef] [PubMed]
  11. Lozupone, C.; Knight, R. UniFrac: a new phylogenetic method for comparing microbial communities. Appl. Environ. Microbiol. 2005, 71, 8228–8235. [Google Scholar] [CrossRef] [PubMed]
  12. Lozupone, C.A.; Hamady, M.; Kelley, S.T.; Knight, R. Quantitative and qualitative β diversity measures lead to different insights into factors that structure microbial communities. Appl. Environ. Microbiol. 2007, 73, 1576–1585. [Google Scholar] [CrossRef] [PubMed]
  13. Evans, S.N.; Matsen, F.A. The phylogenetic Kantorovich–Rubinstein metric for environmental sequence samples. J. R. Stat. Soc. Ser. B (Statistical Methodology) 2012, 74, 569–592. [Google Scholar] [CrossRef] [PubMed]
  14. Choi, J.M.; Wu, X.; Zhang, L. FastST: an efficient tool for inferring decomposition and directionality of microbial communities. PeerJ 2025, 13, e20161. [Google Scholar] [CrossRef] [PubMed]
  15. Villani, C. Optimal Transport: Old and New. In Grundlehren der mathematischen Wissenschaften; Springer, 2009; Vol. 338. [Google Scholar] [CrossRef]
  16. Peyré, G.; Cuturi, M. Computational Optimal Transport. Found. Trends Mach. Learn. 2019, 11, 355–607. [Google Scholar] [CrossRef]
  17. Caporaso, J.G.; Lauber, C.L.; Walters, W.A.; Berg-Lyons, D.; Lozupone, C.A.; Turnbaugh, P.J.; Fierer, N.; Knight, R. Global patterns of 16S rRNA diversity at a depth of millions of sequences per sample. Proc. Natl. Acad. Sci. 2011, 108, 4516–4522. [Google Scholar] [CrossRef] [PubMed]
  18. Bolyen, E.; Rideout, J.R.; Dillon, M.R.; et al. Reproducible, interactive, scalable and extensible microbiome data science using QIIME 2. Nat. Biotechnol. 2019, 37, 852–857. [Google Scholar] [CrossRef] [PubMed]
  19. Sayyari, E.; Kawas, B.; Mirarab, S. TADA: phylogenetic augmentation of microbiome samples enhances phenotype classification. Bioinformatics 2019, 35, i31–i40. [Google Scholar] [CrossRef] [PubMed]
  20. Wilcoxon, F. Individual comparisons by ranking methods. Biom. Bull. 1945, 1, 80–83. [Google Scholar] [CrossRef]
  21. Benjamini, Y.; Hochberg, Y. Controlling the false discovery rate: a practical and powerful approach to multiple testing. J. R. Stat. Soc. Ser. B (Methodological) 1995, 57, 289–300. [Google Scholar] [CrossRef]
  22. Chambolle, A.; Pock, T. A first-order primal–dual algorithm for convex problems with applications to imaging. J. Math. Imaging Vis. 2011, 40, 120–145. [Google Scholar] [CrossRef]
Figure 1. Mean L 1 error for simulated TADA drift (a) and GlobalPatterns genus drift (b), each with a true unknown fraction of 0.30 . MARSH attains the lowest L 1 at every evaluated drift level ( f 0.5 ) on both datasets. On simulated data MARSH remains nearly constant across drift levels; on GlobalPatterns, SourceID-NMF error rises with drift while FEAST remains higher than MARSH.
Figure 1. Mean L 1 error for simulated TADA drift (a) and GlobalPatterns genus drift (b), each with a true unknown fraction of 0.30 . MARSH attains the lowest L 1 at every evaluated drift level ( f 0.5 ) on both datasets. On simulated data MARSH remains nearly constant across drift levels; on GlobalPatterns, SourceID-NMF error rises with drift while FEAST remains higher than MARSH.
Preprints 232982 g001
Figure 2. Runtime and peak resident memory for the fully observed simulated scaling evaluation. Both axes use logarithmic scales. Lower values are better.
Figure 2. Runtime and peak resident memory for the fully observed simulated scaling evaluation. Both axes use logarithmic scales. Lower values are better.
Preprints 232982 g002
Table 1. Fully observed sources, no unknown: mean L 1 error versus number of taxa (unknown fraction = 0 ). Best per row in bold.
Table 1. Fully observed sources, no unknown: mean L 1 error versus number of taxa (unknown fraction = 0 ). Best per row in bold.
# taxa MARSH FastST FEAST SourceID-NMF
50 0.023 0.020 0.034 0.215
500 0.032 0.026 0.042 0.328
5,000 0.036 0.054 0.068 0.705
50,000 0.099 0.132 0.467 0.782
Table 2. Simulated data with an unknown source and no drift: mean L 1 versus true unknown fraction.
Table 2. Simulated data with an unknown source and no drift: mean L 1 versus true unknown fraction.
unknown MARSH FEAST NMF
0.2 0.172 0.347 0.357
0.4 0.159 0.707 0.234
0.6 0.209 1.062 0.265
0.8 0.299 1.418 0.343
Table 3. Simulated TADA drift with an unknown source fraction of 0.30 : mean L 1 .
Table 3. Simulated TADA drift with an unknown source fraction of 0.30 : mean L 1 .
drift MARSH FEAST NMF
0.1 0.160 0.492 0.343
0.2 0.151 0.500 0.350
0.3 0.141 0.504 0.330
0.4 0.152 0.511 0.386
0.5 0.159 0.510 0.367
Table 4. GlobalPatterns data with an unknown source fraction of 0.30 and no drift.
Table 4. GlobalPatterns data with an unknown source fraction of 0.30 and no drift.
method mean L 1 rec. unknown
MARSH 0.017 0.292
NMF 0.162** 0.291
FEAST 0.251** 0.175
Table 5. GlobalPatterns genus drift with an unknown source fraction of 0.30 : mean L 1 over f [ 0.1 , 0.5 ] .
Table 5. GlobalPatterns genus drift with an unknown source fraction of 0.30 : mean L 1 over f [ 0.1 , 0.5 ] .
drift f MARSH FEAST NMF
0.1 0.058 0.331** 0.120**
0.2 0.092 0.303** 0.241**
0.3 0.167 0.334** 0.380**
0.4 0.233 0.358** 0.518**
0.5 0.276 0.385* 0.656**
Table 6. Natural temporal drift in Moving Pictures: mean L 1 of body-site attribution ( n = 27 sinks, truth = 100 % the sink’s own site). Lower is better; significance is a Benjamini–Hochberg-adjusted two-sided paired Wilcoxon test against MARSH.
Table 6. Natural temporal drift in Moving Pictures: mean L 1 of body-site attribution ( n = 27 sinks, truth = 100 % the sink’s own site). Lower is better; significance is a Benjamini–Hochberg-adjusted two-sided paired Wilcoxon test against MARSH.
method mean L 1
MARSH 0.92
FEAST 1.39*
SourceID-NMF 1.92***
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.