Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2025 May 31.
Published in final edited form as: Nat Ecol Evol. 2023 Nov 16;8(1):22–31. doi: 10.1038/s41559-023-02250-2

Identifying keystone species in microbial communities using deep learning

Xu-Wen Wang 1, Zheng Sun 1, Huijue Jia 2,3, Sebastian Michel-Mata 4, Marco Tulio Angulo 5, Lei Dai 6,7, Xuesong He 8,9, Scott T Weiss 1, Yang-Yu Liu 1,10
PMCID: PMC12125608  NIHMSID: NIHMS2085379  PMID: 37974003

Abstract

Previous studies suggested that microbial communities can harbor keystone species whose removal can cause a dramatic shift in microbiome structure and functioning. Yet, an efficient method to systematically identify keystone species in microbial communities is still lacking. Here we propose a Data-driven Keystone species Identification (DKI) framework based on deep learning to resolve this challenge. Our key idea is to implicitly learn the assembly rules of microbial communities from a particular habitat by training a deep-learning model using microbiome samples collected from this habitat. The well-trained deep-learning model enables us to quantify the community-specific keystoneness of each species in any microbiome sample from this habitat by conducting a thought experiment on species removal. We systematically validated this DKI framework using synthetic data and applied DKI to analyze real data. We found that those taxa with high median keystoneness across different communities display strong community specificity. The presented DKI framework demonstrates the power of machine learning in tackling a fundamental problem in community ecology, paving the way for the data-driven management of complex microbial communities.


The notion of keystone species has its roots in food-web ecology1,2. Since Paine coined it in describing results from his pioneering field experiments in 1969, the notion of keystone species has been widely applied in the ecological literature. Such a broad application (and often abuse) has generated considerable confusion about what precisely a keystone species is3. Here, we adopt the original definition by Paine, i.e., a keystone species is a species that has a disproportionately large effect on the stability of the community relative to its abundance1,2. Existing methods to identify keystone species for macro ecosystems can be classified into two approaches: experimental manipulations and statistical comparisions4.

Previous studies also suggest that microbial communities harbor keystone species59. Yet, the keystone species identification approaches developed for macro ecosystems are challenging to apply to large, complex microbial communities59. For experimental manipulations, targeted removal of each species in a complex community is impossible with current antimicrobial techniques, not to mention the corresponding ethical concerns for host-associated microbial communities such as the human gut microbiome. As for statistical comparisons, finding two communities that differ by just one species is challenging, especially for complex host-associated microbial communities (e.g., the human gut microbiome) with very personalized compositions10,11. Moreover, statistical comparisons can suffer from numerous confounding factors12. To resolve the above limitations, one may consider directly inferring a population dynamics model to predict the temporal behavior of microbial communities and then identify keystone species through numerical simulations of targeted species removal. Yet, model misspecification and high-quality absolute abundance data requirement1315 for those dynamics inference methods limit their application for identifying keystone species in large, complex microbial communities.

A recent numerical study16 claimed that those highly connected (i.e., “hubs”) and high betweenness centrality species in the microbial correlation network are keystone species of microbial communities6,17. Despite the popularity and interpretability of the correlation network approach, we think this claim is problematic for at least two reasons. First, edges in microbial correlation networks do not represent direct ecological interactions but just statistically significant co-occurrences or mutual exclusions of species. Second, the impact of a species’ removal naturally depends on the resident community. This underscores a fundamental challenge in the keystone species identification --- the community specificity, i.e., a species may be a keystone in one community but not necessarily a keystone in another community, which is completely ignored based on degree, betweenness or any topological indices in the correlation (or ecological) network.

So far, very few microbial species have been experimentally confirmed as keystones5,1820. An efficient method to systematically identify community-specific keystone species in complex microbial communities is still lacking2123. In fact, we even lack a widely accepted operational definition of keystoneness --- an index to quantify the role of a species to be a keystone. In this work, we first propose an operational definition of keystoneness for microbial species based on commonly available relative abundance data. Then we proposed a Data-driven Keystone species Identification (DKI) framework to compute the keystoneness. The DKI framework does not assume any particular ecological model, naturally avoiding the model misspecification issue. Moreover, the DKI framework quantifies the keystoneness of each species for each community (sample). Hence, it naturally considers the community specificity of keystoneness.

Results

An operational definition of keystoneness for microbial communities.

Consider a microbiome sample or microbial community s=(z,p). Here, the species assemblage of the community s is represented by a binary vector z{0,1}N with the i-th entry zi=1 (or 0) if species-i is present (or absent) in s. The microbial composition or taxonomic profile of this community is characterized by a compositional vector pΔN with the i-th entry pi representing the relative abundance of species-i in s and ΔN is the probability simplex. Inspired by the keystoneness definition in macroecology24, we defined the keystoneness of species in microbial communities as the product of two components: the impact component and the biomass component.

