Abstract
Mapping the ecological networks of microbial communities is a necessary step toward understanding their assembly rules and predicting their temporal behavior. However, existing methods require assuming a particular population dynamics model, which is not known a priori. Moreover, those methods require fitting longitudinal abundance data, which are often not informative enough for reliable inference. To overcome these limitations, here we develop a new method based on steadystate abundance data. Our method can infer the network topology and intertaxa interaction types without assuming any particular population dynamics model. Additionally, when the population dynamics is assumed to follow the classic Generalized Lotka–Volterra model, our method can infer the intertaxa interaction strengths and intrinsic growth rates. We systematically validate our method using simulated data, and then apply it to four experimental data sets. Our method represents a key step towards reliable modeling of complex, realworld microbial communities, such as the human gut microbiota.
Introduction
The microbial communities established in animals, plants, soils, oceans, and virtually every ecological niche on Earth perform vital functions for maintaining the health of the associated ecosystems^{1,2,3,4,5}. Recently, our knowledge of the organismal composition and metabolic functions of diverse microbial communities has markedly increased, due to advances in DNA sequencing and metagenomics^{6}. However, our understanding of the underlying ecological networks of these diverse microbial communities lagged behind^{7}. Mapping the structure of those ecological networks and developing ecosystemwide dynamic models will be important for a variety of applications^{8}, from predicting the outcome of community alterations and the effects of perturbations^{9}, to the engineering of complex microbial communities^{7,10}. We emphasize that the ecological network discussed here is a directed, signed, and weighted graph, where nodes represent microbial taxa and edges represent direct ecological interactions (e.g., parasitism, commensalism, mutualism, amensalism, or competition) between different taxa. This is fundamentally different from the correlationbased association or cooccurrence network^{7,11,12,13}, which is undirected and does not encode any causal relations or direct ecological interactions, and hence cannot be used to faithfully predict the dynamic behavior of microbial communities.
To date, existing methods for inferring the ecological networks of microbial communities are based on temporal abundance data, i.e., the abundance timeseries of each taxon in the microbial community^{14,15,16,17,18,19}. The success of those methods has been impaired by at least one of the following two fundamental limitations. First, those inference methods typically require the a priori choice of a parameterized population dynamics model for the microbial community. This choice is hard to justify, given that microbial taxa in the microbial community interact via a multitude of different mechanisms^{7,20,21,22}, producing complex dynamics even at the scale of two taxa^{23,24}. Any deviation of the chosen model from the ‘true’ model of the microbial community can lead to systematic inference errors, regardless of the inference method that is used^{19}. Second, a successful temporal databased inference requires sufficiently informative timeseries data^{19,25}. For many hostassociated microbial communities, such as the human gut microbiota, the available temporal data are often poorly informative. This is due to the fact that such microbial communities often display stability and resilience^{26,27}, which leads to measurements containing largely their steadystate behavior. For microbial communities such as the human gut microbiota, trying to improve the informativeness of temporal data is challenging and even ethically questionable, as it requires applying drastic and frequent perturbations to the microbial community, with unknown effects on the host.
To circumvent the above fundamental limitations of inference methods based on temporal data, here we developed a new method based on steadystate data, which does not require any external perturbations. The basic idea is as follows. Briefly, if we assume that the net ecological impact of species on each other is contextindependent, then comparing equilibria (i.e., steadystate samples) consisting of different subsets of species would allow us to infer the interaction types. For example, if one steadystate sample differs from another only by addition of one species X, and adding X brings down the absolute abundance of species Y, then we can conclude X inhibits the growth of Y. This very simple idea can actually be extended to more complicated cases where steadystate samples differ from each other by more than one species. Indeed, we rigorously proved that, if we collect enough independent steady states of the microbial community, it is possible to infer the microbial interaction types (positive, negative, and neutral interactions) and the structure of the ecological network, without requiring any population dynamics model. We further derived a rigorous criterion to check if the steadystate data from a microbial community is consistent with the generalized Lotka–Volterra (GLV) model^{15,16,17,18,19}, a classic population dynamics model for microbial communities in human bodies, soils, and lakes. We proved that, if the microbial community follows the GLV dynamics, then the steadystate data can be used to accurately infer the model parameters, i.e., intertaxa interaction strengths and intrinsic growth rates. We validated our inference method using simulated data generated from various classic population dynamics models. Finally, we applied it to real data collected from four different synthetic microbial communities, finding that the inferred ecological networks either agree well with the ground truth or help us predict the response of systems to perturbations. Our method represents a key step toward reliable ecological modeling of complex microbial communities, such as the human gut microbiota.
Results
Theoretical basis
Microbes typically do not exist in isolation, but form complex ecological networks^{7}. The ecological network of a microbial community is encoded in its population dynamics, which can be described by a set of ordinary differential equations (ODEs):
Here, \(f_i({\boldsymbol{x}}(t))\)’s are some unspecified functions whose functional forms determine the structure of the underlying ecological network; \({\boldsymbol{x}}(t) = \left( {x_1(t), \ldots ,x_N(t)} \right)^{\mathrm{T}} \in {\Bbb R}^N\) is an Ndimensional vector with \(x_i\left( t \right)\) denoting the absolute abundance of the ith taxon at time t. In this work, we do not require ‘taxon’ to have a particular taxonomic ranking, as long as the resulting abundance profiles are distinct enough across all the collected samples. Indeed, we can group microbes by species, genus, family, or just operational taxonomic units (OTUs).
Note that in the righthand side of Eq. (1), we explicitly factor out x _{ i } to emphasize that (i) without external perturbations those initially absent or later extinct taxa will never be present in the microbial community again as time goes by, which is a natural feature of population dynamics (in the absence of taxon invasion or migration); (ii) there is a trivial steady state where all taxa are absent; (iii) there are many nontrivial steady states with different taxa collections. We assume that the steadystate samples collected in a data set \({\cal X}\) correspond to those nontrivial steady states \({\boldsymbol{x}}^{\ast}\) of Eq. (1), which satisfy \(x_i^*f_i\left( {x_1^*, \ldots ,x_N^*} \right) = 0\), \(i = 1, \ldots ,N\). For many hostassociated microbial communities, e.g., the human gut microbiota, those crosssectional samples collected from different individuals contain quite different collections of taxa (up to the taxonomic level of phylum binned from OTUs)^{26}. We will show later that the number of independent steadystate samples is crucial for inferring the ecological network.
Mathematically, the intra and intertaxa ecological interactions (i.e., promotion, inhibition, or neutral) are encoded by the Jacobian matrix \(J\left( {{\boldsymbol{x}}(t)} \right) \in {\Bbb R}^{N \times N}\) with matrix elements \(J_{ij}({\boldsymbol{x}}(t)) \equiv \partial f_i({\boldsymbol{x}}(t))/\partial x_j\). The condition \(J_{ij}({\boldsymbol{x}}(t)) > 0\) (<0 or =0) means that taxon j promotes (inhibits or does not affect) the growth of taxon i, respectively. The diagonal terms \(J_{ii}({\boldsymbol{x}}(t))\) represent intrataxa interactions. Note that \(J_{ij}({\boldsymbol{x}}(t))\) might depend on the abundance of many other taxa beyond i and j (due to the socalled ‘higherorder’ interactions^{24,28,29,30,31,32}).
The structure of the ecological network is represented by the zeropattern of \(J\left( {{\boldsymbol{x}}(t)} \right)\). Under a very mild assumption that \({\int}_0^1 {J_{ij}\left( {{\boldsymbol{x}}^{\boldsymbol{I}} + \sigma \left( {{\boldsymbol{x}}^{\boldsymbol{K}}  {\boldsymbol{x}}^{\boldsymbol{I}}} \right)} \right){\mathrm{d}}\sigma = 0}\) holds if and only if \(J_{ij} \equiv 0\) (where x ^{I} and x ^{K} are two steadystate samples sharing taxon i), we find that the steadystate samples can be used to infer the zeropattern of \(J\left( {{\boldsymbol{x}}(t)} \right)\), i.e., the structure of the ecological network (Methods, the subsection ‘Inferring the zeropattern’ of Supplementary Note 1, Supplementary Note 2, and Supplementary Note 3 for details). Note that the network structure is interesting by itself and can be very useful in control theoretical analysis of microbial communities^{33}. But in many cases, we are more interested in inferring the interaction types or strengths, so that we can better predict the community’s response to perturbations.
The ecological interaction types are encoded in the signpattern of \(J\left( {{\boldsymbol{x}}(t)} \right)\), denoted as \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right)\). To infer the interaction types, i.e., \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right)\), we make an explicit assumption that \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right) = {\mathrm{const}}\) across all the observed steadystate samples. In other words, the nature of the ecological interactions between any two taxa does not vary across all the observed steadystate samples, though their interaction strengths might change. Note that the magnitude of \(J_{ij}({\boldsymbol{x}}(t))\) by definition may vary over different states, we just assume its sign remains invariant across all the observed samples/states. This assumption might be violated if those steadystate samples were collected from the microbial community under drastically different environmental conditions (e.g., nutrient availability^{34}). In that case, inferring the interaction types becomes an illdefined problem, since we have a ‘moving target’ and different subsets of steadystate samples may offer totally different answers. Notably, as we will show later, the assumption is valid for many classic population dynamics models^{35,36,37,38,39}.
The assumption that \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right) = {\mathrm{const}}\) can be falsified by analyzing steadystate samples. In Proposition 1 of the subsection ‘Inferring the signpattern’ of Supplementary Note 1, we rigorously proved that if \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right) = {\mathrm{const}}\), then true multistability does not exist. Equivalently, if a microbial community displays true multistability, then \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right) \ne {\mathrm{const}}\). Here, a community of N taxa displays true multistability if there exists a subset of M (\(\le N\)) taxa that has multiple different steady states, where all the M taxa have positive abundances and the other \((N  M)\) taxa are absent. In practice, we can detect the presence of true multistability by examining the collected steadystate samples. If yes, then we know immediately that our assumption that \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right) = {\mathrm{const}}\) is invalid and we should only infer the zeropattern of J, i.e., the structure of the ecological network. If no, then at least our assumption is consistent with the collected steadystate samples, and we can use our method to infer \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right)\), i.e., the ecological interaction types. In short, by introducing a criterion to falsify our assumption, we significantly enhance the applicability of our method (see Remark 6 of the subsection ‘Inferring the signpattern’ of Supplementary Note 1 for more detailed discussions).
Inferring interaction types
The assumption that \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right) = {\mathrm{const}}\) enables us to mathematically prove that \({\mathrm{sign}}\left( {J({\boldsymbol{x}}(t))} \right)\) satisfies a strong constraint (see Methods and Theorem 2 in the subsection ‘Inferring the signpattern’ of Supplementary Note 1). By collecting enough independent steadystate samples, we can solve for the signpattern of \(J\left( {\boldsymbol{x}} \right)\), and hence map the structure of the ecological network (Remarks 4 and 5 in the subsection ‘Inferring the signpattern’ of Supplementary Note 1).
The basic idea is as follows. Let \({\cal I}_i\) be the set of all steadystate samples sharing taxon i. Then, for any two of those samples x ^{I} and x ^{K}, where the superscripts \(I,K \in {\cal I}_i\) denote the collections of present taxa in those samples, we can prove that the signpattern of the ith row of Jacobian matrix, denoted as a ternary vector \({\boldsymbol{s}}_i \in \{  ,0, + \} ^N\), is orthogonal to \(({\boldsymbol{x}}^I  {\boldsymbol{x}}^K)\) (see Eq. (S3) in Supplementary Note 1). In other words, we can always find a realvalued vector \({\boldsymbol{y}} \in {\Bbb R}^N\), which has the same signpattern as s _{ i } and satisfies \({\boldsymbol{y}}^{\top} \cdot \left( {{\boldsymbol{x}}^I  {\boldsymbol{x}}^K} \right) = 0.\) If we compute the signpatterns of all vectors orthogonal to \(\left( {{\boldsymbol{x}}^I  {\boldsymbol{x}}^K} \right)\) for all \(I,K \in {\cal I}_i\), then s _{ i } must belong to the intersections of those signpatterns, denoted as \(\hat {\cal S}_i\). In fact, as long as the number Ω of steadystate samples in \({\cal X}\) is above certain threshold Ω^{*}, then \(\hat {\cal S}_i\) will contain only three signpatterns \(\{  {\boldsymbol{a}},\boldsymbol{0},{\boldsymbol{a}}\}\) (see Remark 5 in the subsection ‘Inferring the signpattern’ of Supplementary Note 1). To decide which of these three remaining signpatterns is the true one, we just need to know the sign of only one nonzero interaction. If such prior knowledge is unavailable, one can at least make a reasonable assumption that s _{ ii }= ‘−’, i.e., the intrataxa interaction J _{ ii } is negative (which is often required for community stability). When \(\hat {\cal S}_i\) has more than three signpatterns, we proved that the steadystate data is not informative enough in the sense that all signpatterns in \(\hat {\cal S}_i\) are consistent with the data available in \({\cal X}\) (see Remark 5 in the subsection ‘Inferring the signpattern’ of Supplementary Note 1). This situation is not a limitation of any inference algorithm, but of the data itself. To uniquely determine the signpattern in such a situation, one has to either collect more samples (thus increasing the informativeness of \({\cal X}\)) or use a priori knowledge of nonzero interactions.
We illustrate the application of the above described method to small microbial communities with unspecified population dynamics (Fig. 1). For the two taxa community (Fig. 1a), there are three possible types of equilibria, i.e., \(\{ {\boldsymbol{x}}^{\{ 1\} },{\boldsymbol{x}}^{\{ 2\} },{\boldsymbol{x}}^{\{ 1,2\} }\}\), depicted as colored pie charts in Fig. 1b. In order to infer \({\boldsymbol{s}}_1 = ({\mathrm{sign}}(J_{11}),{\mathrm{sign}}(J_{12}))\), we compute a straight line (shown in green in Fig. 1b) that is orthogonal to the vector \(({\boldsymbol{x}}^{\left\{ {1,2} \right\}}  {\boldsymbol{x}}^{\{ 1\} })\) and passes through the origin. The regions (including the origin and two quadrants) crossed by this green line provide the set of possible signpatterns \(\hat {\cal S}_1 = \{ \left( {  , + } \right),\left( {0,0} \right),\left( { + ,  } \right)\}\) that s _{1} may belong to. A priori knowing that \(J_{11} < \, 0\), our method correctly concludes that \({\boldsymbol{s}}_1 = (  , + )\). Note that \(J_{12} >\, 0\) is consistent with the observation that with the presence of taxon 2, the steadystate abundance of taxon 1 increases (Fig. 1b), i.e., taxon 2 promotes the growth of taxon 1. We can apply the same method to infer the signpattern of \({\boldsymbol{s}}_2 = (  ,  )\).
For the three taxa community (Fig. 1c), there are seven possible types of equilibria (steadystate samples), i.e., \(\{ {\boldsymbol{x}}^{\left\{ 1 \right\}},{\boldsymbol{x}}^{\{ 2\} },{\boldsymbol{x}}^{\left\{ 3 \right\}},{\boldsymbol{x}}^{\left\{ {1,2} \right\}},{\boldsymbol{x}}^{\left\{ {1,3} \right\}},{\boldsymbol{x}}^{\left\{ {2,3} \right\}},{\boldsymbol{x}}^{\{ 1,2,3\} }\}\). Four of them share taxon 1 (see colored pie charts in Fig. 1d). Six line segments connect the \(\left( {\begin{array}{*{20}{c}} 4 \\ 2 \end{array}} \right) = 6\) sample pairs, and represent vectors of the form \(\left( {{\boldsymbol{x}}^I  {\boldsymbol{x}}^K} \right),I,K \in {\cal I}_1\)={{1},{1,2},{1,3},{1,2,3}}. Considering the line segment \(({\boldsymbol{x}}^{\left\{ {1,3} \right\}}  {\boldsymbol{x}}^{\left\{ 1 \right\}})\), i.e., the solid blue line in Fig. 1d, we compute a plane (shown in orange in Fig. 1d) that is orthogonal to it and passes through the origin. The regions (including the origin and eight orthants) crossed by this orange plane provide a set of possible signpatterns that s _{1} may belong to (Fig. 1d). We repeat the same procedure for all other vectors \(({\boldsymbol{x}}^I  {\boldsymbol{x}}^K),I,K \in {\cal I}_1\), and compute the intersection of all the possible signpatterns, finally yielding the minimum set \(\hat {\cal S}_1 = \{ \left( {  ,0, + } \right),\left( {0,0,0} \right),\left( { + ,0,  } \right)\}\) to which s _{1} may belong to. If the sign of one nonzero interaction is known (\(J_{11} < 0\) for this example), our method correctly infers the true signpattern \({\boldsymbol{s}}_1 = \left( {  ,0, + } \right)\). Repeating this process for samples sharing taxon 2 (or 3) will enable us to infer the signpattern s _{2} (or s _{3}), respectively.
It is straightforward to generalize the above method to a microbial community of N taxa (see Methods and the subsection ‘Bruteforce algorithm’ of Supplementary Note 2 for details). But this bruteforce method requires us to calculate all the signpattern candidates first, and then calculate their intersection to determine the minimum set \(\hat {\cal S}_i\) that s _{ i } will belong to. Since the solution space of signpatterns is of size 3^{N}, the time complexity of this bruteforce method is exponential with N, making it impractical for a microbial community with \(N > 10\) taxa (Methods). To resolve this issue, we developed a heuristic algorithm that precalculates many intersection lines of \(\left( {N  1} \right)\) nonparallel hyperplanes that pass through the origin and are orthogonal to \(\left( {{\boldsymbol{x}}^I  {\boldsymbol{x}}^K} \right),I,K \in {\cal I}_i\). Based on these precalculated intersection lines, the algorithm determines \(\hat {\cal S}_i\) using the most probable intersection line. The solution space of this heuristic algorithm is determined by the userdefined number of precalculated interaction lines (denoted as Ψ). Hence this algorithm naturally avoids searching the exponentially large solution space (see Methods and the subsection ‘Inference using the heuristic algorithm’ of Supplementary Note 2 for details). Later on, we will show that this heuristic algorithm can indeed infer the interaction types with high accuracy.
In reality, due to measurement noise and/or transient behavior of the microbial community, the abundance profiles of the collected samples may not exactly represent steady states of the microbial community. Hence, for certain J _{ ij }’s, their inferred signs might be wrong. Using simulated data, we will show later that for considerable noise level the inference accuracy is still reasonably high.
Inferring interaction strengths
To quantitatively infer the intertaxa interaction strengths, it is necessary to choose a priori a parameterized dynamic model for the microbial community. The classical GLV model can be obtained from Eq. (1) by choosing
where \(\boldsymbol r = \left( {r_1, \ldots ,r_N} \right)^{\mathrm{T}} \in {\Bbb R}^N\) is the intrinsic growth rate vector and \(A = \left( {a_{ij}} \right) \in {\Bbb R}^{N \times N}\) is the interaction matrix characterizing the intra and intertaxa interactions.
From Eq. (2) we can easily calculate the Jacobian matrix J, which is nothing but the interaction matrix A itself. This also reflects the fact that the value of a _{ ij } quantifies the interaction strength of taxon j on taxon i. The GLV model considerably simplifies the inference of the ecological network, because we can prove that \({\boldsymbol{a}}_i \cdot \left( {{\boldsymbol{x}}^I  {\boldsymbol{x}}^K} \right) = 0\), for all \(I,K \in {\cal I}_i\), where \({\boldsymbol{a}}_i \equiv \left( {a_{i1}, \ldots ,a_{iN}} \right)\) represents the ith row of the A matrix (see the subsection ‘Inference of interaction strengths and intrinsic growth rates’ of Supplementary Note 5). In other words, all steadystate samples containing the ith taxon will align exactly onto a hyperplane, whose orthogonal vector is parallel to the vector a _{ i } that we aim to infer (Fig. 2a, Theorem 3 of the subsection ‘A condition for detecting GLV dynamics’ of Supplementary Note 5). Thus, for the GLV model, the inference from steadystate data reduces to finding an \((N  1)\)dimensional hyperplane that ‘best fits’ the steadystate sample points \(\{ {\boldsymbol{x}}^II \in {\cal I}_i\}\) in the Ndimensional state space. In order to exactly infer a _{ i }, it is necessary to know the value of at least one nonzero element in a _{ i }, say, a _{ ii }. Otherwise, we can just determine the relative interaction strengths by expressing a _{ ij } in terms of a _{ ii }. Once we obtain a _{ i }, the intrinsic growth rate r _{ i } of the ith taxon can be calculated by averaging \((  {\boldsymbol{a}}_i \cdot {\boldsymbol{x}}^I)\) overall \(I \in {\cal I}_{i}\), i.e., all the steadystate samples containing taxon i.
In case the samples are not collected exactly at steady states of the microbial community or there is noise in abundance measurements, those samples containing taxon i will not exactly align onto a hyperplane. A naive solution is to find a hyperplane that minimizes its distance to those noisy samples. But this solution is prone to induce falsepositive errors and will yield nonsparse solutions (corresponding to very dense ecological networks). This issue can be partly alleviated by introducing a Lasso regularization^{40}, implicitly assuming that the interaction matrix A in the GLV model is sparse. However, the classical Lasso regularization may induce a high falsediscovery rate (FDR), meaning that many zero interactions are inferred as nonzeros ones. To overcome this drawback, we applied the Knockoff filter^{41} procedure, allowing us to control the FDR below a desired userdefined level \(q > 0\) (see the subsection ‘Applying the Knockoff filter to control the falsediscovery rate’ of Supplementary Note 5 for details).
The observation that for the GLV model all noiseless steadystate samples containing the ith taxon align exactly onto a hyperplane can also be used to characterize how much the dynamics of the ith taxon in a real microbial community deviates from the GLV model. This deviation can be quantified by the coefficient of determination (denoted by R ^{2}) of the multiple linear regression when fitting the hyperplane using the steadystate samples (Fig. 2b). If R ^{2} is close to 1 (the samples indeed align to a hyperplane), we conclude that the dynamics of the microbial community is consistent with the GLV model, and hence the inferred interaction strengths and intrinsic growth rates are reasonable. Otherwise, we should only aim to qualitatively infer the ecological interaction types that do not require specifying any population dynamics.
Validation on simulated data
To validate the efficacy of our method in inferring ecological interaction types, we numerically calculated the steady states of a small microbial community with \(N = 8\) taxa, using four different population dynamics models^{35,36,37,38,39}: GLV, Holling Type II (Holling II), DeAngelis–Beddington (DB), and Crowley–Martin (CM) models (see Supplementary Note 4 for details). Note that all these models satisfy the requirement that the signpattern of the Jacobian matrix is timeinvariant. To infer the ecological interaction types among the eight taxa, we employed both the bruteforce algorithm (with solution space ~\(3^8 = 6,561\)) and the heuristic algorithm (with solution space given by the number of the precalculated intersections chosen as \({\mathrm{\Psi }} = 5N = 40\)).
In the noiseless case, we find that when the number of steadystate samples satisfies \({\mathrm{\Omega }} > 3N\), the heuristic algorithm outperformed the bruteforce algorithm for data sets generated from all the four different population dynamics models (Fig. 3a). This result is partly due to the fact that the former requires many fewer samples than the latter to reach high accuracy (the percentage of correctly inferred interaction types). However, when the sample size Ω is small (\(< 3N\)), the heuristic algorithm completely fails while the bruteforce algorithm still works to some extent.
We then fix \({\mathrm{\Omega }} = 5N\), and compare the performance of the bruteforce and heuristic algorithms in the presence of measurement noise (Fig. 3b). We add artificial noise to each nonzero entry \(x_i^I\) of a steadystate sample x ^{I} by replacing \(x_i^I\) with \(x_i^I + \eta u\), where \(u\sim U[  x_i^I,x_i^I]\) is a random number uniformly distributed in the interval \([  x_i^I,x_i^I]\) and \(\eta \ge 0\) quantifies the noise level. We again find that the heuristic algorithm works better than the bruteforce algorithm for data sets generated from all the four different population dynamics models.
The above encouraging results on the heuristic algorithm prompt us to systematically study the key factor to obtain an accurate inference, i.e., the minimal sample size \(\Omega ^ *\) (Fig. 3c, d). Note that for a microbial community of N taxa, if we assume that for any subset of the N taxa there is only one stable steady state such that all the corresponding taxa have nonzero abundance, then there are at most \({\mathrm{\Omega }}_{{\mathrm{max}}} = (2^N  1)\) possible steadystate samples. (Of course, not all of them will be ecologically feasible. For example, certain pairs of taxa will never coexist.) In general, it is unnecessary to collect all possible steadystate samples to obtain a highly accurate inference result. Instead, we can rely on a subset of them. To demonstrate this, we numerically calculated the minimal sample size \(\Omega ^ *\) we need to achieve a highly accurate inference of interaction types. We considered two different taxa presence patterns: (1) uniform: all taxa have equal probability of being present in the steadystate samples (inset of Figs. 3c); and (2) heterogenous: a few taxa have higher presence probability than others, reminiscent of human gut microbiome samples^{26} (inset of Fig. 3d). We found that for the steadystate data generated from all the four population dynamics models, \(\Omega ^ *\) always scales linearly with N in both taxa presence patterns, and the uniform taxa presence pattern requires much fewer samples (Fig. 3c, d).
Note that as N grows, the total possible steadystate samples Ω_{max} increases exponentially, while the minimal sample size \(\Omega ^ *\) we need for high inference accuracy increase linearly. Hence, interestingly, we have \({\mathrm{\Omega }}^{\mathrm{*}}/{\mathrm{\Omega }}_{{\mathrm{max}}} \to 0\) as N increases. This suggests that as the number of taxa increases, the proportion of samples needed for accurate inference actually decreases. This is a rather counterintuitive result because, instead of a ‘curse of dimensionality’, it suggests that a ‘blessing of dimensionality’ exists when using the heuristic algorithm to infer interaction types for microbial communities with a large number of taxa.
To validate our method in quantitatively inferring intertaxa interaction strengths, we numerically calculated steady states for a microbial community of \(N = 50\) taxa, using the GLV model with \(a_{ii} =  1\) for all taxa.
In the noiseless case, if during the inference we know exactly \(a_{ii} =  1\) for all taxa, then we can perfectly infer the intertaxa interaction strengths a _{ ij }’s and the intrinsic growth rates r _{ i }’s (see Fig. 4a). To study the minimal sample size Ω^{*} required for perfect inference in the noiseless case, we again consider two different taxa presence patterns: (1) uniform and (2) heterogeneous. We find that for both taxa presence patterns \(\Omega ^ *\) scales linearly with N, though the uniform taxa presence pattern requires much fewer samples (Fig. 4b).
In the presence of noise, and if we don’t know the exact values of a _{ ii }’s, but just assume they follow a halfnormal distribution \( {\cal N}(  1,0.1^2)\), we can still infer a _{ ij }’s and r _{ i }’s with reasonable accuracy (with the normalized rootmeansquare error (NRMSE) < 0.08), for noise level \(\eta < 0.3\) (Fig. 4c–f). However, we point out that the classical Lasso regularization could induce many false positives, and the FDR reaches 0.448 at noise level \(\eta = 0.1\), indicating that almost half of inferred nonzero interactions are actually zero (Fig. 4c). Indeed, even with a noise level \(\eta = 0.04\), the classical Lasso already yields FDR\(\sim 0.45\), staying there for higher η (Fig. 4d).
In many cases, we are more concerned about low FDR than high falsenegative rates, because the topology of an inferred ecological network with even many missing links can still be very useful in the study of its dynamical and control properties^{42}. To control FDR below a certain desired level \(q = 0.2\), we applied the Knockoff filter^{41} (Fig. 4e), finding that though it will introduce more false negatives (see the horizontal bar in Fig. 4e), it can control the FDR below 0.2 for a wide range of noise level (Fig. 4f).
We also found that applying this GLV inference method to samples obtained from a microbial community with nonGLV dynamics leads to significant inference errors even in the absence of noise (Supplementary Fig. 9).
Application to experimental data
First, we applied our inference method to an experimental data set from a synthetic soil microbial community of eight bacterial species^{43}. This data set consists of steady states of a total of 101 different species combinations: all eight solos, 28 duos, 56 trios, all eight septets, and one octet (see the subsection ‘A synthetic microbial community of 8 soil bacteria’ of Supplementary Note 6 for details). For those steadystate samples that started from the same species collection, but with different initial conditions, we average over their final steady states to get a representative steady state for this particular species combination.
In the experiment, it was found that several species grew to a higher density in the presence of an additional species than in monoculture. The impact of each additional species (competitor) j on each focal species i can be quantified by the socalled relative yield, defined as: \(R_{ij} = \frac{{x_i^{\{ i,j\} }  x_i^{\{ i\} }}}{{x_i^{\{ i,j\} } + x_i^{\{ i\} }}},\) which represents a proxy of the ground truth of the interaction strength that species j impacts species i. A negative relative yield indicates growth hindrance of species j on i, whereas positive values indicated facilitation (Fig. 5a). Though quantifying the relative yield is conceptually easy and implementable for certain small microbial communities (see Supplementary Note 7 for details), for many hostassociated microbial communities with many taxa, such as the human gut microbiota, measuring these onespecies and twospecies samples is simply impossible. This actually motivates the inference method we developed here.
Before we apply our inference method, to be fair, we remove all those steady states involving one or two species, and analyze only the remaining 65 steady states. (Note that for \(N = 8\), the number of total possible steady states is \({\mathrm{\Omega }}_{{\mathrm{max}}} = 255\). Hence we only use roughly one quarter of the total possible steady states.) During the inference, we first check if the population dynamics of this microbial community can be well described by the GLV model. We find that all the fitted hyperplanes show small R ^{2}, indicating that the GLV model is not appropriate to describe the dynamics of this microbial community (Supplementary Fig. 10b). Hence, we have to aim for inferring the ecological interaction types, without assuming any specific population dynamics model.
Since this microbial community has only eight species, we can use the bruteforce algorithm to infer the signpattern of the \(8 \times 8\) Jacobian matrix, i.e., the ecological interaction types between the eight species (The results of using a heuristic algorithm are similar and described in the Supplementary Fig. 10c). Compared with the ground truth obtained from the relative yield matrix (Fig. 5a), we find that 50 (78.13%) of the 64 signs were correctly inferred, 10 (15.62%) signs were falsely inferred (denoted as ‘×’), and four (6.25%) signs cannot be determined (denoted as ‘?’) with the information provided by the 65 steady states (Fig. 5b).
We notice that the relative yield of many falsely inferred interactions is weak (with the exception of \(R_{{\mathrm{Ea}},{\mathrm{Pch}}}\), and \(R_{{\mathrm{Ea}},{\mathrm{Pf}}}\)). We conjecture that these errors are caused by noise or measurement errors in the experiments. To test this conjecture, we analyzed the robustness of each inferred s _{ ij } by calculating the percentage of unchanged s _{ ij } after adding perturbations (noise) to the samples (Fig. 5c). Similar to adding noise to simulated steadystate data, here we add noise to each nonzero entry \(x_i^I\) of a sample x ^{I} such that \(x_i^I \to x_i^I + \eta u\), where \(u\sim U[  x_i^I,x_i^I]\). The more robust the inferred results are, the higher the percentage of unchanged signs as η is increased. We found that most of the inferred signs were robust: the percentage of unchanged signs remained nearly 80% up to noise level \(\eta = 0.3\) (Fig. 5c). Specifically, Fig. 5d plots the percentage of unchanged signs of the inferred Jacobian matrix when \(\eta = 0.04\). We found that even if the perturbation is very small, 5 of the 10 falsely inferred s _{ ij } in Fig. 5b changed their signs very frequently (blue entries with label ‘×’ in Fig. 5d). In other words, those interactions were very sensitive to noise, suggesting that some falsely inferred signs in Fig. 5b were largely caused by measurement noise.
Second, we applied our method to an experimental data set from a synthetic bacterial community of maize roots^{44}. There are seven bacterial species (Ecl, Sma, Cpu, Opi, Ppu, Hfr, and Cin) in this community. This data set consists of in total eight steadystate samples: seven sextets and one septet. We found that this community cannot be described by the GLV dynamics (Supplementary Fig. 11).
Using only the seven sextets (i.e., seven steadystate samples involving six of the seven species), we inferred the signpattern of the Jacobian matrix (Fig. 6a). Based on the sign of J _{ ij }, we can predict how the abundance of speciesi in a microbial community will change, when we add speciesj to the community. For example, if we add Ecl to a community consisting of the other six species (i.e., Sma, Cpu, Opi, Ppu, Hfr, and Cin), we predict that the abundance of Sma, Opi, Ppu, Hfr, and Cin will increase, while the abundance of Cpu will decrease (first column of Fig. 6b). Note that our prediction only considers the direct ecological interactions between species and ignores the indirect impact among species. Indeed, Ecl promotes Opi, but Ecl also promotes Hfr that inhibits Opi. Hence the net effect of Ecl on Opi is hard to tell without knowing the interaction strengths. Nevertheless, we found that our prediction is consistent with experimental observation (Fig. 6b, first column).
We then systematically compared our predictions of species abundance changes with experimental observations. There are in total seven sextets, corresponding to the seven columns in Fig. 6b. We add the corresponding missing species back to the community, and check the abundance changes of the existing six species. There are in total \(6 \times 7 = 42\) abundance changes. We found that our inferred signpattern of the Jacobian matrix (Fig. 6a) can correctly predict 30 of the 42 abundance changes (accuracy ~71.43%). Moreover, for those false predictions, the detailed values of the abundance changes are actually relatively small (comparing to those of correct predictions). Note that we only used seven steadysamples to infer the interaction types. If we have more steadystate samples available, we assume the prediction accuracy of our method can be further improved.
We also demonstrated the application of our inference method to two additional experimental data sets. One was obtained from a synthetic microbial community of two crossfeeding partners^{34}, the other was obtained from a synthetic community of 14 auxotrophic Escherichia coli strains^{45}. For both data sets, our inference results agree well with the ground truth (see Supplementary Note 6 for details).
Discussion
In this work, we developed a new inference method to map the ecological networks of microbial communities using steadystate data. Our method can qualitatively infer ecological interaction types (signs) without specifying any population dynamics model. Furthermore, we show that steadystate data can be used to test if the dynamics of a microbial community can be well described by the classic GLV model. When GLV is found to be adequate, our method can quantitatively infer intertaxa interaction strengths and the intrinsic growth rates.
The proposed method bears some resemblance to previous network reconstruction methods based on steadystate data^{46}. But we emphasize that, unlike the previous methods, our method does not require any perturbations applied to the system nor sufficiently close steady states. For certain microbial communities such as the human gut microbiota, applying perturbations may raise severe ethical and logistical concerns.
Note that our method requires the measurement of steadystate samples and absolute taxon abundances. For systems that are in frequent flux, where steadystate samples are hard to collect, our method is not applicable. Moreover, it fails on analyzing the relative abundance data (see Methods). Note that the compositionality of relative abundance profiles also represents a major challenge for inference methods based on temporal data^{15,19}. Fortunately, for certain small laboratorybased microbial communities, we can measure the absolute taxon abundances in a variety of ways, e.g., selective plating^{47}, quantitative polymerase chain reaction (qPCR)^{15,16,48,49}, flow cytometry^{50}, and fluorescence in situ hybridization (FISH)^{51}. For example, in the study of a synthetic soil microbial community of eight bacterial species^{43}, the total cell density was assessed by measuring the optical density and species fractions (relative abundance) were determined by plating on nutrient agar plates. In recent experiments evaluating the dynamics of Clostridium difficile infection in mice models^{15,16}, two sources of information were combined to measure absolute abundances: (1) data measuring relative abundances of microbes, typically consisting of counts (e.g., highthroughput 16S rRNA sequencing data); and (2) data measuring overall microbial biomass in the sample (e.g., universal 16S rRNA qPCR).
In contrast to the difficulties encountered in attempts to enhance the informativeness of temporal data that are often used to infer ecological networks of microbial communities, the informativeness of independent steadystate data can be enhanced by simply collecting more steadystate samples with distinct taxa collection. For hostassociated microbial communities, this can be achieved by collecting steadystate samples from different hosts. Our numerical analysis suggests that the minimal number of samples with distinct taxa collections required for robust inference scales linearly with the taxon richness of the microbial community. Our analysis of experimental data from a small synthetic microbial community of eight species shows that collecting roughly one quarter of the total possible samples is enough to obtain a reasonably accurate inference. Furthermore, our numerical results suggest that this proportion can be significantly lower for larger microbial communities.
This blessing of dimensionality suggests that our method holds great promise for inferring the ecological networks of large and complex microbial communities, such as the human gut microbiota. There are two more encouraging facts that support this idea. First of all, it has been shown that the composition of the human gut microbiome remains stable for months and possibly even years until a major perturbation occurs through either antibiotic administration or drastic dietary changes^{52,53,54,55}. The striking stability and resilience of human gut microbiota suggest that the collected samples very likely represent the steady states of the gut microbial ecosystem. Second, for healthy adults the gut microbiota displays remarkable universal ecological dynamics^{56} across different individuals. This universality of ecological dynamics suggests that microbial abundance profiles of steadystate samples collected from different healthy individuals can be roughly considered as steady states of a conserved ‘universal gut dynamical’ ecosystem and hence can be used to infer its underlying ecological network. Despite the encouraging facts, we emphasize that there are still many challenges in applying our method to infer the ecological network of the human gut microbiota. For example, the assumption of invariant ecological interaction types (i.e., promotion, inhibition, or neutral) between any two taxa needs to be carefully verified. Moreover, our method requires the measurement of absolute abundances of taxa.
We expect that additional insights into microbial ecosystems will emerge from a comprehensive understanding of their ecological networks. Indeed, inferring ecological networks using the method developed here will enable enhanced investigation of the stability^{57} and assembly rules^{58} of microbial communities as well as facilitate the design of personalized microbebased cocktails to treat diseases related to microbial dysbiosis^{9,10}.
Methods
Theoretical basis for inferring ecological interactions
Consider a microbial community of N taxa, whose population dynamics follow Eq.(1). A steadystate data set \({\cal X}\) is a collection of Ndimensional vectors \({\boldsymbol{x}} \in {\Bbb R}^N\) corresponding to the measured equilibria of Eq. (1). We will denote a steadystate sample as \({\boldsymbol{x}}^I \in {\Bbb R}^N\), where the superscript \(I \in {\cal I}\) determines which taxa are present, and \({\cal I} = 2^{\{ 1, \ldots ,N\} }\) is the set of all possible subsets of \(\{ 1, \ldots ,N\}\). Consider the subset \({\cal X}_i \subseteq {\cal X}\) of all samples containing taxon i so that \(f_i\left( {\boldsymbol{x}} \right) = 0\) for all \({\boldsymbol{x}} \in {\cal X}_i\). Applying the mean value theorem for multivariable functions, we obtain
where ‘·’ denotes the inner product between vectors in \({\Bbb R}^N\). Let \({\boldsymbol{J}}_i\left( {\boldsymbol{x}} \right) = \frac{{\partial f_i\left( {\boldsymbol{x}} \right)}}{{\partial {\boldsymbol{x}}}} \in {\Bbb R}^N\) be the ith row of the Jacobian matrix \(J\left( {\boldsymbol{x}} \right) = \left( {J_{ij}\left( {\boldsymbol{x}} \right)} \right) = \left( {\frac{{\partial f_i\left( {\boldsymbol{x}} \right)}}{{\partial x_j}}} \right)\) and let us introduce the notation
where \(L_{{\boldsymbol{x}}^I,{\boldsymbol{x}}^K}\) denotes the line segment connecting the points x ^{I} and x ^{K} in \({\Bbb R}^N\). With this notation, Eq. (3) can be rewritten more compactly as
The above equation implies that the difference of any two samples \(\left\{ {{\boldsymbol{x}}^I,{\boldsymbol{x}}^K} \right\}\) sharing taxon i constrains the integral of J _{ i } over the line segment joining them \({\boldsymbol{x}}^I  {\boldsymbol{x}}^K\).
We consider that the ecological interactions in a microbial community are encoded in the Jacobian matrix \(J \in {\Bbb R}^{N \times N}\) of its population dynamics. More precisely, we assume that the jth taxon directly impacts the ith one iff the function \(J_{ij}\left( {\boldsymbol{x}} \right) \not\equiv 0\). Notice that this condition is well defined because \(J_{ij}({\boldsymbol{x}})\) is a meromorphic function. Furthermore, an ecological interaction is inhibitory iff \(J_{ij}\left( {\boldsymbol{x}} \right) < 0\) and excitatory iff \(J_{ij}\left( {\boldsymbol{x}} \right) > 0\).
Inferring the absence or presence of interactions is equivalent to inferring the zeropattern of the Jacobian matrix, recovering the topology of the ecological network underlying the microbial community. Furthermore, inferring the type of interactions (inhibitory, excitatory, or null) is equivalent to inferring the signpattern of the Jacobian matrix.
Inference using the bruteforce algorithm
In Theorem 2 of the subsection ‘Inferring the signpattern’ of Supplementary Note 1, in order to check if there is a vector with signpattern \({\boldsymbol{s}} \in \left\{ {  ,0, + } \right\}^N\) orthogonal to a given vector (\({\boldsymbol{x}}^I  {\boldsymbol{x}}^K\)), we can check if the following linear program has a solution:
Note that the condition \({\mathrm{sign}}\left( {\boldsymbol{v}} \right) = {\boldsymbol{s}}\) can be encoded as a set of equalities/inequalities of the form \(\{ v_i = 0,v_i < 0,v_i > 0\}\) corresponding to the cases \(\{ s_i = 0,s_i =  1,s_i = 1\}\). Therefore, we can construct an algorithm to obtain all admissible signpatterns for given steadystate data. Indeed, by enumerating all possible signpatterns, we can use the liner program in Eq. (6) to check if each of the possible 3^{N} signpatterns is admissible for taxon i. See Algorithm 1 in the subsection ‘Bruteforce algorithm’ of Supplementary Note 2 for the pseudo code.
This bruteforce algorithm relies on the enumeration of all 3^{N} possible signpatterns in \({\Bbb R}^N\), since it needs to test if each one of them is admissible for the given data. If the set \({\cal X}_i\) has \(n_i\) elements, there will be \(n_i(n_i  1)/2\) vectors of the form \({\boldsymbol{x}}^I  {\boldsymbol{x}}^K\) with \(({\boldsymbol{x}}^I,{\boldsymbol{x}}^K) \in {\cal X}_i \times {\cal X}_i\). Then for each of those vectors and each of the possible 3^{N} signpatterns, we will need to run the linear program Eq. (6) to check if there is an orthogonal vector with the desired signpattern. If we assume that the linear program can be solved with N operations, then for each taxon the Bruteforce algorithm requires to perform a number of operations in the order of \(N3^Nn_i(n_i  1)/2\). Hence, for 100 taxa, we will need to perform at least \(5.19 \times 10^{49}\) operations for the reconstruction of each taxon—which is a number with the same order of magnitude as the number of atoms in Earth. Furthermore, the linear programming used in the bruteforce method can also be time consuming even for a small microbial community with \(N \sim 10\). Consequently, applying the enumeration procedure is only reasonable for a community with \(N \sim 10\), since in this case only around 10^{6} operations are needed to infer the signpattern of the Jacobian corresponding to each taxon.
Inference using the heuristic algorithm
The computational complexity of the bruteforce algorithm motivated us to develop a more efficient reconstruction method. This method has two main ingredients. First, a graphbased approach to quickly check whether a region can be crossed by a hyperplane, circumventing the need to solve the linear program. Second, a heuristic algorithm efficiently explores the solution space and infers the ecological interaction types.
First, we formalize a signsatisfaction problem. Consider a realvalued vector \({\boldsymbol{y}} \in {\Bbb R}^N\). Thus, solving the linear program Eq. (6) is equivalent to solving the following signsatisfaction problem:
Notice that from a geometrical viewpoint, solving Eq. (7) is equivalent to finding the orthants of \({\Bbb R}^N\) crossed by the hyperplane orthogonal to \(({\boldsymbol{x}}^I{\boldsymbol{x}}^K)\).
Second, we propose a graphbased approach to solving the signsatisfaction problem. For the definition, construction, and examples of signsatisfaction graph, see the subsection ‘Inference using the heuristic algorithm’ of Supplementary Note 2. By using the signsatisfaction graph, it is very efficient to test if the hyperplane orthogonal to \(({\boldsymbol{x}}^I{\boldsymbol{x}}^K)\) crosses some orthants of \({\Bbb R}^N\), because it reduces to checking if its corresponding vector in \(\left\{ {  ,0, + } \right\}^N\) meets the requirements of signsatisfaction. However, finding all orthants crossed by such orthogonal hyperplane remains challenging, since the signsatisfaction graph did not decrease the dimension of the solution space (that remains with exponential size 3^{N}). To address this issue, next we introduce a method to efficiently sample paths in the signsatisfaction graph.
Third, we use the intersection line of hyperplanes to sample paths in the signsatisfaction graph. This method depends on a userdefined parameter \({\mathrm{\Psi }} \ge 1\) that specifies the number of intersection lines we need to compute. There are five steps: (step1): Construct the matrix of the difference of all the sample pairs. Consider the set of all vectors \(\{ {\boldsymbol{x}}^I{\boldsymbol{x}}^K  {\boldsymbol{x}}^I,{\boldsymbol{x}}^K \in {\cal X}_i\}\). Let \(M_i \in {\Bbb R}^{N \times \left( {\begin{array}{*{20}{c}} {{\cal X}_i} \\ 2 \end{array}} \right)}\) be a matrix constructed by stacking all the \(\left( {\begin{array}{*{20}{c}} {{\cal X}_i} \\ 2 \end{array}} \right)\)vectors, where \({\cal X}_i\) is the number of samples containing taxon i. By construction, each column of M _{ i } is the normal vector of a hyperplane orthogonal to the difference of the corresponding sample pair. (step2): Randomly sample \((N  1)\) hyperplanes. Choose randomly \(N  1\) columns from M _{ i }. (step3): Find the intersection of the \((N  1)\) sampled hyperplanes to obtain an intersection line. This can be done by finding the kernel of the matrix obtained by stacking the chosen columns. Note that the randomly sampled \((N  1)\) hyperplanes do not always intersect into a line, because some hyperplanes might be parallel with each other. However, this situation is not generic in \({\Bbb R}^N\). Thus, if the randomly sampled hyperplanes do no intersect into a line, we return to step2 and choose a new subset of columns. (step4): Count how many hyperplanes cross the region of the intersection line using the signsatisfaction graph. The signpattern of this intersection line represent the three orthants in \({\Bbb R}^N\) crossed by all those \((N  1)\) hyperplanes. For the remaining hyperplanes in M _{ i } (i.e., the rest of the columns in M _{ i }), let \(\tilde \phi\) be the number of those hyperplanes that cross these three orthants. We normalize \(\tilde \phi\) using \(\phi = \tilde \phi /\left( {\begin{array}{*{20}{c}} {{\cal X}_i} \\ 2 \end{array}} \right)\), so that \(\phi \in [0,1]\). Notice that \(\phi = 1\) means that this signpattern of the intersection line meets the requirements of signsatisfaction for all the sample pairs. Therefore, the magnitude of the computed ϕ can be seen as the confidence of this potential solution to be the true solution of the signsatisfaction problem. (step5): Go back to step2 until \({\mathrm{\Psi }} \ge 1\) intersection lines have been computed.
In summary, selecting the intersection line can be seen as a ‘preference’ sampling in the signsatisfaction graph, because this intersection line can be crossed by at least \((N  1)\) hyperplanes in M _{ i }. Combining the signsatisfaction graph with the sampling procedure described above, we propose a heuristic algorithm to infer the signpattern of J _{ i }. See Supplementary Fig. 6 for the detailed flowchart of this method.
Limitations of the inference using relative abundance data
Highthroughput amplicon sequencing of 16S RNA has become a wellestablished approach for profiling microbial communities. The result of this procedure is a relative abundance profile, where the relative abundance of each taxon in the microbial community has been normalized so that their sum is one. This implies that an increase of the relative abundance of one taxon must be accompanied by a decrease in the relative abundance of other taxa.
This compositionality of relative abundance data severely limits the application of system identification methods based on temporal data, as discussed with details in refs. ^{15,19,59}. It also limits our method based on steadystate data. Consider, for example, that there exist three relative abundance profiles containing taxon i, say \({\bar{\boldsymbol x}}^I,{\bar{\boldsymbol x}}^J,{\bar{\boldsymbol x}}^K\). Since they are relative abundances, the sum of each of these samples must equal 1, implying that \({\mathrm{sum}}({\bar{\boldsymbol x}}^I  {\bar{\boldsymbol x}}^J) = {\mathrm{sum}}({\bar{\boldsymbol x}}^I  {\bar{\boldsymbol x}}^K) = {\mathrm{sum}}({\bar{\boldsymbol x}}^J  {\bar{\boldsymbol x}}^K) = 0\). Consequently, the vector \(\boldsymbol 1 = \left( {1, \ldots ,1} \right) \in {\Bbb R}^N\) satisfies \(\boldsymbol 1 \cdot \left( {{\bar{\boldsymbol x}}^I  {\bar{\boldsymbol x}}^J} \right) = \boldsymbol 1 \cdot \left( {{\bar{\boldsymbol x}}^I  {\bar{\boldsymbol x}}^K} \right) = \boldsymbol 1 \cdot ({\bar{\boldsymbol x}}^J  {\bar{\boldsymbol x}}^K) = 0\). In other words, this vector 1 is always orthogonal to all sample differences and the intersection line of the \((N  1)\) hyperplanes generated by relative abundance is always 1. Therefore, the heuristic algorithm fails in correctly inferring the signpattern of Jacobian matrix using relative abundances, because it always predicts that one possible signpattern is \({\mathrm{sign}}(\boldsymbol s) = ( + , \ldots , + )\).
Data availability
All the experimental data,sets analyzed in this study are either publicly available or kindly provided by the original authors. Other data that support the findings of this study are available from the corresponding author on reasonable request.
References
 1.
