Preprint
Article

This version is not peer-reviewed.

Node-Level Mechanism-Shift Detection in Linear Non-Gaussian Causal Networks: A Bootstrap-Based Framework with Application to the Human Gut Microbiome

Submitted:

02 September 2026

Posted:

04 September 2026

You are already at the latest version

Abstract
As microbiome research increasingly seeks to identify true ecological shifts, transitioning from associational to causal approaches is essential. However, detecting structural changes across independent networks remains challenging due to the absence of established biological ground truths and the small, imbalanced sample sizes typical of microbiome cohorts. To address this, we extend an existing network comparison framework to enable node-level mechanism-shift detection under the direct linear non-Gaussian acyclic model (DirectLiNGAM). We evaluate the Naive, Bootstrap, and Relative sample size Bootstrap Stability (RSBS) estimators across extensive synthetic discovery runs and a semi-synthetic, batch-corrected human gut microbiome cohort. Our results demonstrate that resampling-based estimation consistently outperforms a single-fit Naive baseline by trading marginal recall for substantial precision gains. On both semi-synthetic and synthetic data, standard Bootstrap is optimal for comparing datasets of equal size, whereas RSBS is the only estimator that reliably handles imbalanced cohorts. This advantage strengthens as network dimensionality increases and persists under authentic compositional noise. Navigating this complex and emerging research area is currently constrained by limitations in data quantity and quality, scarce biological knowledge, and a lack of dedicated software. To address these critical gaps, we provide the complete benchmark pipeline and synthetic data generators as an open-access Python package, causal-comparator, to support node-level mechanism-shift detection across systems biology applications.
Keywords: 
;  ;  ;  ;  ;  ;  

1. Introduction

The microbiome consists of a characteristic community of microorganisms, including their genes and environmental context, that occupies a given habitat  [1]. The microbiome plays a crucial role in human health. In particular, the gut microbiome has been linked to metabolic, immune, and neurological disease states [2]. A common research question in this field is to define how the abundance of specific taxa varies between distinct cohorts, such as healthy versus diseased or pre- and post-intervention [3]. The primary objective is to determine whether any detected difference reflects a genuine change in a taxon’s ecological role.
Most methods developed for this task are associational, relying on correlation-based or co-occurrence networks that are constructed separately for each group and then compared, either edge-by-edge or via global topological summaries. NetCoMi [4] formalized this workflow in a general-purpose R package, providing compositionally aware association measures, such as correlation estimators (e.g., SparCC [5]), partial correlation estimators [6], and proportionality [7], together with sparsification and formal statistical tests for whether individual edges, or the network as a whole, differ between two groups. Liu et al. [8] distilled this into a broader methodological guide for comparing co-occurrence networks constructed from different sample groups or with different construction pipelines, and Wen et al. [9] extended multi-network comparison to multi-factor, multi-treatment, and transkingdom settings. However, despite the maturity of these methods, the principle correlation is not causation remains [10]. Ultimately, the relationships identified through association-network comparisons indicate association, rather than true causal dependencies.
This reflects a growing need within the field to transition from purely associational to causal approaches [11,12]. Recent studies have begun to address this challenge directly by adapting established causal discovery algorithms to the specific characteristics of microbiome data. Sazal et al. [13] combined Bayesian networks with co-occurrence networks into a signed Bayesian network to infer directional relationships and colonization order within microbial communities, and Corander et al. [14] extended standard causal graphs to labeled DAGs that encode context-specific independence, applying the framework to identify the causal role of Clostridioides difficile in driving diarrhea risk. Transitioning from structural representation to quantitative inference, Sazal et al. [15] later used interventional calculus to estimate causal effects between taxa directly from observational abundance data. As an alternative, functional causal models leverage the statistical properties of observational data to infer directionality of relationships. Among these, DirectLiNGAM [16] is particularly well suited to taxon-level abundance data, since it guarantees identification of the causal ordering in a finite number of steps under linearity, non-Gaussian noise, and acyclicity-assumptions with reasonable justification once compositional abundances are log-ratio transformed (Section 3.6.1). MultiGroupDirectLiNGAM [17] performs a joint estimation across several datasets under the assumption that they have a common causal order, leveraging shared information across datasets to improve estimation accuracy compared to independent fitting. However, in complex biological systems, maintaining a strictly conserved causal order is rarely a realistic assumption. Consequently, imposing a shared structure can hide the exact ecological and structural shifts that a comparative analysis aims to detect. While standard DirectLiNGAM has been employed to estimate causal networks within isolated gut-microbiome cohorts [18,19,20,21], these applications do not address whether the underlying causal architecture actually changes between different groups. To bridge this gap and evaluate structural differences without forcing a shared causal ordering, one must compare independently estimated networks. Toward this end, Ma and Tourani [22] defined a resampling-based estimator for quantifying, edge by edge, how confidently an individual causal relationship differs between two learned DAGs. However, this estimator operates strictly at the edge level. It tests for isolated changes rather than assessing whether a taxon’s full regulatory mechanism (its complete set of causal parents) has shifted. In microbiome data, evaluating the entire regulatory neighborhood is often more biologically meaningful, as a taxon’s ecological role is shaped by its broader network context rather than any single interaction [23,24].
In this work, we address this gap by extending the edge-level network-comparison framework of Ma and Tourani [22] to enable node-level mechanism-shift detection under DirectLiNGAM. DirectLiNGAM is well suited to this setting because it is a computationally fast algorithm capable of operating in high-dimensional regimes and relatively small sample sizes.
The prevalence of these small datasets, coupled with frequent sample size imbalances between cohorts, motivates our choice to evaluate three distinct estimators. First, we formalize a mechanism-perturbation ground truth where an entire node’s parent set, rather than a single edge, is rewired between two systems (Section 2.2.2). We then evaluate the Naive, Bootstrap, and RSBS (Relative sample size Bootstrap Stability) estimators. The RSBS estimator is specifically designed to remain reliable when the compared datasets differ substantially in size. This addresses a critical limitation of previous associational methods, as severe sample size imbalances are the rule rather than the exception when pooling independent microbiome cohorts. We validate this framework across an extensive set of synthetic experiments spanning both equal and heterogeneous sample sizes. To ensure these findings translate to data with authentic compositional structure and non-idealized noise, we also perform a semi-synthetic validation using a batch-corrected human gut-microbiome cohort (Section 3.6). Finally, we provide the full benchmark pipeline as an open-source Python package, including the three estimators and the underlying generators for synthetic graphs and mechanism perturbations, allowing other researchers to construct their own benchmarks with known ground truths.
This study reveals that resampling-based estimation does not uniformly outperform a single-fit Naive baseline. Specifically, standard Bootstrap estimation is the superior choice when the compared datasets are of equal size. Conversely, RSBS is the only estimator that reliably outperforms the Naive approach under sample size imbalance, an advantage that becomes more pronounced as network size grows. This pattern holds in the batch-corrected gut microbiome cohort, proving that the advantages of this approach generalize beyond idealized synthetic graphs, handling real compositional and technical noise.
The remainder of this paper is organized as follows. Section 2 introduces the LiNGAM framework, DirectLiNGAM, and our proposed node-level mechanism-shift extension. Section 3 details the experimental results on fully synthetic graphs under equal and heterogeneous sample sizes, as well as the semi-synthetic microbiome validation. Finally, Section 4 and Section 5 discuss the broader implications of this work and summarize the key contributions.

2. Materials and Methods

2.1. Background: The LiNGAM Framework & DirectLiNGAM

Our approach adopts the linear, non-Gaussian acyclic model (LiNGAM) framework, originally introduced by Shimizu et al. [25], for causal discovery from purely observational data. Rather than a single algorithm, LiNGAM is a general framework that includes a variety of specific causal discovery approaches.
Among these, we focus on DirectLiNGAM [16], which relies on four core assumptions about the data-generating process: the relationships are linear, the causal structure forms a directed acyclic graph (DAG), the noise terms are non-Gaussian, and there are no unobserved confounders.
Formally, the process can be represented as a directed acyclic graph (DAG) over p variables { x 1 , … , x p } , encoded by a p × p adjacency matrix B = { b i j } , where b i j quantifies the direct causal effect of x j on x i . Let k ( i ) denote the position of x i in an unknown causal ordering, such that no variable appearing later in the ordering has a directed path to any earlier variable; under this ordering, an edge x j → x i is permitted only if k ( j ) < k ( i ) . Every variable is assumed to have zero mean, the data-generating process is linear, and it can be written as follows:
x i = ∑ k ( j ) < k ( i ) b i j x j + e i ,
where e i are continuous random variables with non-Gaussian distributions, zero mean, and nonzero variance, and are mutually independent, so that there are no latent confounding variables. Equation (1) can be written in compact form as in Equation (2):
x = B x + e ,
where x is a p-dimensional random vector and e is the p-dimensional error vector; B can always be brought to strictly lower-triangular form by simultaneous, equal row and column permutation, as a consequence of the acyclicity assumption [26].
As an illustration, consider a three-variable causal chain x 1 → x 2 → x 3 , with structural equations
x 1 = e 1 , x 2 = b 21 x 1 + e 2 , x 3 = b 32 x 2 + e 3 ,
so that x 1 is an exogenous variable (a root node, determined only by its noise term), while x 2 and x 3 are endogenous. The corresponding adjacency matrix,
B = 0 0 0 b 21 0 0 0 b 32 0 ,
is strictly lower triangular under the causal ordering k = ( 1 , 2 , 3 ) . Given observations only, the estimation problem is to recover B (equivalently, the ordering k ( · ) together with the regression weights). Early approaches, such as ICA-LiNGAM [25], estimate the mixing matrix A = ( I − B ) − 1 via independent component analysis, but suffer from the absence of guaranteed convergence to the correct solution from a poor initialization and from the need for non-trivial parameter selection. DirectLiNGAM instead estimates the causal ordering directly, by sequentially identifying exogenous variables using an independence measure. Once the ordering is estimated, B is constructed by regressing each variable on its predecessors, through an adaptive LASSO.