More specifically, we defined the structural keystoneness of species-i in a community s=(z,p) as

Ks(i,s)dp~,p-1-pi, [1]

where the impact component d(p~,p-) quantifies the structural impact of species-i’s removal on the community s, while the biomass component (1-pi) captures how disproportionate is this impact.

For the impact component, we quantified the impact of species-i’s removal on the structure of community s as the dissimilarity between the taxonomic profiles p~ and p-, i.e., dp~,p-. Here, p~ is the new community composition after species-i’s removal. p- is the null composition, which is obtained by assuming that species-i’s removal will not affect any other species (see Methods).

Similarly, we define the functional keystoneness of species-i in a community s=(z,p) as

Kfi,sdf~,f-1-pi. [2]

Here, the dissimilarity between the functional profiles f~ and f-, i.e., df~,f-, captures the impact of species-i’s removal on the function of community s.f~ (or f-) can be computed from p~ (or p-) and the genomic content network (GCN)25, respectively (see Methods).

We emphasize that the structural (or functional) keystoneness defined here is community-specific, which is fundamentally different from those topological indices used in the food web and other ecological systems26.

The DKI framework.

Consider a particular habitat (or meta-community) that harbors a pool of N different microbial species, denoted as Ω={1,,N}. Suppose we have a large set of microbiome samples 𝒮={1,,M} collected from this habitat. A microbiome sample s𝒮 can be viewed as a local community of the habitat. We assume the collected samples roughly represent the steady states of the local communities so that they can be used to learn the assembly rules of those communities.

The DKI framework consists of two phases. In the first phase (Fig.1a), we implicitly learn the assembly rules of microbial communities in this habitat using a deep-learning method with 𝒮 as the training data. This is achieved by learning a map from the species assemblage z of a sample s=(z,p) to its taxonomic profile p, i.e., φ:zp. Various deep-learning methods, including Multi-Layer Perceptron27 (MLP) or ResNet28 can be used to learn such map without using any population dynamic model, but with a few reasonable assumptions (e.g., the universality of microbial dynamics, steady-state samples, no true multi-stability, and enough training samples. See SI Sec.1 for details) to ensure the problem is mathematically well-defined. Here, based on our previous work29, we developed cNODE2 (composition Neural Ordinary Differential Equation version 2.0) to learn the map φ (see SI Sec.1 for details). Learning this map φ will enable us to predict what will happen to the taxonomic profile of a local community upon any species removal.

Figure 1: Workflow of the Data-driven Keystone species Identification (DKI) framework.

Figure 1:

a, The species assemblage of a microbiome sample s is represented by a binary vector z{0,1}N, where its i-th entry satisfies zi=1(zi=0) if species-i is present (or absent) in this sample. The microbial composition of this sample is characterized by a vector pΔN, where its i-th entry pi is the relative abundance of species-i in this sample and ΔN is the probability simplex. A deep learning model (cNODE2) is trained to learn the map: z{0,1}NpΔN. b, We conduct a thought removal experiment of species-i. In particular, for the community s=(z,p) with species collection z and microbial composition p, we remove species-i from z to form a new species collection z~=z\i. Then, for the new species collection z~, we use cNODE2 to predict its new composition p~=φ(z~). To quantify the impact of species-i’s removal, we need to compare the new composition p~ with a null composition p- in the absence of species-i (obtained by assuming species-i’s removal will not affect other species’ abundances at all). The structural impact of species-i’s removal on the community s=(z,p) can be defined as the distance or dissimilarity between p~ and p-, i.e., d(p~,p-). Similarly, the functional impact of species-i’s removal on the community s=(z,p) can be defined as the distance or dissimilarity between f~ and f-, i.e., d(f~,f-). Here, the functional profile f~ (or f-) can be computed by multiplying p~ (or p-) with the incidence matrix of the genomic content network (GCN), respectively.

In the second phase (Fig.1b), to quantify the community-specific keystoneness of species-i in a local community or microbiome sample s, we conduct a thought experiment of removing species-i from s and use cNODE2 to compute the impact of species-i’s removal on s. In particular, for s=(z,p) with species collection z and microbial composition p, we remove species i from z to form a new species collection z~=z\i. Then, for the new species collection z~, we use cNODE2 to predict its composition p~=φ(z~). To quantify the impact of species-i’s removal, we need to compare the new composition p~ with the null composition p- (with p-i=0 and p-j=pj/kipk for ji). In reality, the map φ cannot be perfectly learned, and the composition prediction always contains some error. To take this into account, we can compute the null composition p- by renormalizing the relative abundances of the remaining species from the predicted composition of the original community, i.e., p-j=pj/kipk, where p=pk=φ(z). This way, the prediction errors in p~ and p- will be canceled to some extent, and hence the predicted keystoneness will be more accurate (see Fig.S1). From the predicted p~ and p-, we can compute functional profiles f~ and f-, and then compute both the structural keystoneness and the functional keystoneness of species-i in the community s=(z,p).