Clemente, J., Ursell, L., Parfrey, L. & Knight, R. The impact of the gut microbiota on human health: an integrative view. Cell 148, 1258–1270 (2012).
 2.
Flint, H., Scott, K., Louis, P. & Duncan, S. The role of the gut microbiota in nutrition and health. Nat. Rev. Gastroenterol. Hepatol. 9, 577–589 (2012).
 3.
Schimel, J. & Schaeffer, S. Microbial control over carbon cycling in soil. Front. Microbiol. 3, 348 (2012).
 4.
Nannipieri, P. et al. Microbial diversity and soil functions. Eur. J. Soil Sci. 54, 655–670 (2003).
 5.
Berendsen, R., Pieterse, C. & Bakker, P. The rhizosphere microbiome and plant health. Trends Plant. Sci. 17, 478–486 (2012).
 6.
Shendure, J. & Ji, H. Nextgeneration DNA sequencing. Nat. Biotechnol. 26, 1135–1145 (2008).
 7.
Faust, K. & Raes, J. Microbial interactions: from networks to models. Nat. Rev. Microbiol. 10, 538–550 (2012).
 8.
Widder, S. et al. Challenges in microbial ecology: building predictive understanding of community function and dynamics. ISME J. 10, 2557–2568 (2016).
 9.