2.1.1. DirectLiNGAM as a Causal Discovery Algorithm Reference

Throughout this paper we write M for a generic causal discovery algorithm: a procedure that takes a dataset D generated from the linear structural equation model (SEM) of Equation (2) and returns an estimated (weighted) adjacency matrix B ^ . M is treated as a black box by the Naive, Bootstrap, and RSBS estimators introduced in Section 2.2.3, which act only on B ^ ( s ) (Equations (6)–(10)) and never on the internal mechanics of how M produced it. We adopt DirectLiNGAM as the concrete instantiation of M used throughout this study.

2.2. Formal Framework

2.2.1. Problem Formulation and Notation

We extend the network-comparison framework of Ma and Tourani [22], applied to the LiNGAM structural equation model of Section 2.1, from edge-level difference estimation to node-level mechanism-shift detection between a pair of systems.
Let V = { x 1 , … , x p } . A system s ∈ { 1 , 2 } is defined by its own weighted, strictly lower-triangular matrix B ( s ) ∈ R p × p , generating data via the LiNGAM structural equation model of Equation (2), x ( s ) = B ( s ) x ( s ) + e ( s ) , i.e., x ( s ) = I − B ( s ) − 1 e ( s ) . For any node k, its set of causal parents in system s is denoted by Pa ( s ) ( k ) = { j : B k j ( s ) ≠ 0 } . Both systems share the same true causal order π over { 1 , … , p } : B ( 2 ) is always constructed from B ( 1 ) by rewiring entries within existing rows (Section 2.2.2), never by altering which index precedes which. Graphs, edge weights, and noise terms are generated following the standard DirectLiNGAM simulation protocol of Shimizu et al. [16], with the sole difference that we generate a pair of related systems, B ( 1 ) and B ( 2 ) , rather than a single one.
Baseline graphs are generated with each candidate edge ( k , j ) , j < k , included independently with probability p e (edge density). Prior to estimation, node labels are blinded independently for each system: a random permutation ρ ( s ) of { 1 , … , p } is applied to the columns of D ( s ) , so the causal discovery algorithm M observes variables in an order unrelated to π , exactly as M must recover in practice. Let B ^ ( s ) denote the weighted adjacency matrix returned by M in this permuted index space. Before any comparison, each B ^ ( s ) is re-aligned to the shared ground-truth order by inverting its blinding permutation, mapping row and column k back to index ( ρ ( s ) ) − 1 ( k ) ; all downstream quantities are defined on these realigned matrices.

2.2.2. Mechanism-Perturbation Ground Truth

Rather than perturbing individual edges independently anywhere in the graph, as in the general formulation of E i − E j in [22] (Eq. 1), our extension constrains perturbations to act on an entire node’s mechanism (its full parent set), which is the natural unit of comparison once edge-level differences are aggregated row-wise (Section 2.2.3).
Given baseline B ( 1 ) , a target set T ⊂ { 1 , … , p } with | T | = n pert is drawn from the subset of nodes k satisfying | Pa ( 1 ) ( k ) | ≥ n pos (enough existing parents to remove) and | { 1 , … , k − 1 } ∖ Pa ( 1 ) ( k ) | ≥ n pos (enough eligible non-parent predecessors to add). For each k ∈ T , B ( 2 ) is obtained from B ( 1 ) by removing n pos uniformly sampled entries from row k and adding n pos new nonzero entries at uniformly sampled positions in row k not already in Pa ( 1 ) ( k ) , with weights redrawn under the same protocol as Section 2.2.1. For k ∉ T , row k of B ( 2 ) is identical to row k of B ( 1 ) , so the structural equation for every non-target node is exactly preserved across systems. The ground truth is the binary vector
y ∈ { 0 , 1 } p , y k = 1 [ k ∈ T ] ,
which is what the node-level estimators in Section 2.2.3 are evaluated against.

2.2.3. Estimators

For a chosen discovery algorithm M (DirectLiNGAM throughout, Section 2.1.1), let D ( 1 ) , D ( 2 ) be datasets of size N 1 , N 2 simulated from systems 1 and 2 via Equation (2). We extend the three estimators of [22] from the constraint-based, unweighted setting to the weighted linear-SEM setting as follows.
Naive.
A single fit of M is obtained on each dataset, and the estimated adjacency is binarized:
B ^ k j ( s ) , naive = 1 B ^ k j ( s ) > 0 ,
Δ naive = B ^ ( 1 ) , naive − B ^ ( 2 ) , naive ∈ { − 1 , 0 , 1 } p × p ,
the direct linear-SEM analogue of Eq. 3 in [22].
2.2.3.2. Bootstrap.
M is refit on n sampling bootstrap resamples (with replacement) of each dataset, yielding the edge-selection frequency
B ^ k j ( s ) , BS = 1 n sampling ∑ b = 1 n sampling 1 edge ( j , k ) recovered in resample b ∈ [ 0 , 1 ] ,
Δ BS = B ^ ( 1 ) , BS − B ^ ( 2 ) , BS ,
matching Eq. 4 in [22].
RSBS (Relative sample size Bootstrap Stability).
This is our implementation’s realization of the equal-sample size resampling estimator of [22] (Eq. 5). Let n min = min ( N 1 , N 2 ) . The larger of D ( 1 ) , D ( 2 ) is first reduced to a single subsample of size n min , drawn once without replacement; the smaller dataset is left unchanged (it is already of size n min ). The standard bootstrap procedure of Equation (7) (with the same n sampling ) is then applied to both size- n min datasets:
B ^ ( s ) , RSBS = B ^ ( s ′ ) , BS evaluated on the n min - sized version of D ( s ) ,
Δ RSBS = B ^ ( 1 ) , RSBS − B ^ ( 2 ) , RSBS .
This is a practical, single-draw simplification of the general equal-sample size resampling estimator described above, which allows for the down-sampling itself to be repeated across resamples; our implementation fixes one down-sampled subset (controlled by a random seed) and bootstraps only on top of it, trading a small amount of additional variance in the down-sampling step for a substantially lower computational cost, since only one M-fit per bootstrap replicate is required instead of two nested resampling loops.

2.2.4. From Edge-Level Differences to Node-Level Mechanism Scores

The central extension of this work is the reduction Δ • ∈ R p × p ↦ s • ∈ R ≥ 0 p of the p × p edge-difference matrix (for • ∈ { naive , BS , RSBS } ) to a p-dimensional node score vector, aligned with the mechanism-perturbation ground truth y of Equation (4). Row k of Δ • collects the estimated differences over all candidate parents of node k; summing its absolute value therefore yields a single scalar quantifying how much node k’s mechanism is estimated to have changed between the two systems:
s k • = ∑ j = 1 p Δ k j • , k = 1 , … , p .
Two properties of Equation (11) are worth making explicit. First, taking the absolute value symmetrizes the estimator: unlike the directional definition E i − E j = 1 in [22] (Eq. 1), which only credits edges lost from system 1 to system 2, s k • accumulates contributions from both edge deletions ( Δ k j • > 0 ) and edge additions ( Δ k j • < 0 ) at node k, matching the symmetric construction of the mechanism perturbation itself (Section 2.2.2), which always removes and adds n pos parents. Second, because row k of B ( s ) contains exactly Pa ( s ) ( k ) , restricting the sum to row k (rather than column k, or both) isolates changes to node k’s incoming edges, i.e., its structural mechanism, as opposed to changes in how node k influences its descendants; this is the node-level quantity that corresponds by construction to y k in Equation (4). The vector s • = ( s 1 • , … , s p • ) is evaluated against y as a binary classification problem. Since Δ k j • is confined to the strictly lower or upper-triangular structure of B ( s ) , each s k • is a nonnegative integer, or real value score with no fixed upper bound other than the row’s number of eligible entries; s naive takes integer values (a sum of { 0 , 1 } terms) and is treated as a ranking score exactly as s BS , s RSBS are (a sum of [ 0 , 1 ] -valued terms), from which AUCROC and AUPR are computed directly, and F 1 , precision, and recall are computed at the score-maximizing threshold, τ ^ = arg max τ ∈ { s k • } F 1 ( y , 1 [ s • ≥ τ ] ) , searched over the set of unique observed scores (Section 3.1) as in [22].

2.3. Software Implementation