Validation of DKI framework using synthetic dataset.

To demonstrate DKI’s performance in the keystoneness prediction, we generated synthetic data using the Generalized Lotka-Volterra (GLV) model with N=100 species in the species pool (meta-community). The initial species collection of each sample (local community) consists of 50 species randomly drawn from the species pool (see SI Sec.2). We characterized the population dynamics of the meta-community using two parameters: (1) The connectivity C of the underlying ecological network (which encodes all the pairwise inter-species interactions), representing the probability that two species interact directly. (2) The characteristic interaction strength σ represents the typical impact of one species over the per-capita growth rate of another species if they interact. To introduce keystone species to the local communities, inspired by a previous study23, we amplified all the link weights (inter-species interactions) to a~ij=θijaij, where θij is randomly drawn from a log-normal distribution with mean 0 and standard deviation η. This will generate a few strong interactions, presumably leading to a few species with high keystoneness. Hereafter, we refer η as the characteristic amplification coefficient.

We first trained cNODE2 to minimize the loss function defined as the mean Bray-Cutis dissimilarity between the true and predicted compositions for all samples (see SI Sec.1). Then, we evaluated DKI using all possible new species collection z~ by removing each of present species in each sample. We systematically evaluated the performance of DKI in predicting the structural keystoneness Ks using simulated data generated from the GLV model with different values for the parameter pair (C,η). We found that DKI can accurately predict the Ks of each species over different samples for a wide range of C or η values (see Fig.2af). The Spearman correlation ρ between the true Ks (calculated from the simulated species removal process in the GLV model) and the predicted Ks is around 0.97 with p-value<0.001 (two-sided t test). See SI Figs.S2S3 and Sec.1.3 for a discussion of performance of DKI with other factors.

Figure 2: In silico validation of the DKI framework.

Figure 2:

Results are obtained for the pools of N=100 species with Generalized Lotka-Volterra population dynamics. We generate 500 samples to validate the performance of DKI. The population dynamics is characterized by two parameters: the network connectivity C>0 and boosting strength η>0. Predicted structural keystoneness and true structural keystoneness with network connectivity C=0.3 (a), C=0.5 (b) and C=0.7 (c) or boosting strength η=0.5 (d), η=1 (e) and η=1.2 (f). Predicted functional keystoneness and true functional keystoneness with network connectivity C=0.3 (g), C=0.5 (h) and C=0.7 (i) or boosting strength η=0.5 (j), η=1 (k) and η=1.2 (l). For different network connectivities, characteristic interaction strength σ=0.01 and boosting strength η=1. For different boosting strengths, characteristic interaction strength σ=0.01 and network connectivity C=0.4. In each panel, we show the Spearman correlation (ρ) between the predicted and true keystoneness values, and the p-value. The p-values for the Spearman correlation coefficients (ρ) were obtained with a two-sided t test.

To calculate the functional keystoneness using the synthetic data, we generated a random GCN displaying nested structure (with Nestedness metric based on Overlap and Decreasing Fill30 NODF=0.31) for 100 species and 500 genes. We found that DKI can also accurately predict the Kf of each species over different samples for a wide range of C or η values (see Fig.2gl). The Spearman correlation ρ between the true Kf (calculated from the simulated species removal process in the GLV model and the randomly generated GCN) and the predicted Kf is around 0.96 with p-value<0.001.

We emphasize that each species’ structural (or functional) keystoneness is context-dependent or community-specific. Yet, existing methods, especially those based on topological indices of correlation (or ecological) networks constructed (or inferred) from a collection of samples, cannot offer community-specific keystoneness. Moreover, those topological measures do not correlate with each species’ structural (or functional) keystoneness. To demonstrate this point, we generated synthetic data (see SI Sec.1) and compared the structural keystoneness Ks (calculated from the simulated species removal process in the GLV model) with two classical topological indices, i.e., degree (the number of species connected with the species under consideration) and betweenness (the frequency of the species under consideration on the shortest paths connecting all pairs of other species) in the directed ecological network or the undirected correlation network. As shown in Fig.3 and Fig.S4, the two topological indices do not correlate with Ks at all, regardless of using the correlation network (Fig.3) or the ecological network (see Fig.S4 and SI Sec.3 for details).

Figure 3: Traditional topological indices calculated from the undirected correlation network do not correlate with structural keystoneness.

Figure 3:

Synthetic samples (taxonomic profiles) were generated from the GLV model with N=100 species in the species pool. The initial species collection of each sample (local community) consists of 50 species randomly drawn from the species pool (see SI Sec.1). The structural keystoneness Ks of each species in each sample was calculated from the simulated species removal process in the GLV model. Two traditional topological indices (betweenness and degree) of each species were calculated from the correlation network of species abundances constructed using sparCC43 with threshold 0.1. a-c, Structural keystoneness vs. betweenness. The ecological network connectivity C=0.3 (a), C=0.5 (b), C=0.7 (c). The characteristic interaction strength σ=0.01 and the boosting strength η=1. d-f, Structural keystoneness vs. betweenness with η=0.5 (d), η=1.0 (e) and η=1.2 (f). C=0.4 and σ=0.01. g-i, Structural keystoneness vs. degree. C=0.3 (g), C=0.5 (h), C=0.7 (i). σ=0.01 and η=1. j-l, Structural keystoneness vs. degree with η=0.5 (j), η=1.0 (k) and η=1.2 (l). C=0.4 and σ=0.01.

Validation of DKI using in vitro synthetic microbial community.

We then validated our DKI framework using data from an in vitro study of synthetic microbial communities comprising of up to eight soil bacterial species: Enterobacter aerogenes (Ea), Serratia marcescens (Sm), Pseudomonas citronellolis (Pci), Pseudomonas putida (Pp), Pseudomonas aurantiaca (Pa), Pseudomonas chlororaphis (Pch), Pseudomonas fluorescens (Pf), Pseudomonas veronii (Pv). Those communities involved 101 different species combinations: all eight solos, 28 duos, 56 trios, all eight septets, and one octet31. To validate the DKI, we used duos and trios (in total 42 species combinations). For each sample with species collection z, we examined whether there is a corresponding sample with species collection z~=z\i. In total 56 sample pairs were identified to test the prediction of DKI. For each sample pair (z,z~), we used the ground truth sample z~ as the test set and the remaining samples were used to train the DKI. We found that the keystoneness of each species displays strong community-specificity for most of the species (Fig.4a). Then, we compared the predicted keystoneness of each species with its true keystoneness, finding that the keystoneness predicted by DKI is consistent with the true keystoneness (Spearman correlation ρ=0.85, p-value<0.001, Fig.4b). Importantly, the two topological indices (i.e., degree and betweenness) do not correlate with Ks at all (Fig.4c,d). To examine the sensitivity of each method in keystone identification, we considered the species with the highest true keystoneness as keystone species in each community, and the predicted keystone as the species with the highest predicted keystoneness or topological indices. We found that DKI yields the highest accuracy 0.85 (Fig.4e) than degree (accuracy 0.4, Fig.4f) and betweenness (accuracy 0.25, Fig.4g).

Figure 4: In vitro validation of cNODE in keystoneness prediction.

Figure 4:

We analyzed data from a synthetic consortium of 8 soil species: Enterobacter aerogenes (Ea), Serratia marcescens (Sm), Pseudomonas citronellolis (Pci), Pseudomonas putida (Pp), Pseudomonas aurantiaca (Pa), Pseudomonas chlororaphis (Pch), Pseudomonas fluorescens (Pf), Pseudomonas veronii (Pv) to validate DKI. a, True keystoneness of each species in different communities. b-d: Spearman correlations between true keystoneness and DKI-predicted keystoneness (b), degree (c), and betweenness (d) were calculated. Shaded areas indicate 95% confidence intervals of the regression line. e-g: True keystone species in each sample (yellow square) and DKI-predicted keystone (green circle) (e), degree-predicted (f), and betweenness-predicted keystone species (g) were calculated. True (predicted) keystone species is considered as the species with the highest true (predicted) keystoneness. Two traditional topological indices (betweenness and degree) of each species were calculated from the correlation network of species abundances constructed using sparCC43 with threshold 0.05. The p-values for the Spearman correlation coefficients (ρ) were obtained with a two-sided t test.

Keystone species in the human microbiome.

We applied the DKI framework to the human gut microbiome data collected in a curated metagenomic database32. We focused on the metagenomic data of stool samples of healthy adults aged between 18 to 65 and without antibiotics usage. In total, we have 2,815 samples involving 1,103 species. Species in RefSeq (NCBI Reference Sequence Database), are defined based on comprehensive, integrated, non-redundant, and well-annotated reference sequences, including genomic, transcript, and protein data.

We first trained cNODE2 by using all the 2,815 samples. Then for each of the 2,815 samples, we computed the structural keystoneness Ks for each species present in the sample. For species present in at least 10% of the samples, we ranked them based on their median structural keystoneness: median(Ks). Fig.5a,b show the top-20 and bottom 20 species, respectively. We found that those species with a higher median(Ks), e.g., Prevotella copri, tend to have a larger variation of their Ks across different samples, suggesting a stronger community specificity (Fig.5a); while those species with a lower median(Ks), e.g., Alistipes finegoldii, tend to have a smaller Ks variation, suggesting a weaker community specificity (Fig.5b). In addition, those species with the highest keystoneness tend to have a much larger biomass component than the impact component (see Fig.S5).