Buffie, C. et al. Precision microbiome reconstitution restores bile acid mediated resistance to Clostridium difficile. Nature 517, 205–208 (2014).
 10.
Hudson, L., Anderson, S., Corbett, A. & Lamb, T. Gleaning insights from fecal microbiota transplantation and probiotic studies for the rational design of combination microbial therapies. Clin. Microbiol. Rev. 30, 191–231 (2016).
 11.
Claesson, M. et al. Gut microbiota composition correlates with diet and health in the elderly. Nature 488, 178–184 (2012).
 12.
Friedman, J. & Alm, E. Inferring correlation networks from genomic survey data. PLoS Comput. Biol. 8, e1002687 (2012).
 13.
Claussen, J. C. et al. Boolean analysis reveals systematic interactions among lowabundance species in the human gut microbiome. PLoS Comput. Biol. 13, e1005361 (2017).
 14.
Steinway, S. N., Biggs, M. B. Jr, L., T. P., Papin, J. A. & Albert, R. inference of network dynamics and metabolic interactions in the gut microbiome. PLoS Comput. Biol. 11, e1004338 (2015).
 15.
Bucci, V. et al. MDSINE: microbial dynamical systems INference engine for microbiome timeseries analyses. Genome. Biol. 17, 121 (2016).
 16.