The full benchmark pipeline used to produce the synthetic results in Section 3, from graph generation through node-level scoring, is provided as an open-source Python package named causal-comparator. The complete source code is publicly available in an open repository (see the Data Availability Statement for access details).
Concretely, causal-comparator exposes the discovery algorithm M as a model_class parameter (defaulting to lingam.DirectLiNGAM), ensuring that the architecture remains modular. Beyond the three node-level estimators themselves, the software developed for this study also implements the synthetic-graph and mechanism-perturbation generators described in Section 2.2.1 and Section 2.2.2. By providing these underlying generators alongside the estimators, this framework allows researchers to construct custom benchmark datasets with known ground truths across arbitrary network sizes, edge densities, sample size regimes, and perturbation strengths.

3. Results

3.1. Experimental Design

We evaluated the Naive, Bootstrap, and RSBS estimators of Section 2 under the mechanism-perturbation ground truth of Section 2.2.2. Concretely, for a pair of systems ( G i , G j ) we generated G i as a random strictly lower-triangular weight matrix B i (edge density/probability p e , coefficients drawn from [ − 1.5 , − 0.5 ] ∪ [ 0.5 , 1.5 ] ), and obtained G j by perturbing the mechanism (parent set) of a subset of n pert target nodes: for each target, n pos existing parents were removed and n pos new parents were added, leaving all other nodes unchanged. Data were simulated from each system, the node labels were randomly shuffled prior to discovery to blind the causal order (as DirectLiNGAM must recover it), and the estimated adjacency/probability matrices were re-aligned to the ground-truth order before scoring. Each of the three estimators produces an edge-level difference matrix Δ ^ ∈ [ − 1 , 1 ] p × p . We converted this into a node-level score, s k = ∑ l | Δ ^ k l | , and evaluated it against the ground-truth binary indicator of whether node k’s mechanism was perturbed, using AUCROC, AUPR, and threshold-optimized F 1 , precision, and recall. Thresholding was performed by grid search over the unique score values, as in [22]. We ran two complementary experiments. In the equal-sample size experiment, N 1 = N 2 ∈ { 100 , 200 , 300 } , and only the Naive and Bootstrap estimators were evaluated, since RSBS is defined only when the two sample sizes differ (Section 2.2.3). In the heterogeneous-sample size experiment, the primary and secondary dataset sizes were N 1 ∈ { 400 , 800 } and N 2 ∈ { 100 , 200 , 400 } respectively (yielding sample size ratios r = N 2 / N 1 ∈ { 0.125 , 0.25 , 0.5 , 1.0 } ), and all three estimators were compared. Both experiments spanned network dimensions n nodes (corresponding to p in Section 2.2.1) ∈ { 15 , 20 , 25 } , edge density p e ∈ { 0.15 , 0.20 , 0.25 } , n pert ∈ { 2 , 3 , 4 } (the number of target nodes with altered mechanisms), and n pos ∈ { 1 , 2 } (the number of parents swapped per target node), with 50 independently sampled seeds per configuration. For a given seed, the same pair of graphs and datasets was reused across all three estimators, allowing paired comparisons. Bootstrap and RSBS estimators utilized n sampling = 100 resamples per dataset. In total, this yielded 9 , 900 discovery runs for the equal sample size experiment and 29 , 700 for the heterogeneous one ( 39 , 600 overall).
All summary tables in this section (Table 1, Table 2, Table 3, Table 4 and Table 5) aggregate over all three network sizes ( n nodes ∈ { 15 , 20 , 25 } ) unless stated otherwise. Figure 1, Figure 2 and Figure 3 and Figure 4, Figure 5 and Figure 6 show results for a representative network size of n nodes = 15 . We chose to plot a single size rather than overlaying all three, as doing so would obscure the trends in sample size and perturbation load that these figures aim to isolate. The corresponding 20 and 25 node panels are visually consistent with the trends shown and are provided as Figures S1–S6 (equal-sample size regime) and Figures S7–S12 (heterogeneous-sample size regime) in the Supplementary Materials. The size-dependent trends themselves are analyzed separately and quantitatively in Section 3.3 (Table 2), which does use all three network sizes.

3.2. Naive versus Bootstrap Estimation under Equal Sample Sizes

Table 1 summarizes performance across all 4 , 950 runs per method in the equal-sample size experiment. Bootstrap estimation outperformed the Naive method on every ranking and classification metric except recall: mean AUPR rose from 0.687 to 0.825 and mean AUCROC from 0.894 to 0.941 . A paired comparison (same seed, same graphs, same data, differing only in estimator) confirmed this is not noise: Bootstrap exceeded Naive by + 0.139 AUPR ( t = 39.7 , p < 10 − 16 ), + 0.047 AUCROC ( t = 27.6 , p < 10 − 16 ), and + 0.094 F 1 ( t = 35.6 , p < 10 − 16 ). Bootstrap’s estimates are also noticeably more stable than Naive’s. The standard deviation drops from 0.296 to 0.244 for AUPR, 0.142 to 0.103 for AUCROC, 0.233 to 0.193 for F 1 , and 0.291 to 0.237 for precision (Table 1). The one exception is recall, where Bootstrap’s SD ( 0.164 ) is marginally higher than Naive’s ( 0.153 ). Naive only exceeded Bootstrap on recall ( 0.945 vs. 0.926 ; t = − 6.5 , p < 10 − 10 ), at the cost of a 14-point drop in precision ( 0.699 vs. 0.837 ), see Section 3.5.
Figure 1 shows, for the 15-node condition, mean AUPR as a function of sample size for each edge density; the corresponding aggregate-over-all-sizes numbers are shown in Table 1– Table 2. Both methods improve monotonically with sample size, but the ordering never reverses: averaging across the three density panels shown, Bootstrap leads Naive by 0.18 AUPR at N 1 = N 2 = 100 ( 0.842 vs. 0.665 ), narrowing to a 0.05 AUPR gap at N 1 = N 2 = 300 ( 0.993 vs. 0.943 ). This same non-reversing ordering holds once the 20 and 25-node conditions are pooled in, at lower absolute AUPR (Table 1), because larger networks are harder to discover from a fixed, small sample (Table 2). Edge density has only a minor effect on the gap; both curves shift slightly as the graph becomes sparser, consistent with fewer high-effect-size parents to anchor discovery.
Figure 2 stress-tests the estimators (15-node condition) as the fraction of perturbed nodes increases (holding N 1 = N 2 = 100 ). Bootstrap’s advantage over Naive is stable across densities and perturbation fractions, indicating the benefit of resampling is not an artifact of a specific graph topology or perturbation load; the same qualitative pattern, at correspondingly lower absolute AUPR, holds in the 20 and 25-node conditions (Table 2).
Figure 3 examines the effect of perturbation strength n pos (parents swapped per target node) on precision and recall, again for the 15-node condition at the highest edge density tested ( p e = 0.25 ). Increasing n pos from 1 to 2 raises precision for both methods (Naive: 0.793 → 0.893 ; Bootstrap: 0.909 → 0.965 ), consistent with a larger effect size making the perturbation easier to detect, while recall remains high ( > 0.96 ) for both methods.

3.3. Effect of Network Size

Table 2 reports AUCROC and AUPR as the number of nodes grows from 15 to 25, with the (small) sample sizes used in our grid held fixed. Performance degrades for every method as dimensionality increases, as expected given the growing number of parameters DirectLiNGAM must estimate; but the size of the drop is not uniform across estimators. For Naive, AUPR falls from 0.835 (15 nodes) to 0.538 (25 nodes), a 30-point drop; for Bootstrap, it falls from 0.938 to 0.706 , a smaller relative decline that leaves Bootstrap’s advantage over Naive larger at 25 nodes ( + 0.168 AUPR) than at 15 ( + 0.104 AUPR). The same pattern holds in the heterogeneous experiment (Section 3.4), where RSBS’s margin over Naive widens from + 0.054 AUPR at 15 nodes to + 0.070 at 25 nodes. Resampling-based confidence therefore becomes more valuable as the discovery problem gets harder.

3.4. Naive versus Bootstrap versus RSBS under Heterogeneous Sample Sizes