Figure 5: Keystone species in the human gut microbiome.

Figure 5:

We applied DKI to a large-scale human gut microbiome dataset collected in curatedMetagenomicData32. This dataset includes 2,815 fecal samples from healthy adults without antibiotics usage. In total, we have 1,103 species. a-b, Structural keystoneness distribution of the top-20 (a) and bottom-20 species (b) ranked by their median structural keystoneness. c, Spearman correlation between the median structural keystoneness and median deviation of keystoneness of each species. d-e, Functional keystoneness distribution of the top-20 (d) and bottom-20 species (e) ranked by their median functional keystoneness. f, Spearman correlation between the median functional keystoneness and median deviation of keystoneness of each species. In panels (a), (b), (d) and (e), the top/bottom-20 species were selected among species present in at least 10% of total samples. The p-values for the Spearman correlation coefficients (ρ) were obtained with a two-sided t test.

To systematically explore the community-specificity of those species’ structural keystoneness, we plotted their median keystoneness median(Ks) vs. their median absolute deviation of structural keystoneness MADKs over all samples. We found that MADKs is highly correlated with median(Ks) with Spearman correlation ρ=0.87, p-value<0.001 (Fig.5c). This result indicates that taxa with low median structural keystoneness are unlikely to be keystone taxa in any community. By contrast, taxa with high median keystoneness have high keystoneness (and hence are likely keystone taxa) in some communities, but they can also have small keystoneness in other communities. Similar results were also observed from the human oral microbiome and environmental microbiomes (see SI Secs.47 and Figs.S68 for details).

We noticed that the largest (structural) keystoneness value is still smaller than 0.2 (see Fig.5a), which is much lower than the upper bound of our keystoneness metric, i.e., 1. This can be explained by the fact that many complex microbial communities (including the human microbiome) typically have high functional redundancy33, meaning that many phylogenetically unrelated species carry similar genes and perform similar functions. A high level of functional redundancy can be related to the reliability with which an ecosystem will continue to deliver services under moderate species loss. Such functional redundancy has been considered to underlie the stability and resilience of microbial communities. Therefore, a complex microbial community with high functional redundancy will not be so fragile that removing one species will cause a collapse in the services it provides (see Fig.S9).

To compute the functional keystoneness, we constructed a reference GCN (See SI Sec.4 for details). We found that, in general, a species’ functional keystoneness is smaller than its structural keystoneness (see Fig.S10). This is also closely related to the concept of functional redundancy25. Similar to our results on structural keystoneness, we found that those species with a higher median(Kf), e.g., Bifidobacterium bifidum, tend to have a larger variation of their Kf across different samples, suggesting a stronger community specificity (Fig.5d), while those species with a lower median(Kf), e.g., Roseburia hominis, tend to have a smaller Kf variation, suggesting a weaker community specificity (Fig.5e). We found that median(Kf) and MADKf are strongly correlated: Spearman correlation ρ=0.88, p-value<0.001 (Fig.5f).

Based on the ranking of the median structural keystoneness, we found that among those top-ranking species, many of them have been identified as keystone species that carry unique functions and are essential for the maintaining host-microbe hemeostasis34. For example, Bifidobacteria are keystone microorganisms in gut microbiota associated with early life35; Prevotella copri is a keystone species of a healthy human intestinal mucosa36; Faecalibacterium prausnitzii is a keystone species that produces butyrate and its reduced abundance has been associated with Crohn’s disease37; Bifidobacterium longum is a minority species, but influences gut microbiota formation by breaking down complex carbohydrates and providing degradants for other bacterial groups to use38; Ruminococcus bromii plays key roles in promoting the synergistic utilization of resistant starch (RS) by initiating degradation of insoluble RS particles5,34 (Fig.5a).

Interestingly, some of the species with high median structural keystoneness also have high median functional keystoneness, e.g., Faecalibacterium prausnitzii and Prevotella copri (Fig.5d). Based on the high median functional keystoneness, we also identified some potential keystone species that have been reported to perform important functions. For example, Intestinimonas-like bacteria are important butyrate producers that utilize N-ε-fructosyllysine and lysine in formula-fed infants and adults39.

Discussion

The concept of keystone species has been extensively investigated in ecology. Despite the considerable confusion and difference3, the operational definitions agree that a keystone species disproportionately affects its natural environment relative to its abundance. Systematically identifying keystone species in complex microbial communities is very challenging due to our limited knowledge of the population dynamics of those communities, as well as many logistical and ethical concerns regarding the manipulation of those communities. In this work, we propose a data-driven framework to systematically identify keystone species in complex microbial communities. This framework enables us to compute the structural and functional keystoneness of each species in a community for the first time. Our framework can be used to facilitate data-driven management of complex microbial communities.