Stein, R. et al. Ecological modeling from timeseries inference: insight into dynamics and stability of intestinal microbiota. PLoS Comput. Biol. 9, e1003388 (2013).
 17.
Fisher, C. & Mehta, P. Identifying keystone species in the human gut microbiome from metagenomic timeseries using sparse linear regression. PLoS ONE 9, e102451 (2014).
 18.
Gerber, G., Onderdonk, A. & Bry, L. Inferring dynamic signatures of microbes in complex host ecosystems. PLoS Comput. Biol. 8, e1002624 (2012).
 19.
Cao, H., Gibson, T., Bashan, A. & Liu, Y. Inferring human microbial dynamics from temporal metagenomics data: Pitfalls and lessons. BioEssays 39, 1600188 (2016).
 20.
Phelan, V. V., Liu, W.T., Pogliano, K. & Dorrestein, P. C. Microbial metabolic exchange—the chemotypetophenotype link. Nat. Chem. Biol. 8, 26–35 (2012).
 21.
Kelsic, E., Zhao, J., Vetsigian, K. & Kishony, R. Counteraction of antibiotic production and degradation stabilizes microbial communities. Nature 521, 516–519 (2015).
 22.
Levine, J. M., Bascompte, J., Adler, P. B. & Allesina, S. Beyond pairwise mechanisms of species coexistence in complex communities. Nature 546, 56–64 (2017).
 23.