When the two datasets differ substantially in size, the ranking among estimators changes in an important way: plain Bootstrap resampling is no longer reliably better than the Naive method. Over all 9 , 900 runs of the heterogeneous experiment (Table 3), Bootstrap’s mean AUCROC ( 0.907 ) and F 1 ( 0.802 ) were lower than Naive’s ( 0.927 and 0.824 ), and the paired difference was significant (AUCROC: − 0.020 , t ( 9899 ) = − 18.2 , p < 10 − 16 ; F 1 : − 0.022 , t = − 11.9 , p < 10 − 16 ), though the AUPR difference was not distinguishable from zero ( − 0.003 , t = − 1.2 , p = 0.24 ). RSBS, designed specifically for this regime, was the only estimator that dominated Naive on every metric except recall (AUPR + 0.066 , t = 28.6 ; AUCROC + 0.013 , t = 12.8 ; F 1 + 0.034 , t = 19.6 ; all p < 10 − 16 ) and also outperformed plain Bootstrap on every metric except recall (AUPR + 0.069 , AUCROC + 0.034 , F 1 + 0.056 ; all p < 10 − 16 ). Under the same evaluation framework, RSBS achieved or shared the top performance in 97.5 % of the 198 heterogeneous parameter combinations, versus 82.3 % for Bootstrap and 68.2 % for Naive.
Figure 4 shows, for the 15-node condition, mean AUPR against the larger sample size N 1 , marginalized over N 2 . RSBS (top curve) leads throughout; Naive (bottom curve at low density, middle at higher density) and Bootstrap cross over depending on density, reflecting the non-uniform Bootstrap-vs-Naive result above.
Figure 5 repeats the topological stress test of Figure 2 in the heterogeneous regime. RSBS sits above both Naive and Bootstrap at every density and every perturbation load tested, consistent with the overall ranking in Table 3.
Figure 6 shows precision and recall vs. perturbation strength for the 15-node condition at the highest edge density tested ( p e = 0.25 ). As in the equal-sample size experiment, increasing n pos from 1 to 2 raises precision for all three methods (Naive: 0.852 → 0.929 ; Bootstrap: 0.881 → 0.965 ; RSBS: 0.913 → 0.964 ), and RSBS’s precision advantage over Bootstrap is concentrated at n pos = 1 (the harder, single-parent-swap condition), where RSBS also has the edge over Naive.
Table 4 breaks the heterogeneous experiment down by sample size ratio r = N 2 / N 1 . RSBS’s advantage is largest exactly where it is designed to help: at the most imbalanced ratio ( r = 0.125 , i.e., N 1 = 800 , N 2 = 100 ), RSBS beats Naive by + 0.076 AUPR and Bootstrap by + 0.079 AUPR (paired t = 10.9 and 11.1 , both p < 10 − 16 ; see Table 5), while plain Bootstrap is statistically indistinguishable from Naive on AUPR at this ratio ( − 0.003 , t = − 0.5 , p = 0.61 ) despite being worse on AUCROC ( − 0.030 , t = − 8.5 , p < 10 − 16 ). As r → 1 (equal sample sizes), the three methods converge, and RSBS becomes numerically indistinguishable from Bootstrap (AUCROC 0.995 vs. 0.995 ; AUPR 0.972 vs. 0.972 at r = 1 )—exactly as expected, since the equal-sample size resampling step in Equation 10 performs no downsampling when N 1 = N 2 and RSBS reduces to standard bootstrap by construction. This internal consistency check gives us additional confidence in the correctness of our LiNGAM adaptation of the CausalComparator estimators.

3.5. The Precision–Recall Trade-off across Both Regimes

A consistent pattern emerges across both experiments: the Naive method achieves the highest recall of the three estimators but the lowest precision, in essentially every configuration we tested (Table 1 and Table 3). Because Naive assigns a hard 0 / 1 edge label from a single DirectLiNGAM fit per dataset, it has no mechanism to discount edges that are only weakly or inconsistently supported by the data; borderline edges are as likely to flip the node-level score as strongly supported ones. This over-flags a wider set of nodes as perturbed, inflating recall while depressing precision. In the equal-sample size experiment, Naive’s recall ( 0.945 ) exceeds Bootstrap’s ( 0.926 ) by only 2 points, while its precision ( 0.699 ) trails Bootstrap’s ( 0.837 ) by 14 points. In the heterogeneous experiment, Naive’s recall ( 0.966 ) exceeds RSBS’s ( 0.927 ) by 4 points, while its precision ( 0.772 ) trails RSBS’s ( 0.844 ) by 7 points; the gap widens further under the most imbalanced sample sizes tested ( r = 0.125 : Naive precision 0.582 vs. RSBS 0.676 , a 9-point gap against a 8-point recall deficit). In every configuration we examined, the precision gain for the resampling-based estimators exceeded their recall cost, which is why they dominate on F 1 , AUPR, and AUCROC despite never leading on recall alone. This trade-off is most pronounced exactly where discovery is hardest—at the smallest sample sizes and under the greatest sample size imbalance (Table 4, r = 0.125 )—suggesting that the confidence information carried by resampling is most useful precisely when a single point-estimate discovery run is least trustworthy.

3.6. Semi-Synthetic Benchmark Derived from Human Gut Microbiome Data

3.6.1. Cohort Construction

To assess whether the findings of Section 3.2, Section 3.3, Section 3.4 and Section 3.5 transfer beyond fully synthetic graphs, we applied the same three estimators to a real gut-microbiome cohort drawn from curatedMetagenomicData (version 3.16.1) [27], a curated, uniformly reprocessed collection of publicly available human microbiome shotgun-sequencing studies. We restricted to disease-free adult stool samples ( disease = healthy , body _ site = stool , age _ category = adult ), excluded samples with recorded current antibiotic use, pregnancy, or lactation, applied a minimum sequencing-depth floor of 1 , 000 , 000 reads [28,29], and retained one sample per subject (earliest visit, in studies with repeated sampling), to avoid pseudo-replication from longitudinally resampled individuals. This yielded 6 , 871 samples spanning multiple independent studies. Species-level relative abundances were aggregated to the family level; families present in fewer than 50 % of samples or averaging less than 0.01 % relative abundance were dropped [30,31], leaving 24 families.
Because samples originate from different studies, we corrected for study-level technical batch effects with MMUPHin [32] (adjust_batch, batch variable = study, applied on the relative-abundance scale prior to log-ratio transformation), then applied a centered log-ratio (CLR) transform [33,34] to remove the compositional (sum-to-one) constraint inherent to relative-abundance data, which otherwise induces spurious negative correlations among taxa unrelated to any real biological association. A quick diagnostic check (a one-way, Euclidean-distance analogue of PERMANOVA on the CLR-transformed family profile) confirmed that study identity explained 20.6 % of total compositional variance prior to correction, supporting a non-negligible batch effect worth correcting for. Because the full 24-family CLR composition sums to exactly zero for every sample by construction, its coordinates are linearly dependent, so the resulting covariance structure has rank at most p − 1 for p parts rather than full rank [33], a well-known obstacle in compositional data analysis that also affects CLR-based microbial network inference specifically [6]. Any full-rank parameterization of a p-part composition must be ( p − 1 ) -dimensional; standard constructions include the isometric log-ratio basis and Aitchison’s additive log-ratio, which fixes one part as reference and is equivalent, up to a linear transformation, to dropping one CLR coordinate [33,35]. We adopted the latter in its simplest form, dropping the single highest-mean-CLR family (Lachnospiraceae) prior to modeling, leaving 23 usable, well-posed variables.

3.6.2. Semi-Synthetic Ground Truth Construction

A fundamental obstacle in validating causal discovery or causal inference methods on gut microbiome data, and on microbiome data more generally, is the near-total absence of biological ground truth. Communities with fully known interaction sets are rare, and existing validated interaction lists are incomplete rather than exhaustive. No such resource exists at the scale this cohort operates at (thousands of samples, dozens of taxa). As a result, evaluation of microbial network inference is still carried out largely in silico, using synthetic or semi-synthetic data rather than communities with fully known interactions [36]. Fully synthetic graphs (Section 2.2.1) let us control the ground truth exactly, but say nothing about whether the estimators remain informative once applied to data with real compositional structure and real non-idealized noise. We therefore constructed a semi-synthetic ground truth. It inherits this cohort’s actual compositional structure and residual noise, but includes a known, injected structural change against which detection performance can still be measured directly. For each node count p ∈ { 15 , 20 , 23 } , treated independently, we selected the p most abundant families from the pool of 23 usable families described in Section 3.6.1 and fit a separate real DirectLiNGAM model (Section 2.1.1) to the full 6 , 871 -sample cohort restricted to just those p families. Fitting the baseline on the full cohort, and only subsequently drawing smaller simulated samples from it for evaluation, follows the same real-data design used by Ma and Tourani [22] in their own real-world evaluation, where causal graphs were likewise estimated on the full sample size of each real dataset before subsampling for the comparison experiment. This produces three independent baseline fits, one per node count, each with its own causal order π , adjacency matrix B real ( 1 ) , and residuals e = x − x B real ( 1 ) ⊤ implied by that fit.
We ranked families by mean CLR value, rather than sampling them at random, for two reasons. First, low-abundance taxa are disproportionately affected by zero-inflation and detection-limit noise, which degrades the reliability of any network or causal structure built on them [36]; restricting to the families with the highest mean CLR value at each p favors the more reliably measured taxa, consistent with the prevalence/abundance filter already applied during cohort construction (Section 3.6.1). Second, ranking by mean CLR value produces nested panels across node counts (15-family ⊂ 20-family ⊂ 23-family), so that increasing p consistently means adding progressively rarer, harder-to-estimate families.
B real ( 1 ) was then perturbed into B ( 2 ) using exactly the mechanism-perturbation procedure of Section 2.2.2 (Equation (4)): n pert target nodes have n pos parent edges removed and n pos new parent edges added, with new-edge weights built by drawing a magnitude from the empirical distribution of | B real ( 1 ) | ’s nonzero weights and assigning an independent random sign, so injected edges have plausible magnitudes and can be positive or negative, just like the real network’s own edges. What differs from the fully synthetic setup of Section 2.2.1 is where the baseline graph, causal order, and noise come from, and how data are subsequently simulated: instead of a randomly generated graph and fresh i.i.d. noise from a specified non-Gaussian distribution, the baseline B real ( 1 ) and π are estimated directly from the real cohort, and each of the two simulated datasets is generated as x ( s ) = ( I − B ( s ) ) − 1 e ( s ) , where e ( s ) is built by bootstrap-resampling rows of the real residual matrix e . Resampling whole residual rows, rather than resampling each family’s residual independently, preserves whatever real cross-family residual dependence the linear fit did not absorb; using the empirical residual distribution as-is, rather than fitting a parametric noise model to it, avoids introducing a further, potentially misspecified, distributional assumption on top of the real data.
Therefore, it is worthwhile to mention that B real ( 1 ) is itself a DirectLiNGAM fit, not independently verified ground truth about the true causal structure of the human gut microbiome. Moreover, this design does not test whether DirectLiNGAM recovers the true biological network. It tests whether the Naive, Bootstrap, and RSBS estimators can reliably detect a controlled, known structural change injected on top of a real, data-derived baseline, under real noise, real edge scale, and a real causal order, rather than a synthetic one.