We emphasize that the proposed framework is general enough and can be modified in many different ways. For example, instead of using cNODE2, one can use other deep learning models (e.g., Multi-Layer Perceptron (MLP)) to learn the map φ:zp (see Fig.S11). Moreover, instead of using Bray-Curtis dissimilarity, one can use other dissimilarity or distance measures (e.g., the weighted UniFrac distance) to quantify the structural or functional impact of species’ removal (see Fig.S12). One can also use other formulas that combine the impact component and the biomass component to quantify the keystoneness24. In addition, beyond studying the impact of a species’ removal on the community-level functional profile, we can also focus on its impact on any specific microbial function and hence quantify its sensitivity. For instance, one can calculate the relative abundances of a function before and after a species’ removal, respectively (see Fig.S13 and Methods).

Among all the five microbiome datasets analyzed in this work, we found that keystoneness value of in vitro synthetic microbial can be higher than 0.4. However, keystoneness of other four large real microbial communities is much lower than 1. This result could be interpreted as saying there are hardly any keystone species for the studied microbiome samples in those four datasets. Importantly, this conclusion does not imply that there are hardly any keystone species for any microbial community because of the strong community-specificity of keystoneness. Indeed, one may design a synthetic community with a few keystone species present. But for naturally observed microbial communities (regardless of host-associated or host-free), we believe the chance to find keystone species is quite low. In addition, the relative ranking of keystoneness might be more important, instead of absolute value in quantitatively identifying keystone species, e.g., the species with highest median keystoneness across communities are more likely to be keystone species.

We admit there are some caveats in our calculation/interpretation of functional keystoneness (see SI Sec.8). All the functions are potential functions encoded in the microbial genomes. They do not have to be active. To study the true functions, it is necessary to leverage metaproteomics data. It is known that the (protein-level) functional profiles, or the selective expression of proteins, might depend on the community itself. That is some species might express certain proteins to consume certain resources to avoid niche overlap with other species in the community. In other words, the protein-content network (PCN) is community-dependent, while the gene-content network (GCN) is independent of the community40.

Methods

Keystoneness calculation.

Inspired by the keystoneness definition in macroecology24, we defined the structural keystoneness of species in microbial communities as the product of two components: the impact component and the biomass component. The impact component is computed as the dissimilarity between the taxonomic profiles p~ and p-, i.e., dp~,p-. Here, p~ is the new community composition after species-i’s removal, while p- is the null composition computed by simply setting p-i=0, and renormalizing the relative abundances of the remaining species, i.e., p-j=pj/kipk for ji. Note that d(p~,p-) can be any distance or dissimilarity measure, e.g., the Bray-Curtis dissimilarity. The biomass component is simply computed as 1-pi.

Note that our structural keystoneness Ksi,s=dp~,p-1-pi has clear lower and upper bounds. The lower bound of Ksi,s is 0, representing the case that species-i is not interacting with any other species in the community, hence its removal will have zero impact on the community. This is of course an extreme case. The upper bound of Ksi,s is 1. This corresponds to another extreme case: species-i’s relative abundance pi is close to 0, and its removal will cause many other species to die out and only a few species survive, and the sum of those survived species’ initial relative abundances is also close to 0. Hence, mathematically, our quantitative metric describes the qualitative keystoneness (in terms of species extinction or system collapse). In fact, our keystoneness definition is more generic in the sense that as long as species-i has a very low relative abundance and its removal will have a very large impact on the community composition (not necessarily leading to many species extinctions), then its keystoneness will be very high.

To compute the functional keystoneness Kfi,s=df~,f-1-pi, we need to compute the functional profiles f~ and f- from their taxonomic profiles p~ and p-, and the genomic content network (GCN)25. Here, the GCN is a weighted bipartite graph connecting the N species to their genes (see SI Sec.4,5). Suppose there are in total M genes in the metagenome of the N species. The GCN can then be represented by an incidence matrix G=(Gia)RN×M, where a non-negative integer Gia indicates the copy number of gene-a in the genome of species-i. The gene composition or functional profile fΔM of a microbiome sample with taxonomic profile p can then be calculated as f=cpG, where c=a=1Mi=1NpiGia-1 is a normalization constant.

Function sensitivity.

Instead of studying the impact of a species’ removal on the community-level functional profile, we can also focus on the impact on any specific function and hence quantify the sensitivity of the function. This study provides insight into microbial metabolites and associated functional pathways in controlling host physiology34. Here, we quantified the sensitivity of each specific function (i.e., metabolic pathway) in the human gut microbiome by calculating its abundance change, i.e., pathway-a’s abundance change caused by species-i’s removal in community s is given by: δa(s,i)=|fas-fas(z\i)|/(fas+ϵ), where fas and fas(z\i) are the relative abundances of pathway-a before and after species-i’s removal, respectively and ϵ=10-10. Then, we ranked the pathways based on their mean change over different species and samples/communities, i.e., δa-=i=1N(j=1Miδa(s,i)/Mi)/N, where Mi is the prevalence of species i.