Jost, C. & Ellner, S. P. Testing for predator dependence in predatorprey dynamics: a nonparametric approach. Proc. R. Soc. Lond. B Biol. Sci. 267, 1611–1620 (2000).
 24.
Momeni, B., Xie, L. & Shou, W. LotkaVolterra pairwise modeling fails to capture diverse pairwise microbial interactions. eLife Sci. 6, e25051 (2017).
 25.
Angulo, M., Moreno, J., Lippner, G., Barabási, A. & Liu, Y. Fundamental limitations of network reconstruction from temporal data. J. R. Soc. Interface 14, 20160966 (2017).
 26.
Huttenhower, C. et al. Structure, function and diversity of the healthy human microbiome. Nature 486, 207–214 (2012).
 27.
Lozupone, C., Stombaugh, J., Gordon, J., Jansson, J. & Knight, R. Diversity, stability and resilience of the human gut microbiota. Nature 489, 220–230 (2012).
 28.
Case, T. J. & Bender, E. A. Testing for higher order interactions. Am. Nat. 118, 920–929 (1981).
 29.
Worthen, W. B. & Moore, J. L. Higherorder interactions and indirect effects: a resolution using laboratory drosophila communities. Am. Nat. 138, 1092–1104 (1991).
 30.
Billick, I. & Case, T. J. Higher order interactions in ecological communities: what are they and how can they be detected? Ecology 75, 1529–1543 (1994).
 31.