3.6.3. Experimental Design

For every ( p , n pert , n pos ) combination, twenty independent replicates were run, each drawing a new random target set T, simulating N 1 = 300 samples from B real ( 1 ) and N 2 = 150 from B ( 2 ) (sample size ratio r = N 2 / N 1 = 0.5 , held fixed rather than swept, unlike the synthetic heterogeneous experiment of Section 3.4), and scoring all three estimators with 100 bootstrap resamples each. We tested p ∈ { 15 , 20 , 23 } (the last using the full 23-family panel), n pert ∈ { 2 , 3 , 4 } (equivalently 8.7 % – 26.7 % of nodes perturbed, depending on p), and n pos ∈ { 2 , 4 } parent edges swapped per perturbed node. This gives 18 parameter combinations × 20 repeats = 360 runs per estimator, 1 , 080 discovery-comparison runs in total. Metrics (AUCROC, AUPR, threshold-optimized F 1 , precision, recall) are computed exactly as in Section 2.2.4.

3.6.4. Results

Table 6 reports overall performance, split by perturbation intensity n pos . Pooled across all 18 conditions (360 paired runs), both resampling-based estimators outperformed Naive by a statistically significant margin: Bootstrap led Naive by + 0.032 AUCROC ( t = 3.50 , p = 4.7 × 10 − 4 ), + 0.054 AUPR ( t = 5.71 , p = 1.1 × 10 − 8 ), and + 0.050 F 1 ( t = 6.59 , p = 4.3 × 10 − 11 ); RSBS led Naive by + 0.030 AUCROC ( t = 2.79 , p = 5.3 × 10 − 3 ), + 0.062 AUPR ( t = 5.60 , p = 2.1 × 10 − 8 ), and + 0.053 F 1 ( t = 5.92 , p = 3.2 × 10 − 9 ). Bootstrap and RSBS, in contrast, were not distinguishable from each other pooled over all conditions ( Δ AUCROC = − 0.001 , p = 0.90 ; Δ AUPR = + 0.008 , p = 0.44 ), at the single, moderate sample size ratio ( r = 0.5 ) used throughout this cohort. This is a narrower separation between the two resampling-based estimators than in the synthetic heterogeneous experiment at the same ratio (Section 3.4, Table 4, where RSBS still led Bootstrap by + 0.062 AUPR at r = 0.5 ), consistent with the additional biological and technical noise present in real, compositional microbiome data relative to a clean synthetic linear SEM.
Figure 7 shows mean AUPR against node count p, faceted by n pos . Absolute performance is markedly lower than on the fully synthetic graphs of Section 3.2, Section 3.3 and Section 3.4 (AUPR in the 0.22 – 0.50 range here, versus 0.54 – 0.99 there), which is expected: real, batch-corrected, compositional microbiome data carries genuine biological and technical noise that a clean synthetic linear SEM does not, and should not be expected to match. More informative than the absolute level is the trend across p: Bootstrap’s advantage over the other two estimators, clearest at p = 15 (AUCROC 0.665 vs. RSBS 0.626 vs. Naive 0.592 ), erodes as p grows, and by p = 23 the ranking has reversed on both ranking metrics — RSBS leads (AUCROC 0.609 , AUPR 0.310 ), with Bootstrap ( 0.569 / 0.245 ) statistically indistinguishable from Naive ( 0.575 / 0.237 ) on AUCROC. This mirrors, within the microbiome-derived semi-synthetic benchmark, the qualitative pattern already established synthetically in Section 3.3: resampling-based confidence becomes more valuable, not less, as the discovery problem gets harder, and here RSBS specifically is the estimator that keeps that promise as network size grows.
Figure 8 repeats the topological stress test of Figure 2 and Figure 5 on the real cohort, faceted by p instead of edge density (the real cohort’s structural axis). The same crossover is visible panel-by-panel: at p = 15 , Bootstrap leads at every perturbation load tested; by p = 23 , RSBS leads at every perturbation load tested, with the gap most pronounced at the lowest perturbation fraction shown ( 8.7 % ).
Table 7 reports the paired comparison at the hardest condition tested (largest node count, strongest perturbation: p = 23 , n pos = 4 ). RSBS’s advantage over Naive is significant on AUPR ( + 0.074 , t = 2.75 , p = 5.9 × 10 − 3 ) and F 1 ( + 0.061 , t = 2.78 , p = 5.5 × 10 − 3 ) even at this reduced, condition-specific sample size ( n = 60 paired repeats); its advantage over Bootstrap on AUPR is directionally consistent but only borderline significant at this single condition ( + 0.050 , t = 1.94 , p = 0.053 ), while Bootstrap is statistically indistinguishable from Naive on every metric at this hardest condition, consistent with the crossover already visible in Figure 7.
Finally, Figure 9 examines the effect of perturbation strength n pos itself on precision and recall, pooled over all three node counts. Increasing n pos from 2 to 4 raised precision for every method (Naive: 0.341 → 0.368 ; Bootstrap: 0.399 → 0.460 ; RSBS: 0.413 → 0.457 ), while recall stayed essentially flat for all three ( 0.75 – 0.80 throughout). This is the same qualitative pattern as Figure 3 and Figure 6: a larger injected structural change is easier to distinguish from background noise without any corresponding cost in the estimators’ sensitivity, and its replication here, on a real, batch-corrected, compositional cohort rather than a synthetic graph, is itself a validity check on the estimators’ behavior: despite the added difficulty of real, compositional, batch-corrected data, effect size still behaves the way it should.

3.7. Summary of Findings

  • Under equal sample sizes, Bootstrap dominated the Naive estimator on AUCROC, AUPR, F 1 , and precision across every network size, edge density, and perturbation setting tested (best-or-tied in 100 % of 99 parameter combinations, vs. 50.5 % for Naive).
  • Under heterogeneous sample sizes, plain Bootstrap resampling lost its advantage over the Naive method (and was significantly worse on AUCROC and F 1 ), confirming that resampling alone does not compensate for unequal discovery power between datasets of very different sizes.
  • RSBS (equal-sample size resampling) was the most robust estimator overall in the heterogeneous experiment, best-or-tied in 97.5 % of 198 parameter combinations, with its largest advantage precisely at the most imbalanced sample size ratio tested ( N 2 / N 1 = 0.125 ).
  • RSBS converges to plain Bootstrap as the sample size ratio approaches 1, as it must by construction, which we take as an internal validity check on our LiNGAM implementation of the three estimators.
  • Performance for all three estimators degraded as the number of nodes grew from 15 to 25 at fixed (small) sample sizes, but the relative benefit of resampling-based estimation over the Naive method increased with network size, rather than diminishing.
  • Across both experiments, the Naive method consistently achieved the highest recall but the lowest precision; Bootstrap and RSBS traded a small amount of recall for a substantially larger gain in precision, which drove their advantage on F 1 , AUPR, and AUCROC.
  • Because gut microbiome data lack an established causal ground truth and are compositional, with CLR-transformed abundances rank-deficient by construction, evaluating the estimators on real data required a purpose-built, semi-synthetic, real-data-grounded validation (Section 3.6.2) rather than a direct comparison against known structure.
  • On this real, batch-corrected microbiome cohort, both resampling-based estimators reproduced the synthetic experiments’ qualitative ranking, outperforming Naive by a modest but statistically significant margin (pooled across node counts and perturbation intensities), though Bootstrap and RSBS were not distinguishable from each other at the single, moderate sample size ratio tested, a narrower separation than observed in the synthetic heterogeneous experiment at the same ratio.

4. Discussion