Supplementary Material

Supplementary Discussions 1–8 and Figs. 1–14

Acknowledgments.

Y.-Y.L. acknowledges the funding support from National Institutes of Health (R01AI141529, R01HD093761, RF1AG067744, UH3OD023268, U19AI095219, and U01HL089856), as well as the Office of the Assistant Secretary of Defense for Health Affairs, through the Traumatic Brain Injury and Psychological Health Research Program (Focused Program Award) under Award No. (W81XWH-22-S-TBIPH2), endorsed by the Department of Defense. X.-W.W. acknowledges the funding support from National Institutes of Health (K25HL166208).

Footnotes

Code availability. The code used in this work is available at https://github.com/spxuw/DKI.

Competing Interests. The authors declare no competing interests.

Data availability.

Gut microbiome data was collected from curatedMetagenomicData41 database. Oral microbiome data is available at CNGB Sequence Archive (CNSA) of China National GeneBank DataBase (CNGBdb) (CNSA: CNP0000687 for the 4D-SZ cohort and CNP0001221 for the Yunnan cohort). Coral and soil microbiome data were collected from Qiita42 (IDs: 10895 and 2104). Source data supporting all our findings are provided with this publication as a Source Data file. Source data are provided at https://github.com/spxuw/DKI.

References

  • 1.Paine RT A note on trophic complexity and community stability. The American Naturalist 103, 91–93 (1969). [Google Scholar]
  • 2.Paine RT Food web complexity and species diversity. The American Naturalist 100, 65–75 (1966). [Google Scholar]
  • 3.Cottee-Jones HEW & Whittaker RJ The keystone species concept: a critical appraisal. Front Biogeogr 4: 117–127. (2012). [Google Scholar]
  • 4.WJ P Challenges in the quest for keystones. BioScience 46, 609620 (1996). [Google Scholar]
  • 5.Ze X, Duncan SH, Louis P & Flint HJ Ruminococcus bromii is a keystone species for the degradation of resistant starch in the human colon. ISME J 6, 1535–1543 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Banerjee S et al. Network analysis reveals functional redundancy and keystone taxa amongst bacterial and fungal communities during organic matter decomposition in an arable soil. Soil Biology and Biochemistry 97, 188–198 (2016). [Google Scholar]
  • 7.Trosvik P & de Muinck EJ Ecology of bacteria in the human gastrointestinal tract—identification of keystone and foundation taxa. Microbiome 3, 44 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Xun W et al. Specialized metabolic functions of keystone taxa sustain soil microbiome stability. Microbiome 9, 1–15 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.LeBlanc N & Crouch JA Prokaryotic taxa play keystone roles in the soil microbiome associated with woody perennial plants in the genus Buxus. Ecology and evolution 9, 11102–11111 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.The Human Microbiome Project Consortium. Structure, function and diversity of the healthy human microbiome. Nature 486, 207–214 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Franzosa EA et al. Identifying personal microbiomes using metagenomic codes. Proceedings of the National Academy of Sciences 112, E2930–E2938 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Vujkovic-Cvijin I et al. Host variables confound gut microbiota studies of human disease. Nature 587, 448–454 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Stein RR et al. Ecological modeling from time-series inference: insight into dynamics and stability of intestinal microbiota. PLoS computational biology 9, e1003388 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Fisher CK & Mehta P Identifying Keystone Species in the Human Gut Microbiome from Metagenomic Timeseries Using Sparse Linear Regression. PLoS ONE 9, e102451 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Bucci V et al. MDSINE: Microbial Dynamical Systems INference Engine for microbiome time-series analyses. Genome biology 17, 1–17 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Berry D & Widder S Deciphering microbial interactions and detecting keystone species with co-occurrence networks. Frontiers in microbiology 5, 219 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Banerjee S, Schlaeppi K & van der Heijden MGA Keystone taxa as drivers of microbiome structure and functioning. Nat Rev Microbiol 16, 567–576 (2018). [DOI] [PubMed] [Google Scholar]
  • 18.Garrett WS et al. Enterobacteriaceae act in concert with the gut microbiota to induce spontaneous and maternally transmitted colitis. Cell host & microbe 8, 292–300 (2010). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Hajishengallis G et al. Low-abundance biofilm species orchestrates inflammatory periodontal disease through the commensal microbiota and complement. Cell host & microbe 10, 497–506 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Agler MT et al. Microbial hub taxa link host and abiotic factors to plant microbiome variation. PLoS biology 14, e1002352 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Banerjee S, Schlaeppi K & van der Heijden MG Reply to ‘Can we predict microbial keystones?’ Nature Reviews Microbiology 17, 194–194 (2019). [DOI] [PubMed] [Google Scholar]
  • 22.Röttjers L & Faust K Can we predict keystones? Nature Reviews Microbiology 17, 193–193 (2019). [DOI] [PubMed] [Google Scholar]
  • 23.Amit G & Bashan A Top-down identification of keystone taxa in the microbiome. Nat Commun 14, 3951 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Valls A, Coll M & Christensen V Keystone species: toward an operational concept for marine biodiversity conservation. Ecological Monographs 85, 29–47 (2015). [Google Scholar]
  • 25.Tian L et al. Deciphering functional redundancy in the human microbiome. Nature communications 11, 1–11 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Gouveia C, Móréh Á & Jordán F Combining centrality indices: Maximizing the predictability of keystone species in food webs. Ecological Indicators 126, 107617 (2021). [Google Scholar]
  • 27.Kruse R, Mostaghim S, Borgelt C, Braune C & Steinbrecher M Multi-layer perceptrons. in Computational Intelligence 53–124 (Springer, 2022). [Google Scholar]
  • 28.He K, Zhang X, Ren S & Sun J Deep residual learning for image recognition. in Proceedings of the IEEE conference on computer vision and pattern recognition 770–778 (2016). [Google Scholar]
  • 29.Michel-Mata S, Wang X-W, Liu Y-Y & Angulo MT Predicting microbiome compositions from species assemblages through deep learning. iMeta 1, e3 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Almeida-Neto M, Guimaraes P, Guimaraes PR Jr, Loyola RD & Ulrich W A consistent metric for nestedness analysis in ecological systems: reconciling concept and measurement. Oikos 117, 1227–1239 (2008). [Google Scholar]
  • 31.Friedman J, Higgins LM & Gore J Community structure follows simple assembly rules in microbial microcosms. Nat Ecol Evol 1, 0109 (2017). [DOI] [PubMed] [Google Scholar]
  • 32.Pasolli E et al. Accessible, curated metagenomic data through ExperimentHub. Nature methods 14, 1023–1024 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 33.Tian L et al. Deciphering functional redundancy in the human microbiome. Nat Commun 11, 6217 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 34.Tudela H, Claus SP & Saleh M Next Generation Microbiome Research: Identification of Keystone Species in the Metabolic Regulation of Host-Gut Microbiota Interplay. Front. Cell Dev. Biol 9, 719072 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Alessandri G, van Sinderen D & Ventura M The genus Bifidobacterium: from genomics to functionality of an important component of the mammalian gut microbiota. Computational and Structural Biotechnology Journal 19, 1472–1487 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Zhang Z et al. Spatial heterogeneity and co-occurrence patterns of human mucosal-associated intestinal microbiota. The ISME journal 8, 881–893 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37.Leylabadlo HE et al. The critical role of Faecalibacterium prausnitzii in human health: An overview. Microbial pathogenesis 149, 104344 (2020). [DOI] [PubMed] [Google Scholar]
  • 38.Gotoh A, Ojima MN & Katayama T Minority species influences microbiota formation: the role of Bifidobacterium with extracellular glycosidases in bifidus flora formation in breastfed infant guts. Microbial biotechnology 12, 259–264 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.Bui TPN et al. Intestinimonas-like bacteria are important butyrate producers that utilize Nε-fructosyllysine and lysine in formula-fed infants and adults. Journal of functional foods 70, 103974 (2020). [Google Scholar]
  • 40.Li L et al. Revealing proteome-level functional redundancy in the human gut microbiome using ultra-deep metaproteomics. Nature Communications 14, 3428 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41.Pasolli E et al. Accessible, curated metagenomic data through ExperimentHub. Nature methods 14, 1023–1024 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Ramirez KS et al. Biogeographic patterns in below-ground diversity in New York City’s Central Park are similar to those observed globally. Proceedings of the royal society B: biological sciences 281, 20141988 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 43.Friedman J & Alm EJ Inferring correlation networks from genomic survey data. PLoS computational biology 8, e1002687 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplementary Discussions 1–8 and Figs. 1–14

Data Availability Statement

Gut microbiome data was collected from curatedMetagenomicData41 database. Oral microbiome data is available at CNGB Sequence Archive (CNSA) of China National GeneBank DataBase (CNGBdb) (CNSA: CNP0000687 for the 4D-SZ cohort and CNP0001221 for the Yunnan cohort). Coral and soil microbiome data were collected from Qiita42 (IDs: 10895 and 2104). Source data supporting all our findings are provided with this publication as a Source Data file. Source data are provided at https://github.com/spxuw/DKI.

RESOURCES