Bairey, E., Kelsic, E. D. & Kishony, R. Highorder species interactions shape ecosystem diversity. Nat. Commun. 7, 12285 (2016).
 32.
Grilli, J., Barabás, G., MichalskaSmith, M. J. & Allesina, S. Higherorder interactions stabilize dynamics in competitive network models. Nature https://doi.org/10.1038/nature23273 (2017).
 33.
Angulo, M. T., Moog, C. H. & Liu, Y.Y. Controlling microbial communities: a theoretical framework. bioRxiv 149765 (2017). https://doi.org/10.1101/149765.
 34.
Hoek, T. et al. Resource availability modulates the cooperative and competitive nature of a microbial crossfeeding mutualism. PLoS Biol. 14, e1002540 (2016).
 35.
Skalski, G. & Gilliam, J. Functional responses with predator interference: viable alternatives to the holling type II model. Ecology 82, 3083 (2001).
 36.
Holling, C. The functional response of predators to prey density and its role in mimicry and population regulation. Mem. Èntomol. Soc. Can. 97, 5–60 (1965).
 37.
Beddington, J. Mutual interference between parasites or predators and its effect on searching efficiency. J. Anim. Ecol. 44, 331 (1975).
 38.
Crowley, P. & Martin, E. Functional responses and interference within and between year classes of a dragonfly population. J. North Am. Benthol. Soc. 8, 211–221 (1989).
 39.