As the need for mechanistic approaches to discover ecological shifts in microbial communities grows, transitioning from purely associational to causal methods has become essential. Traditional comparative methods rely on correlational summaries. However, these approaches cannot reliably distinguish true mechanistic changes from purely associational differences. To address this limitation, we extended the network comparison framework of Ma and Tourani [22] to detect mechanism shifts at the node level under DirectLiNGAM. We evaluated three estimators, Naive, Bootstrap, and RSBS, that are designed to handle the small and often imbalanced sample sizes typical of microbiome data.
Our empirical evaluation across fully synthetic networks and a semi-synthetic gut microbiome cohort reveals that the optimal estimation strategy depends fundamentally on the sample size. When comparing datasets of equal size, standard Bootstrap estimation consistently dominated the Naive baseline across all tested network sizes, edge densities, and perturbation settings. However, this advantage deteriorated under heterogeneous sample sizes because plain Bootstrap failed to compensate for unequal discovery power. In these imbalanced scenarios, the RSBS estimator was the only method that reliably outperformed the Naive approach. We specifically designed RSBS to equalize sample sizes prior to resampling. As the network size increased and the discovery problem became more difficult, the relative benefit of estimation based on resampling grew. The underlying mechanism for this performance gain is rooted in a trade-off between precision and recall. While the Naive method achieves high recall, it suffers from poor precision by overestimating weakly supported edges. Both Bootstrap and RSBS trade a marginal reduction in recall for a substantial increase in precision. This property proved robust even when subjected to the authentic compositional and technical noise of a real microbiome cohort corrected for batch effects.
Despite these promising results, we must acknowledge several limitations. First, an absolute and independently verified causal network for the human gut microbiome does not currently exist. Therefore, our real-world validation relied on a semi-synthetic ground truth. While our findings confirm that the estimators can detect structural shifts against a baseline derived from data, they do not guarantee that DirectLiNGAM perfectly recovers the true underlying biological network. Second, the framework operates under the assumption of no unobserved confounders. In microbial ecosystems, unmeasured variables like host metabolites or environmental factors can act as hidden common causes that drive the apparent relationship between two species [15]. Third, DirectLiNGAM relies on linearity and acyclicity. In contrast, true microbial interactions frequently feature complex nonlinear dynamics and feedback loops that violate the directed acyclic graph (DAG) assumption [37]. Finally, our current synthetic validation was computationally constrained to a moderate number of nodes. Capturing microbiome dynamics at the species level naturally involves significantly higher dimensionality.
Future work will focus on addressing these dimensional limitations by extending the synthetic benchmarking to accommodate more than 50 variables. This expansion is a necessary prerequisite before applying the pipeline at the species level. It will require expanded computational resources and optimized hardware configurations. Ultimately, we aim to extend the framework along with the Python package to evaluate different classes of structural perturbations in other fields. For example, we could model gene knockout experiments in broader systems biology applications.

5. Conclusions

In this study, we extended the network comparison framework of Ma and Tourani [22] to detect node-level mechanism shifts under DirectLiNGAM. We rigorously evaluated three estimators (Naive, Bootstrap, and RSBS) across nearly 40,000 synthetic discovery runs and a semi-synthetic, batch-corrected human gut microbiome cohort. Our findings demonstrate that estimation based on resampling consistently outperforms a single-fit Naive baseline. Specifically, standard Bootstrap is optimal for equal sample sizes, while RSBS is the only estimator that reliably handles imbalanced cohorts.
The complete benchmark pipeline, named causal-comparator, is openly available as a Python package hosted in a public GitHub repository. We designed this framework specifically to accommodate custom structural perturbations and dynamic synthetic data generation. As a result, researchers can easily adapt and extend the pipeline to generate their own benchmarks with known ground truths. Because of its flexible architecture, causal-comparator is not restricted to the microbiome field, but serves as a general-purpose tool for causal mechanism-shift detection across broader systems biology applications.   

Supplementary Materials

Figure S1: Learning curves, equal sample sizes, 20-node condition; Figure S2: Topological stress test, equal sample sizes, 20-node condition; Figure S3: Intervention complexity, equal sample sizes, 20-node condition; Figure S4: Learning curves, equal sample sizes, 25-node condition; Figure S5: Topological stress test, equal sample sizes, 25-node condition; Figure S6: Intervention complexity, equal sample sizes, 25-node condition; Figure S7: Learning curves, heterogeneous sample sizes, 20-node condition; Figure S8: Topological stress test, heterogeneous sample sizes, 20-node condition; Figure S9: Intervention complexity, heterogeneous sample sizes, 20-node condition; Figure S10: Learning curves, heterogeneous sample sizes, 25-node condition; Figure S11: Topological stress test, heterogeneous sample sizes, 25-node condition; Figure S12: Intervention complexity, heterogeneous sample sizes, 25-node condition.

Author Contributions

FC: Conceptualization, Data curation, Formal Analysis, Investigation, Methodology, Project administration, Resources, Software, Validation, Visualization, Writing – original draft, Writing – review and editing. EA: Conceptualization, Funding acquisition, Investigation, Resources, Supervision, Validation, Visualization, Writing – original draft, Writing – review and editing. FS: Conceptualization, Data curation, Formal Analysis, Funding acquisition, Investigation, Methodology, Project administration, Resources, Software, Supervision, Validation, Visualization, Writing – original draft, Writing – review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Minutia.AI Pte. Ltd.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The software developed for this study, including the Naive, Bootstrap, and RSBS node-level estimators and the synthetic-graph and mechanism-perturbation generation framework, is openly available as the causal-comparator package on GitHub at https://github.com/Francesco-Canonaco/causal-comparator, allowing the full benchmark pipeline to be reproduced. The underlying real microbiome data are publicly available via curatedMetagenomicData [27].

Acknowledgments

The authors thank Nicole Astrologo for her help in retrieving the curated metagenomic data. During the preparation of this manuscript/study, the author(s) used GenAI for the purposes of code review and text review. The authors have reviewed and edited the output and take full responsibility for the content of this publication. All computational experiments were performed on an Amazon Web Services Elastic Compute Cloud (AWS EC2) c6a.8xlarge instance running Ubuntu Server 24.04 LTS (64-bit x86). The instance was equipped with 32 vCPUs (16 physical AMD EPYC 7R13 cores with two threads per core) and 64 GiB of RAM.

Conflicts of Interest

Author FC is funded by Minutia.AI Pte. Ltd. Author EA has equity and is an advisor to Minutia.AI Pte. Ltd. The remaining author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AUCROC Area Under the Receiver Operating Characteristic Curve
AUPR Area Under the Precision–Recall Curve
CI Confidence Interval
CLR Centered Log-Ratio
DAG Directed Acyclic Graph
ICA Independent Component Analysis
LASSO Least Absolute Shrinkage and Selection Operator
PERMANOVA Permutational Multivariate Analysis of Variance
RSBS Relative sample size Bootstrap Stability
SD Standard Deviation
SEM Structural Equation Model

References

  1. Berg, G.; Rybakova, D.; Fischer, D.; Cernava, T.; Vergès, M.C.C.; Charles, T.; Chen, X.; Cocolin, L.; Eversole, K.; Corral, G.H.; et al. Microbiome definition re-visited: old concepts and new challenges. Microbiome 2020, 8, 103. [Google Scholar] [CrossRef] [PubMed]
  2. Hou, K.; Wu, Z.X.; Chen, X.Y.; Wang, J.Q.; Zhang, D.; Xiao, C.; Zhu, D.; Koya, J.B.; Wei, L.; Li, J.; et al. Microbiota in health and diseases. Signal Transduct. Target. Ther. 2022, 7, 135. [Google Scholar] [CrossRef] [PubMed]
  3. Wang, Y.; Zhou, J.; Ye, J.; Sun, Z.; He, Y.; Zhao, Y.; Ren, S.; Zhang, G.; Liu, M.; Zheng, P.; et al. Multi-omics reveal microbial determinants impacting the treatment outcome of antidepressants in major depressive disorder. Microbiome 2023, 11, 195. [Google Scholar] [CrossRef] [PubMed]
  4. Peschel, S.; Müller, C.L.; Von Mutius, E.; Boulesteix, A.L.; Depner, M. NetCoMi: network construction and comparison for microbiome data in R. Brief. Bioinform. 2021, 22, bbaa290. [Google Scholar] [CrossRef] [PubMed]
  5. Friedman, J.; Alm, E.J. Inferring correlation networks from genomic survey data. 2012. [Google Scholar] [CrossRef] [PubMed]
  6. Kurtz, Z.D.; Müller, C.L.; Miraldi, E.R.; Littman, D.R.; Blaser, M.J.; Bonneau, R.A. Sparse and compositionally robust inference of microbial ecological networks. PLoS Comput. Biol. 2015, 11, e1004226. [Google Scholar] [CrossRef] [PubMed]
  7. Lovell, D.; Pawlowsky-Glahn, V.; Egozcue, J.J.; Marguerat, S.; Bähler, J. Proportionality: a valid alternative to correlation for relative data. PLoS Comput. Biol. 2015, 11, e1004075. [Google Scholar] [CrossRef] [PubMed]
  8. Liu, C.; Li, C.; Jiang, Y.; Zeng, R.J.; Yao, M.; Li, X. A guide for comparing microbial co-occurrence networks. Imeta 2023, 2, e71. [Google Scholar] [CrossRef] [PubMed]
  9. Wen, T.; Liu, Y.X.; Liu, L.; Niu, G.; Ding, Z.; Teng, X.; Ma, J.; Liu, Y.; Yang, S.; Xie, P.; et al. ggClusterNet 2: An R package for microbial co-occurrence networks and associated indicator correlation patterns. Imeta 2025, 4, e70041. [Google Scholar] [CrossRef] [PubMed]
  10. Pearl, J. Causality; Cambridge university press, 2009. [Google Scholar]
  11. Moreno-Indias, I.; Lahti, L.; Nedyalkova, M.; Elbere, I.; Roshchupkin, G.; Adilovic, M.; Aydemir, O.; Bakir-Gungor, B.; Santa Pau, E.C.d.; D’Elia, D.; et al. Statistical and Machine Learning Techniques in Human Microbiome Studies: Contemporary Challenges and Solutions. Front. Microbiol. 2021, 12–2021. [Google Scholar] [CrossRef] [PubMed]
  12. Khelfaoui, I.; Wang, W.; Meskher, H.; Shehata, A.I.; El Basuini, M.F.; Abouelenein, M.F.; Degha, H.E.; Alhoshy, M.; Teiba, I.I.; Mahmoud, S.S. Beyond just correlation: Causal machine learning for the microbiome, from prediction to health policy with econometric tools. Front. Microbiol. 2025, 16, 1691503. [Google Scholar] [CrossRef] [PubMed]
  13. Sazal, M.; Mathee, K.; Ruiz-Perez, D.; Cickovski, T.; Narasimhan, G. Inferring directional relationships in microbial communities using signed Bayesian networks. BMC Genom. 2020, 21, 663. [Google Scholar] [CrossRef] [PubMed]
  14. Corander, J.; Hanage, W.P.; Pensar, J. Causal discovery for the microbiome. Lancet Microbe 2022, 3, e881–e887. [Google Scholar] [CrossRef] [PubMed]
  15. Sazal, M.; Stebliankin, V.; Mathee, K.; Yoo, C.; Narasimhan, G. Causal effects in microbiomes using interventional calculus. Sci. Rep. 2021, 11, 5724. [Google Scholar] [CrossRef] [PubMed]
  16. Shimizu, S.; Inazumi, T.; Sogawa, Y.; Hyvarinen, A.; Kawahara, Y.; Washio, T.; Hoyer, P.O.; Bollen, K.; Hoyer, P. DirectLiNGAM: A direct method for learning a linear non-Gaussian structural equation model. J. Mach. Learn. Res.-JMLR 2011, 12, 1225–1248. [Google Scholar]
  17. Shimizu, S. Joint estimation of linear non-Gaussian acyclic models. Neurocomputing 2012, 81, 104–107. [Google Scholar] [CrossRef]
  18. Miyajima, Y.; Karashima, S.; Ogai, K.; Taniguchi, K.; Ogura, K.; Kawakami, M.; Nambo, H.; Kometani, M.; Aono, D.; Demura, M.; et al. Impact of gut microbiome on dyslipidemia in japanese adults: Assessment of the Shika-machi super preventive health examination results for causal inference. Front. Cell. Infect. Microbiol. 2022, 12, 908997. [Google Scholar] [CrossRef] [PubMed]
  19. Koshida, A.; Karashima, S.; Ogura, K.; Miyajima, Y.; Ogai, K.; Mizoguchi, R.; Ikagawa, Y.; Hara, S.; Mizushima, I.; Fujii, H.; et al. Impact of gut microbiome on serum IgG4 levels in the general population: Shika-machi super preventive health examination results. Front. Cell. Infect. Microbiol. 2023, 13, 1272398. [Google Scholar] [CrossRef] [PubMed]
  20. Miyajima, Y.; Karashima, S.; Mizoguchi, R.; Kawakami, M.; Ogura, K.; Ogai, K.; Koshida, A.; Ikagawa, Y.; Ami, Y.; Zhu, Q.; et al. Prediction and causal inference of hyperuricemia using gut microbiota. Sci. Rep. 2024, 14, 9901. [Google Scholar] [CrossRef] [PubMed]
  21. Canonaco, F.; Acerbi, E.; Stella, F. Improving DirectLiNGAM for high-dimensional microbiome data: roots screening and eBIC based model selection. Front. Syst. Biol. 2026, 6, 1835323. [Google Scholar] [CrossRef] [PubMed]
  22. Ma, S.; Tourani, R. Comparing Causal Bayesian Networks Estimated from Data. Entropy 2024, 26, 228. [Google Scholar] [CrossRef] [PubMed]
  23. Lv, B.M.; Quan, Y.; Zhang, H.Y. Causal inference in microbiome medicine: principles and applications. Trends Microbiol. 2021, 29, 736–746. [Google Scholar] [CrossRef] [PubMed]
  24. Luo, M.; Zhu, J.; Jia, J.; Zhang, H.; Zhao, J. Progress on network modeling and analysis of gut microecology: a review. Appl. Environ. Microbiol. 2024, 90, e00092–24. [Google Scholar] [CrossRef] [PubMed]
  25. Shimizu, S.; Hoyer, P.O.; Hyvärinen, A.; Kerminen, A.; Jordan, M. A linear non-Gaussian acyclic model for causal discovery. J. Mach. Learn. Res. 2006, 7. [Google Scholar]
  26. Bollen, K.A. Structural equations with latent variables; John Wiley & Sons, 1989. [Google Scholar]
  27. Pasolli, E.; Schiffer, L.; Manghi, P.; Renson, A.; Obenchain, V.; Truong, D.T.; Beghini, F.; Malik, F.; Ramos, M.; Dowd, J.B.; et al. Accessible, curated metagenomic data through ExperimentHub. Nat. Methods 2017, 14, 1023–1024. [Google Scholar] [CrossRef] [PubMed]
  28. Hillmann, B.; Al-Ghalith, G.A.; Shields-Cutler, R.R.; Zhu, Q.; Gohl, D.M.; Beckman, K.B.; Knight, R.; Knights, D. Evaluating the information content of shallow shotgun metagenomics. Msystems 2018, 3, 10–1128. [Google Scholar] [CrossRef] [PubMed]
  29. Treichel, N.S.; Pauvert, C.; Séneca, J.; Pjevac, P.; Berry, D.; Penders, J.; Hitch, T.C.; Clavel, T. Benchmarking of shotgun sequencing depth reveals the potential and limitations of shallow metagenomics and strain-level analysis. Nat. Microbiol. 2026, 1–12. [Google Scholar] [CrossRef] [PubMed]
  30. Neu, A.T.; Allen, E.E.; Roy, K. Defining and quantifying the core microbiome: challenges and prospects. Proc. Natl. Acad. Sci. 2021, 118, e2104429118. [Google Scholar] [CrossRef] [PubMed]
  31. Bokulich, N.A.; Subramanian, S.; Faith, J.J.; Gevers, D.; Gordon, J.I.; Knight, R.; Mills, D.A.; Caporaso, J.G. Quality-filtering vastly improves diversity estimates from Illumina amplicon sequencing. Nat. Methods 2013, 10, 57–59. [Google Scholar] [CrossRef] [PubMed]
  32. Ma, S.; Shungin, D.; Mallick, H.; Schirmer, M.; Nguyen, L.H.; Kolde, R.; Franzosa, E.; Vlamakis, H.; Xavier, R.; Huttenhower, C. Population structure discovery in meta-analyzed microbial communities and inflammatory bowel disease using MMUPHin. Genome Biol. 2022, 23, 208. [Google Scholar] [CrossRef] [PubMed]
  33. Aitchison, J. The statistical analysis of compositional data. J. R. Stat. Soc. Ser. B (Methodological) 1982, 44, 139–160. [Google Scholar] [CrossRef]
  34. 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]
  35. Hron, K.; Filzmoser, P.; Thompson, K. Linear regression with compositional explanatory variables. J. Appl. Stat. 2012, 39, 1115–1128. [Google Scholar] [CrossRef]
  36. Faust, K. Open challenges for microbial network construction and analysis. ISME J. 2021, 15, 3111–3118. [Google Scholar] [CrossRef] [PubMed]
  37. Coyte, K.Z.; Schluter, J.; Foster, K.R. The ecology of the microbiome: networks, competition, and stability. Science 2015, 350, 663–666. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Mean AUPR (with 95% CI band) for detecting perturbed-mechanism nodes as a function of sample size, for the Naive and Bootstrap estimators under equal sample sizes ( N 1 = N 2 ), faceted by edge density. Shown for the 15-node network-size condition (see Table 2 for the 20 and 25-node aggregate numbers, and Figures S1 and S4 in the Supplementary Materials for the corresponding 20- and 25-node charts).