Kuang, Y., Hwang, T. & Hsu, S. Global dynamics of a PredatorPrey model with HassellVarley Type functional response. Discret. Contin. Dyn. Syst.Ser. B 10, 857–871 (2008).
 40.
Tibshirani, R., others. The lasso method for variable selection in the Cox model. Stat. Med. 16, 385–395 (1997).
 41.
Barber, R. & Candès, E. Controlling the false discovery rate via knockoffs. Ann. Stat. 43, 2055–2085 (2015).
 42.
Liu, Y.Y., Slotine, J.J. & Barabási, A.L. Controllability of complex networks. Nature 473, 167–173 (2011).
 43.
Friedman, J., Higgins, L. & Gore, J. Community structure follows simple assembly rules in microbial microcosms. Nat. Ecol. Evol. 1, 0109 (2017).
 44.
Niu, B., Paulson, J. N., Zheng, X. & Kolter, R. Simplified and representative bacterial community of maize roots. Proc. Natl Acad. Sci. USA 114, E2450–E2459 (2017).
 45.
Mee, M. T., Collins, J. J., Church, G. M. & Wang, H. H. Syntrophic exchange in synthetic microbial communities. Proc. Natl Acad. Sci. USA 111, E2149–E2156 (2014).
 46.
Sontag, E. D. Network reconstruction based on steadystate data. Essays Biochem. 45, 161–176 (2008).
 47.