Figure 1. Mean AUPR (with 95% CI band) for detecting perturbed-mechanism nodes as a function of sample size, for the Naive and Bootstrap estimators under equal sample sizes ( N 1 = N 2 ), faceted by edge density. Shown for the 15-node network-size condition (see Table 2 for the 20 and 25-node aggregate numbers, and Figures S1 and S4 in the Supplementary Materials for the corresponding 20- and 25-node charts).
Preprints 231327 g001
Figure 2. Mean AUPR as the percentage of perturbed nodes increases, by edge density, for Naive and Bootstrap under equal sample sizes. 15-node network-size condition.
Figure 2. Mean AUPR as the percentage of perturbed nodes increases, by edge density, for Naive and Bootstrap under equal sample sizes. 15-node network-size condition.
Preprints 231327 g002
Figure 3. Precision and recall as a function of the number of parents swapped per perturbed node ( n pos ), for Naive and Bootstrap, at the highest edge density tested ( p e = 0.25 ). 15-node network-size condition.
Figure 3. Precision and recall as a function of the number of parents swapped per perturbed node ( n pos ), for Naive and Bootstrap, at the highest edge density tested ( p e = 0.25 ). 15-node network-size condition.
Preprints 231327 g003
Figure 4. Mean AUPR (95% CI band) against the primary sample size N 1 , marginalized over N 2 ∈ { 100 , 200 , 400 } , for Naive, Bootstrap, and RSBS under heterogeneous sample sizes, faceted by edge density. 15-node network-size condition (see Table 2 for the 20 and 25-node aggregate numbers, and Figures S7 and S10 in the Supplementary Materials for the corresponding 20- and 25-node charts).
Figure 4. Mean AUPR (95% CI band) against the primary sample size N 1 , marginalized over N 2 ∈ { 100 , 200 , 400 } , for Naive, Bootstrap, and RSBS under heterogeneous sample sizes, faceted by edge density. 15-node network-size condition (see Table 2 for the 20 and 25-node aggregate numbers, and Figures S7 and S10 in the Supplementary Materials for the corresponding 20- and 25-node charts).
Preprints 231327 g004
Figure 5. Mean AUPR as the percentage of perturbed nodes increases, by edge density, for Naive, Bootstrap, and RSBS under heterogeneous sample sizes. 15-node network-size condition.
Figure 5. Mean AUPR as the percentage of perturbed nodes increases, by edge density, for Naive, Bootstrap, and RSBS under heterogeneous sample sizes. 15-node network-size condition.
Preprints 231327 g005
Figure 6. Precision and recall as a function of the number of parents swapped per perturbed node ( n pos ), for Naive, Bootstrap, and RSBS under heterogeneous sample sizes, at the highest edge density tested ( p e = 0.25 ). 15-node network-size condition.
Figure 6. Precision and recall as a function of the number of parents swapped per perturbed node ( n pos ), for Naive, Bootstrap, and RSBS under heterogeneous sample sizes, at the highest edge density tested ( p e = 0.25 ). 15-node network-size condition.
Preprints 231327 g006
Figure 7. Mean AUPR (with 95% CI band) against node count p for the real microbiome cohort, faceted by perturbation intensity n pos .
Figure 7. Mean AUPR (with 95% CI band) against node count p for the real microbiome cohort, faceted by perturbation intensity n pos .
Preprints 231327 g007
Figure 8. Mean AUPR as the percentage of perturbed nodes increases, faceted by node count p, for Naive, Bootstrap, and RSBS on the real microbiome cohort.
Figure 8. Mean AUPR as the percentage of perturbed nodes increases, faceted by node count p, for Naive, Bootstrap, and RSBS on the real microbiome cohort.
Preprints 231327 g008
Figure 9. Precision and recall as a function of the number of parents swapped per perturbed node ( n pos ), for Naive, Bootstrap, and RSBS on the real microbiome cohort, pooled over p ∈ { 15 , 20 , 23 } .
Figure 9. Precision and recall as a function of the number of parents swapped per perturbed node ( n pos ), for Naive, Bootstrap, and RSBS on the real microbiome cohort, pooled over p ∈ { 15 , 20 , 23 } .
Preprints 231327 g009
Table 1. Overall performance under equal sample sizes ( N 1 = N 2 ), mean ± SD over 4 , 950 runs per method.
Table 1. Overall performance under equal sample sizes ( N 1 = N 2 ), mean ± SD over 4 , 950 runs per method.
Method AUCROC AUPR F 1 Precision Recall
Naive 0.894 ± 0.142 0.687 ± 0.296 0.760 ± 0.233 0.699 ± 0.291 0.945±0.153
Bootstrap 0.941 ± 0.103 0.825 ± 0.244 0.853 ± 0.193 0.837 ± 0.237 0.926 ± 0.164
Table 2. Effect of network size on mean AUCROC / AUPR (SD omitted for brevity).
Table 2. Effect of network size on mean AUCROC / AUPR (SD omitted for brevity).
Experiment Method 15 nodes 20 nodes 25 nodes
Equal ( N 1 = N 2 ) Naive 0.946 / 0.834 0.895 / 0.687 0.839 / 0.538
Bootstrap 0.976 / 0.938 0.941 / 0.831 0.903 / 0.706
Heterogeneous Naive 0.965 / 0.889 0.931 / 0.764 0.885 / 0.636
Bootstrap 0.965 / 0.916 0.911 / 0.764 0.843 / 0.602
RSBS 0.978 / 0.943 0.943 / 0.838 0.900 / 0.707
Note: Bold values indicate the best performance for each metric. 
Table 3. Overall performance under heterogeneous sample sizes ( N 1 ≠ N 2 ), mean ± SD over 9 , 900 runs per method.
Table 3. Overall performance under heterogeneous sample sizes ( N 1 ≠ N 2 ), mean ± SD over 9 , 900 runs per method.
Method AUCROC AUPR F 1 Precision Recall
Naive 0.927 ± 0.117 0.764 ± 0.278 0.824 ± 0.214 0.772 ± 0.272 0.966 ± 0.122
Bootstrap 0.907 ± 0.133 0.761 ± 0.288 0.802 ± 0.230 0.786 ± 0.280 0.904 ± 0.188
RSBS 0.941 ± 0.105 0.829 ± 0.246 0.857 ± 0.196 0.844 ± 0.238 0.927 ± 0.165
  Note: Bold values indicate the best performance for each metric.
Table 4. Mean AUCROC / AUPR by sample size ratio r = N 2 / N 1 in the heterogeneous experiment.
Table 4. Mean AUCROC / AUPR by sample size ratio r = N 2 / N 1 in the heterogeneous experiment.
Method r = 0.125 r = 0.25 r = 0.5 r = 1.0
Naive 0.837 / 0.553 0.900 / 0.694 0.973 / 0.869 0.981 / 0.902
Bootstrap 0.808 / 0.550 0.862 / 0.654 0.958 / 0.868 0.995 / 0.972
RSBS 0.858 / 0.629 0.913 / 0.758 0.983 / 0.930 0.995 / 0.972
Note: Bold values indicate the best performance for each metric.
Table 5. Paired comparison at the most imbalanced ratio evaluated ( N 1 = 800 , N 2 = 100 , n = 1 , 650 paired runs). Mean difference (row method − column method), paired t-statistic and p-value.
Table 5. Paired comparison at the most imbalanced ratio evaluated ( N 1 = 800 , N 2 = 100 , n = 1 , 650 paired runs). Mean difference (row method − column method), paired t-statistic and p-value.
Comparison Δ AUCROC Δ AUPR Δ F 1
RSBS − Naive + 0.020 ( t = 5.2 , p < 10 − 6 ) + 0.076 ( t = 10.9 , p < 10 − 16 ) + 0.040 ( t = 7.4 , p ≈ 1.3 × 10 − 13 )
RSBS − Bootstrap + 0.050 ( t = 12.1 , p < 10 − 16 ) + 0.079 ( t = 11.1 , p < 10 − 16 ) + 0.066 ( t = 12.1 , p < 10 − 16 )
Bootstrap − Naive − 0.029 ( t = − 8.5 , p < 10 − 16 ) − 0.003 ( t = − 0.5 , p = 0.61 , n.s.) − 0.026 ( t = − 5.4 , p < 10 − 7 )
Table 6. Overall performance in the microbiome-derived semi-synthetic benchmark, mean ± SD over 180 runs per method per row, split by perturbation intensity n pos (parent edges swapped per perturbed node), pooled over p ∈ { 15 , 20 , 23 } and n pert ∈ { 2 , 3 , 4 } .
Table 6. Overall performance in the microbiome-derived semi-synthetic benchmark, mean ± SD over 180 runs per method per row, split by perturbation intensity n pos (parent edges swapped per perturbed node), pooled over p ∈ { 15 , 20 , 23 } and n pert ∈ { 2 , 3 , 4 } .
n pos Method AUCROC AUPR F 1 Precision Recall
2 Naive 0.552 ± 0.181 0.282 ± 0.160 0.405 ± 0.136 0.341 ± 0.235 0.795 ± 0.242
Bootstrap 0.572 ± 0.179 0.318 ± 0.192 0.437 ± 0.151 0.399 ± 0.275 0.771 ± 0.255
RSBS 0.583 ± 0.181 0.333 ± 0.184 0.451 ± 0.153 0.413 ± 0.267 0.754 ± 0.244
4 Naive 0.612 ± 0.159 0.304 ± 0.154 0.428 ± 0.131 0.368 ± 0.225 0.768 ± 0.246
Bootstrap 0.655 ± 0.163 0.376 ± 0.197 0.496 ± 0.154 0.460 ± 0.274 0.767 ± 0.229
RSBS 0.642 ± 0.181 0.376 ± 0.203 0.489 ± 0.161 0.457 ± 0.274 0.757 ± 0.242
Note: Bold values indicate the best performance for each metric within each npos block.
Table 7. Paired comparison at the hardest condition tested ( p = 23 , n pos = 4 , n = 60 paired repeats). Mean difference (row method − column method), paired t-statistic, and p-value.
Table 7. Paired comparison at the hardest condition tested ( p = 23 , n pos = 4 , n = 60 paired repeats). Mean difference (row method − column method), paired t-statistic, and p-value.
Comparison Δ AUCROC Δ AUPR Δ F 1
RSBS − Naive + 0.026 ( t = 0.89 , p = 0.372 , n.s.) + 0.074 ( t = 2.75 , p = 5.9 × 10 − 3 ) + 0.061 ( t = 2.78 , p = 5.5 × 10 − 3 )
RSBS − Bootstrap + 0.024 ( t = 1.09 , p = 0.275 , n.s.) + 0.050 ( t = 1.94 , p = 0.053 , marg.) + 0.020 ( t = 1.00 , p = 0.315 , n.s.)
Bootstrap − Naive + 0.002 ( t = 0.09 , p = 0.930 , n.s.) + 0.024 ( t = 1.32 , p = 0.186 , n.s.) + 0.041 ( t = 2.32 , p = 0.021 )
Note: n.s. = not significant at α = 0.05; marg. = marginal.
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.