Apajalahti, J. H. A., Kettunen, A., Nurminen, P. H., Jatila, H. & Holben, W. E. Selective plating underestimates abundance and shows differential recovery of bifidobacterial species from human feces. Appl. Environ. Microbiol. 69, 5731–5735 (2003).
 48.
Rinttilä, T., Kassinen, A., Malinen, E., Krogius, L. & Palva, A. Development of an extensive set of 16S rDNAtargeted primers for quantification of pathogenic and indigenous bacteria in faecal samples by realtime PCR. J. Appl. Microbiol. 97, 1166–1177 (2004).
 49.
Datta, M. S., Sliwerska, E., Gore, J., Polz, M. F. & Cordero, O. X. Microbial interactions lead to rapid microscale successions on model marine particles. Nat. Commun. 7, 11965 (2016).
 50.
Dubelaar, G. B. J. & Jonker, R. R. Flow cytometry as a tool for the study of phytoplankton. Sci. Mar. 64, 135–156 (2000).
 51.
Amann, R. & Fuchs, B. M. Singlecell identification in microbial communities by improved fluorescence in situ hybridization techniques. Nat. Rev. Micro 6, 339–348 (2008).
 52.
David, L. et al. Host lifestyle affects human microbiota on daily timescales. Genome Biol. 15, R89 (2014).
 53.
Relman, D. The human microbiome: ecosystem resilience and health. Nutr. Rev. 70, S2–S9 (2012).
 54.
Caporaso, J. et al. Moving pictures of the human microbiome. Genome Biol. 12, R50 (2011).
 55.
Faith, J. et al. The longterm stability of the human gut microbiota. Science 341, 1237439–1237439 (2013).
 56.
Bashan, A. et al. Universality of human microbial dynamics. Nature 534, 259–262 (2016).
 57.
Angulo, M. & Slotine, J. Qualitative stability of nonlinear networked systems. IEEE Trans. Autom. Control 11 (2016). https://doi.org/10.1109/tac.2016.2617780.
 58.
Grilli, J. et al. Feasibility and coexistence of large ecological communities. Nat. Commun. 8, 14389 (2017).
 59.
Li, C., Lim, K. M. K., Chng, K. R. & Nagarajan, N. Predicting microbial interactions through computational approaches. Methods 102, 12–19 (2016).
Acknowledgements
This work is supported in part by the John Templeton Foundation (Award number 51977). We thank Drs. Gabe Billings and Brigid Davis for insightful comments on the manuscript. We thank Drs. Joseph Nathaniel Paulson, Michael T. Mee, Harris H. Wang, Francesco Carrara, and Carsten F. Dormann for kindly providing their experimental data sets. We thank Dr. Liang Tian for discussions.
Author information
Affiliations
Contributions
Y.Y.L conceived the project. Y.Y.L and M.T.A. designed the project. Y.X. and M.T.A. did the analytical calculations. Y.X. did the numerical simulations and analyzed the empirical data. All authors analyzed the results. Y.Y.L., Y.X., and M.T.A. wrote the manuscript. J.F, M.K.W., and S.T.W. edited the manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare that they have no competing financial interests.
Additional information
Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Electronic supplementary material
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Xiao, Y., Angulo, M.T., Friedman, J. et al. Mapping the ecological networks of microbial communities. Nat Commun 8, 2042 (2017). https://doi.org/10.1038/s41467017020902
Received:
Accepted:
Published:
Further reading

Disentangling environmental effects in microbial association networks
Microbiome (2021)

The complexities of the dietmicrobiome relationship: advances and perspectives
Genome Medicine (2021)

Interaction analyses based on growth parameters of GWAS between Escherichia coli and Staphylococcus aureus
AMB Express (2021)

Estuarine gradients dictate spatiotemporal variations of microbiome networks in the Chesapeake Bay
Environmental Microbiome (2021)

Environmental connectivity controls diversity in soil microbial communities
Communications Biology (2021)
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.