Introduction

Shifts in the mammalian gut microbiota often occur during pathogen infection and can influence disease outcomes [1, 2]. As such, there is growing interest in using infection-induced changes in the microbiota as biomarkers of disease status and progression [3,4,5]. However, observed changes in the gut microbiota during infection are rarely consistent, even with respect to single pathogens [6]. For example, the effects of human immunodeficiency virus (HIV) infection on gut microbial diversity vary dramatically [7]. In some cases, HIV-infected patients show higher gut microbial diversity than healthy controls [8], while in others, HIV patients show lower microbial diversity than healthy individuals [9]. Similarly, microbiota patterns vary across pathogens. For instance, Clostridium difficile infection is typically characterized by decreases in gut microbiota diversity [10], while Mycobacterium tuberculosis (Mtb) infection can increase gut microbial diversity [11, 12]. These inconsistencies were quantified in a recent meta-analysis comparing the gut microbiota of helminth-infected and helminth-uninfected hosts. Among non-rodent hosts there was no evidence of a systematic effect of helminth infection on microbial diversity, whereas microbial diversity generally decreased in the presence of helminth infection among rodent hosts [13]. Thus, understanding when and how pathogens affect the gut microbiota likely requires consideration of not only simple infection presence and absence, but also the context in which infection occurs.

Features of the infection process may themselves influence how the gut microbiota responds to infection [6]. First, although many studies investigate how single infections affect the microbiota, most humans and animals are concurrently infected with multiple pathogens simultaneously [14, 15]. Importantly, coinfection can dampen or amplify protective host immune responses [15, 16]. Host immunity is also strongly linked to changes in gut microbiota composition [1, 17], suggesting a mechanism by which coinfection could modify microbiota shifts in response to a focal infection. In support, a study of helminth-infected humans found that while a single-species helminth infection did not lead to changes in the gut microbiota, shifts in microbial abundance were apparent among those coinfected with multiple helminth species [18]. Second, hosts often vary in how long they have been infected with a pathogen, with the strength and function of the immune response to infection changing over time [19,20,21]. Accounting for these two key sources of infection heterogeneity might help better uncover how infections shape the gut microbiota.

In addition to differences in infection status, hosts also vary in a number of other traits such as diet and age that often emerge as strong predictors of gut microbiota patterns [22,23,24,25]. Consequently, infection-induced shifts in the gut microbiota can also be influenced by host heterogeneity [6, 26,27,28,29]. For example, gut microbial changes in astrovirus-infected wild bats depended on host age—infection was associated with a decrease in gut microbial diversity of young bats, but an increase in microbial diversity of adults [27]. Likewise, underlying variation in host environment can shape the microbiota and its response to infection. For example, helminth infection had different effects on the abundance of gut microbes in human patients from Liberia versus Indonesia [26]. Given the importance of host and environmental factors in shaping gut microbiota composition, considering demographic and environmental heterogeneity among hosts is likely crucial to understanding infection–microbiota relationships.

In this study, we examined the context-dependence of infection–microbiota relationships by testing the independent and combined effects of two infections on the gut microbiota of wild African buffalo (Syncerus caffer). African buffalo are host to a range of pathogens [30], including bovine tuberculosis (TB; causative agent Mycobacterium bovis, Mb) and gastrointestinal (GI) helminths (strongyle nematodes; Nematoda: Strongylidae). Interactions between these two infections are well-characterized in the buffalo system [31,32,33] and generate considerable variation in host immunity, which might feed back to shape the gut microbiota. In buffalo, coinfection with nematodes weakens protective immunity to Mb and exacerbates TB disease severity [33, 34]. Furthermore, in cattle, Mb infection causes chronic TB disease characterized by the upregulation of different immune components in early- versus late-stage infection [19]. Since human and rodent studies have not revealed consistent microbiota shifts during either TB [4] or helminth infections [6, 13], TB-helminth coinfection provides an ideal system to investigate if infection-induced shifts in the microbiota depend on coinfection or the time course of infection. To do this, we analyzed the gut microbiota of buffalo from a longitudinal study where TB incidence of anthelmintic-treated and control buffalo was monitored every 6 months [33]. First, we asked whether TB infection or anthelmintic treatment alone explained variation in the buffalo microbiota and if TB-nematode coinfection, represented by the interaction between TB status and anthelmintic treatment, modified these relationships. Second, we asked if effects of TB on the gut microbiota changed over the course of TB infection. For all analyses, we also accounted for the potentially confounding effects of variation in host demography and environment. By considering heterogeneities in infection status, demography, and environment, we characterized microbial shifts associated with TB and nematode infection and identified important drivers of variation in infection–microbiota relationships.

Materials and methods

Animal sampling

We captured and sampled wild female African buffalo (Syncerus caffer) in Kruger National Park, South Africa from 2008 to 2012 [33]. Prior to this study, buffalo were not subject to any veterinary interventions. At initial capture, animals were radio-collared and randomly assigned to a control or anthelmintic treatment group. At initial capture and all subsequent captures, treated animals received a slow-release fenbendazole bolus (Panacur, Intervet) placed in the rumen, while control animals received nothing [33]. Fenbendazole is effective against nematodes that comprise most of the buffalo GI helminth community, including Cooperia fuelleborni, Haemonchus placei, Haemonchus bedfordi, and Trichostrongylus sp. [35, 36], and our treatment regime significantly reduced both the occurrence (by 55%) and intensity (by 73%) of nematode infection in treated animals [33].

Animals were captured about every 180 days and at each capture we collected blood and fecal samples, assessed age and pregnancy status [37], and scored body condition on a 1–5 point scale, with higher scores indicating better condition [38]. Blood samples were used to test for TB infection using a whole-blood gamma interferon assay (BOVIGAM, Prionics) optimized for African buffalo [33]. Fecal samples were used to monitor host diet quality and gut microbiota composition. Diet quality was measured as fecal nitrogen content, which reliably tracks seasonal shifts in buffalo forage intake [39, 40]. Nitrogen analyses were performed using wet digestion followed by ammonia quantification on an Autoanalyzer [41]. A portion of each fecal sample was stored at −20 °C on the day of sample collection until DNA extraction for microbiota analysis. Microbial analyses were performed on 467 fecal samples from 149 individuals (age range: 29–192 months) sampled 1–6 times between June 2009 and December 2011.

Microbial DNA sequencing and bioinformatics

To characterize buffalo gut microbial communities, we used 16S rRNA gene sequencing. We prepared DNA libraries following standard Earth Microbiome Project protocols [42], with the exception that fecal DNA extractions were performed using the MO BIO PowerSoil DNA isolation kit with single PowerBead tubes rather than 96-well plates. The V4 region of the 16S rRNA gene was PCR-amplified using the 515 forward (5′-GTGCCAGCMGCCGCGGTAA-3′) and 806 reverse (5′-GGACTACHVGGGTWTCTAAT-3′) primer pair [43], with Golay error-correcting barcodes (12 bp) included on the reverse primer for sample identification. We sequenced purified amplicons on an Illumina HiSeq 2000 (2 × 100-bp read length) at the University of Colorado, Boulder [44].

Raw forward sequence reads were uploaded to Qiita (v. 0.1.0 [45]) for demultiplexing and quality filtering according to default parameters [46]. Reads <100 bp in length were discarded, and Deblur (v. 1.0.4 [47]) was used to cluster putative error-free reads into sub-operational taxonomic units (sOTUs), which are sequence variants with up to single-nucleotide resolution. Deblurred data were then exported to Quantitative Insights into Microbial Ecology 2 (QIIME2, v. 2018-4 [48]) for further processing. A phylogenetic tree was constructed using the fragment insertion method (v. 2018.2.0 [49]). To focus our analyses on abundant taxa, we removed sOTUs that comprised <0.01% of the data set. To control for uneven sequencing depth across samples, the data were rarefied to 10,000 sOTUs per sample [50]. Alpha and beta diversity metrics were calculated in QIIME2. Taxonomy was assigned with a naïve Bayesian classifier trained against sequences in the Greengenes 13.8 99% database [51] trimmed to 100 bp. Detailed descriptions of sequence processing methods are in the Supplementary material.

Statistical analyses

Overall, we analyzed the effects of single TB and nematode infection, TB-nematode coinfection, and TB infection duration on the buffalo fecal microbiota by modeling four microbiota characteristics. (i) We measured microbial community structure using beta (between-sample) diversity metrics that are weighted by sOTU abundance: weighted UniFrac distance and Bray–Curtis dissimilarity. (ii) We measured microbial composition using unweighted beta diversity metrics that are based on sOTU presence-absence: unweighted UniFrac distance and the Jaccard index. (iii) We measured microbial diversity using alpha (within-sample) diversity metrics: sOTU richness, Faith’s phylogenetic diversity (PD) index, Pielou’s evenness, and Shannon’s diversity index. (iv) We measured microbial abundance by collapsing sOTU abundances at the genus level, resulting in 103 genera abundances. Furthermore, we incorporated a series of host traits and environmental variables as covariates into all of our analyses to account for the effects of host and environmental heterogeneity on gut microbial communities [23, 52,53,54], including: diet quality (fecal nitrogen content), age, year, body condition score, pregnancy status, and season (wet versus dry [55]).

Effects of single and coinfection on the gut microbiota

To evaluate effects of single and coinfection on microbial community structure and composition, we tested the effects of TB infection status, anthelmintic treatment, and their interaction on weighted and unweighted microbial beta diversity using permutational multivariate analysis of variance (PERMANOVA). Distance matrices of pairwise differences between samples were imported from QIIME2 and square-root transformed in vegan. Model predictors included host traits and environmental variables (fecal nitrogen content, age, year, body condition score, pregnancy status, and season), single infections (TB status and anthelmintic treatment), and coinfection (the interaction between TB status and anthelmintic treatment). Because the significance of model predictors is assessed sequentially, we ordered host and environmental covariates according to the number of microbial genera each affected in our analysis of microbial abundance, then tested for effects of infection. To account for repeated sampling of individuals, we restricted permutations within blocks specified by animal ID using permute (v. 0.9-4 [56]). PERMANOVAs were implemented in R with the adonis2 function in vegan (v. 2.5-2 [57]).

To evaluate effects of single and coinfection on microbial diversity, we used linear mixed models (LMMs) to test if TB status, anthelmintic treatment, or their interaction was associated with changes in microbial alpha diversity. Diversity values were normalized using Box–Cox transformations, then scaled without centering prior to analysis (Shapiro–Wilk’s test, W > 0.974). Model predictors included host traits and environmental variables (fecal nitrogen content, age, year, body condition score, season, pregnancy status), single infections (TB status and anthelmintic treatment), and coinfection (the interaction between TB status and anthelmintic treatment). To account for repeated sampling of individuals, animal ID was included as a random effect. LMMs were implemented in R using lme4 (v. 1.1–21 [58]) and lmerTest (v. 3.0-1 [59]). R2 values for LMMs were calculated using partR2 (v. 0.9.0 [60]). For models with a significant interaction effect, we used the difflsmeans function with Benjamini–Hochberg correction to identify significant differences in marginal means across the levels of interacting factors [59]. We were interested in four contrasts: (i) TB-negative, control vs. TB-negative, treated; (ii); TB-positive, control vs. TB-positive, treated; (iii) TB-negative, control vs. TB-positive, control; (iv) TB-negative, treated vs. TB-positive, treated.

To evaluate effects of single and coinfection on microbial abundance, we modeled genera abundance using a multivariate linear model (MLM) implemented in R with the manylm function in mvabund (v. 4.1.3 [61]). Since reference frames help account for the compositional nature of microbial abundance data [62], we transformed genera abundance counts into log-ratios prior to analysis. To do this, we added a pseudocount of 1 to rarefied counts, divided these counts by the abundance of a reference taxon (Ruminococcus), and then calculated the natural logarithm of each ratio. Sparsity of the data set was low (82.5% nonzero), suggesting that the addition of pseudocounts should not introduce bias. We chose Ruminoccocus as the reference taxon because it was found in all samples, improved the normality of log-ratio distributions and model residuals, and was insensitive to effects of infection in preliminary analyses (see Supplementary methods; Table S1). To account for repeated sampling of individuals, we used a restricted permutation approach. We generated a permutation matrix in which samples were permuted within blocks specified by animal ID using permute, then used the matrix to run the MLM with the “bootID” argument in mvabund [63]. The MLM fits separate linear models to each of the 102 log-ratios to test for associations between model predictors and microbial abundance at both the multivariate (global community) and univariate (individual taxa) levels. Model predictors included host traits and environmental variables (fecal nitrogen content, age, year, body condition score, season, pregnancy status), single infections (TB status and anthelmintic treatment), and coinfection (the interaction between TB status and anthelmintic treatment). Test statistics were estimated using likelihood ratio tests and p values were calculated using residual resampling. To account for correlations among multivariate response variables, we fit an unstructured correlation matrix to the abundance data using the cor.type = “R” argument in mvabund. Univariate tests were adjusted for multiple testing via a resampling-based Holm step-down procedure [63]. For the top ten taxa emerging with a significant interaction effect, we used individual LMMs and post hoc tests as above to identify significant differences across interacting factors.

Effects of infection duration on the gut microbiota

To evaluate the effect of TB infection duration, rather than TB status alone, on gut microbial community structure, composition, and diversity, we analyzed data from a subset of 14 buffalo that converted from TB-negative to TB-positive during the study period. For each animal, the last TB-negative sample collected prior to TB conversion was used to represent the baseline microbiota. This way, we could assess temporal patterns during infection relative to the most recent time point without infection. Across individuals, subsequent TB-positive samples were collected 78–539 days post-TB conversion, and categorized according to whether they were collected within 6, 12, or 18 months of the focal animal’s baseline TB-negative sample. To quantify TB duration effects on the microbiota during single TB infection and TB-nematode coinfection, we ran analyses separately in anthelmintic-treated and control buffalo. This resulted in a sample size of 18 for anthelmintic-treated animals (n0 = 7, n6 = 5, n12 = 3, n18 = 3) and 20 for control animals (n0 = 7, n6 = 4, n12 = 6, n18 = 3).

We tested for an effect of time since TB conversion (0, 6, 12, or 18 months) on microbial community structure and composition, measured as weighted and unweighted beta diversity, using PERMANOVAs. Model predictors included TB duration, as well as fecal nitrogen content, year, and season given the strong effects of these variables in analyses performed on the full data set (see Tables S2 and S3). Model permutations were restricted by animal ID. Finally, we tested for an effect of time since TB conversion on microbial alpha diversity using LMMs. Alpha diversity values were Box–Cox-transformed and scaled without centering for analysis. In these models, season was included as a key covariate (see Table S4) and animal ID was included as a random effect. Pairwise differences between time points were assessed using difflsmeans with Benjamini–Hochberg correction. Given the limited sample size for TB duration analyses, we could not calculate partial R2 values for the LMMs or account for all host and environmental variables simultaneously. For variables we did not include (age, body condition score), we ran a set of alternative models substituting in these variables as covariates.

Results

Host traits and environmental variables influence gut microbial patterns

The fecal microbiota of African buffalo was dominated by Firmicutes (mean relative abundance: 58%) and Bacteroidetes (35%) at the phylum level (Fig. S1a), and Ruminococcaceae (39%), Bacteroidaceae (15%), and Lachnospiraceae (5%) at the family level (Fig. S1b). At the genus level, the most abundant taxa were an unidentified Ruminococcaceae genus (35%), an unidentified Bacteroidales genus (8%), and 5-7N15 (Bacteroidaceae; 7%). Genera common to ruminant intestinal microbiota, such as Oscillospira, Dorea, Methanobrevibacter, Roseburia, Akkermansia, and Ruminococcus were also present, each comprising ~1–2% of the total community (Fig. 1a).

Fig. 1: Characterization of the African buffalo gut microbiota.
figure 1

a Genus-level composition profile representing average relative abundance values across all samples. bd Gut microbial diversity, as measured by sub-operational taxonomic unit (sOTU) richness, was negatively associated with b fecal nitrogen content, a measure of intake diet quality, c age, and d body condition. Fitted lines constructed from a linear mixed model and shaded areas represent standard errors. Diversity values are Box–Cox-transformed and scaled.

Host traits and environmental variables had a range of effects on the gut microbiota. Effects on microbial community structure (weighted beta diversity) and composition (unweighted beta diversity) were generally weak to moderate. Fecal nitrogen content (R2 range = 0.027–0.030, p = 0.001), age (R2 = 0.007, p = 0.001), year (R2 range = 0.042–0.101, p = 0.001), and body condition score (R2 range = 0.006–0.007, p = 0.001) each explained ~0.6–10% of between-sample variation in microbial community structure, measured as weighted UniFrac distance and Bray–Curtis dissimilarity (Table S2). In addition, season explained 0.4% of variation in Bray–Curtis dissimilarity (R2 = 0.004, p = 0.001), while its effect on weighted UniFrac distance was marginal (R2 = 0.003, p = 0.073; Table S2); and pregnancy status explained 0.3% of variation in Bray–Curtis dissimilarity (R2 = 0.003, p = 0.029), but had no effect on weighted UniFrac distance (R2 = 0.002, p = 0.131; Table S2). In terms of microbial community composition, fecal nitrogen content (R2 range = 0.028–0.036, p = 0.001), age (R2 = 0.007, p = 0.001), year (R2 range = 0.021–0.024, p = 0.001), body condition score (R2 range = 0.009–0.010, p = 0.001), pregnancy status (R2 = 0.003, p ≤ 0.011), and season (R2 = 0.005, p = 0.001) each explained ~0.3–3.6% of the variance in unweighted UniFrac distance and the Jaccard index (Table S3).

For within-sample microbial diversity (alpha diversity), the effects of host traits and environmental variables ranged from weak to strong. Fecal nitrogen content (LMM: R2 range = 0.018–0.167, p ≤ 0.001; Fig. 1b), age (R2 range = 0.018–0.027, p ≤ 0.013; Fig. 1c), and body condition score (R2 range = 0.016–0.042, p ≤ 0.005; Fig. 1d) were all negatively correlated with gut microbial diversity, explaining ~1.6–16.7% of the variation across measures of alpha diversity (Table S4). Season affected microbial diversity as measured by sOTU richness and Faith’s PD index (R2 range = 0.011–0.019, p ≤ 0.003), but not Pielou’s evenness or Shannon’s diversity index (R2 range = 0.001–0.002, p ≥ 0.235; Table S4); and year affected microbial diversity as measured by Pielou’s evenness and Shannon’s diversity index (R2 range = 0.000–0.006, p ≤ 0.040), but not sOTU richness or Faith’s PD index (R2 range = 0.000–0.002, p ≥ 0.336; Table S4). In contrast, pregnancy status was not significantly associated with any measure of microbial diversity (R2 range = 0.000–0.001, p ≥ 0.446; Table S4).

Last, the effects of host traits and environmental variables on microbial abundance were comparatively strong. At the community level, microbial abundance was significantly associated with fecal nitrogen content, age, year, body condition score, pregnancy status, and season (Table 1); and some of these variables predicted the abundance of a large fraction of individual microbial genera (Table S5 and Fig. 2). Fecal nitrogen content predicted the abundance of 74% of taxa (75 of 102; Fig. S2), age predicted the abundance of 68% of taxa (69 of 102; Fig. S3), year predicted the abundance of 17–54% of taxa (17–55 of 102; Fig. S4), and body condition score predicted the abundance of 22% of taxa (22 of 102; Fig. S5). In contrast, pregnancy status and season were poor predictors of microbial abundance, affecting one taxon and no taxa, respectively (Table S5).

Table 1 Host traits and environmental variables, single infections, and coinfection shaped community-level patterns of microbial genera abundance in the African buffalo gut microbiota.
Fig. 2: Host traits and environmental variables, single infections, and coinfection shaped abundance patterns of individual microbial genera in the African buffalo gut microbiota.
figure 2

Bar plot illustrating the number of microbial taxa whose abundances were significantly influenced by host and environmental variables (open bars), single infections alone (gray bars), or bovine tuberculosis (TB)-nematode coinfection (black bar), as determined by univariate tests from a multivariate linear model.

Coinfection can modify the effects of single infections on gut microbial patterns

Compared to the effects of host traits and environmental variables, single infections had few effects on the gut microbiota, but some of these effects were modified by coinfection. After accounting for host and environment-related covariates, TB infection status explained 0.2% of the between-sample variation in microbial community structure as measured by Bray–Curtis dissimilarity (PERMANOVA: R2 = 0.002, p = 0.018; Table S2), while its effect on weighted UniFrac distance was similarly weak and marginal (R2 = 0.002, p = 0.054; Table S2). Anthelmintic treatment had no effect on community structure (R2 = 0.002, p ≥ 0.145; Table S2). As with microbial community structure, TB infection status showed weak effects on community composition, explaining 0.2% of observed variance in composition as measured by both unweighted UniFrac distance and the Jaccard index (R2 = 0.002, p ≤ 0.019; Table S3 and Fig. 3a). Again, anthelmintic treatment had no effect (R2 range = 0.002–0.003, p ≥ 0.613; Table S3). Furthermore, the interaction between TB status and anthelmintic treatment had no effect on either microbial community structure (R2 range = 0.002–0.003, p ≥ 0.185; Table S2) or composition (R2 = 0.003, p ≥ 0.274; Table S3).

Fig. 3: Single infections and coinfection had weak effects on African buffalo gut microbial community composition and diversity.
figure 3

a Principle coordinate analysis (PCoA) of Jaccard indices revealed that bovine tuberculosis (TB) status predicted a small amount of variation in gut microbial community composition. Ellipses represent 95% confidence levels. b The interaction between TB status and anthelmintic treatment affected gut microbial diversity, as measured by sub-operational taxonomic unit (sOTU) richness. Post hoc tests revealed that differences in sOTU richness between anthelmintic-treated and control buffalo tended to be more prominent in TB-negative animals (p = 0.072) than in TB-positive animals (p = 0.559). Fitted points constructed from a linear mixed model and error bars represent standard errors. “ns” indicates nonsignificant contrasts from post hoc tests. Diversity values are Box–Cox-transformed and scaled.

On the other hand, accounting for coinfection helped reveal effects of single infections on gut microbial diversity. After controlling for host traits and environmental variables, neither TB status (LMM: R2 = 0.000, p ≥ 0.861), nor anthelmintic treatment (R2 = 0.000, p ≥ 0.280) alone were associated with microbial diversity (Table S4). However, the interaction between TB status and anthelmintic treatment had a weak effect on sOTU richness (R2 = 0.008, p = 0.041; Fig. 3b) and a marginal effect on Faith’s PD index (R2 = 0.007, p = 0.057; Table S4), but no effect on Pielou’s evenness or Shannon’s diversity index (R2 range = 0.000–0.001, p ≥ 0.655; Table S4). Post hoc tests revealed that anthelmintic treatment tended to increase sOTU richness in TB-negative buffalo (p = 0.072), but this effect disappeared in TB-positive buffalo (p = 0.559; Fig. 3b).

Coinfection most strongly influenced the effects of single infections on gut microbial abundance. Both TB status and anthelmintic treatment shaped community-level patterns of microbial abundance (Table 1). However, TB-nematode coinfection, as shown by the interaction between TB status and anthelmintic treatment, also had a significant effect (Table 1). In parallel, while anthelmintic treatment predicted the abundance of 23% of taxa (23 of 102) and TB status predicted the abundance of 16% of individual taxa (16 of 102), the interaction between TB status and anthelmintic treatment predicted the abundance of 18% of taxa (18 of 102; Fig. 2). Examining the ten taxa that emerged with the strongest model support for the TB-anthelmintic treatment interaction (Table S5 and Fig. 4, S6) revealed that, for two taxa, coinfection changed the magnitude of single infection effects on gut microbe abundance. For example, TB affected the abundance of Methanosphaera in anthelmintic-treated buffalo, but this effect disappeared in control buffalo (MLM: TB status × anthelmintic treatment, LR = 14.8, p = 0.001; Table S5 and Fig. 4a). In addition, anthelmintic treatment affected the abundance of SHD-231 in TB-positive buffalo, but this effect disappeared in TB-negative buffalo (MLM: TB status × anthelmintic treatment, LR = 12.8, p = 0.001; Table S5 and Fig. 4b).

Fig. 4: Coinfection influenced the effects of single infections on the predicted abundance of gut microbial genera in African buffalo.
figure 4

The interaction between bovine tuberculosis (TB) status and anthelmintic treatment explained variation in the abundance of a Methanosphaera and b SHD-231. Post hoc tests revealed that coinfection changed the magnitude of relationships between single infections and genera abundance. Fitted points constructed from univariate tests of a multivariate linear model and error bars represent standard errors. Asterisks indicate significant contrasts among factor levels (p < 0.05) and “ns” indicates nonsignificant contrasts.

Duration of TB infection influences gut microbial patterns in coinfected animals

Accounting for another source of infection heterogeneity, the duration of infection, also unmasked effects of infection on the microbiota. Furthermore, these effects were more pronounced during coinfection. Although TB duration did not explain significant between-sample variation in microbial community structure (PERMANOVA: R2 range = 0.125–0.177, p ≥ 0.163; Table S6), it had a strong, context-dependent effect on microbial community composition. In control buffalo, TB duration explained ~17% of the variance in composition as measured by unweighted UniFrac distance (R2 = 0.174, p = 0.035) and the Jaccard index (R2 = 0.165, p = 0.030; Table S7 and Fig. 5a). In contrast, there was no effect of TB duration in anthelmintic-treated buffalo (PERMANOVA: R2 range = 0.162–0.165, p ≥ 0.564; Table S7 and Fig. 5b). Substituting age and body condition score as alternative covariates did not qualitatively change the observed effects of TB duration on microbial community structure (Table S8) or composition (Table S9).

Fig. 5: The duration of bovine tuberculosis (TB) infection affected African buffalo gut microbial community composition and diversity during TB-nematode coinfection.
figure 5

a, b Principle coordinate analysis (PCoA) of Jaccard indices revealed that TB duration explained significant variation in microbial community composition of control buffalo, but not anthelmintic-treated buffalo. Ellipses represent 95% confidence levels. c, d There was also a marginal association between TB duration and gut microbial diversity in control buffalo. Post hoc tests revealed that sub-operational taxonomic unit (sOTU) richness tended to increase between 0- and 12-months after TB conversion (p = 0.084) and decrease between 12- and 18-months after TB conversion (p = 0.084). However, TB duration was not associated with gut microbial diversity in anthelmintic-treated buffalo. Fitted points constructed from linear mixed models and error bars represent standard errors. Diversity values are Box–Cox-transformed and scaled.

The effect of TB duration on microbial diversity was also more pronounced during coinfection. In control buffalo, there was a marginal association between TB duration and sOTU richness (LMM: F = 3.688, p = 0.051; Fig. 5c) and Faith’s PD index (F = 2.886, p = 0.087), but not Pielou’s evenness or Shannon’s diversity index (F range = 0.347–1.249, p ≥ 0.340; Table S10). Post hoc comparisons revealed that sOTU richness tended to increase from 0- to 12-months post-TB conversion (p = 0.084) and decrease from 12- to 18-months post-TB conversion (p = 0.084; Table S11 and Fig. 5c). In contrast, there was no association between TB duration and microbial diversity in anthelmintic-treated buffalo (LMM: F range = 0.672–1.511, p ≥ 0.286; Table S10 and Fig. 5d). Again, substituting age and body condition score as alternative covariates did not qualitatively change the observed effects of TB duration on microbial diversity (Table S12).

Discussion

Changes in the gut microbiota are thought to influence outcomes of host pathogen infection, but our understanding of infection–microbiota relationships is challenged by conflicting results among studies. By studying the gut microbiota of a wild mammal and using a combination of anthelmintic treatment and natural acquisition of TB to compare microbiota patterns between single nematode infection (TB-negative, control), single TB infection (TB-positive, treated), and TB-nematode coinfection (TB-positive, control), we found that infection-associated microbiota shifts depended on both the presence of other pathogens and the duration of infection. Moreover, by taking advantage of natural heterogeneities in host traits, we showed that some effects of infection were nearly as important as demographic and environmental factors that are well-known drivers of gut microbial patterns. These results suggest that considering infection heterogeneity is crucial to understanding how pathogens shape the gut microbiota.

One of our key findings was that pathogen interactions can alter the effects of single infections on gut microbial patterns. Specifically, coinfection diminished some pathogen-associated shifts in microbial diversity and abundance. For example, nematode-associated decreases in sOTU richness tended to be weakened by TB, which might be explained by immune-mediated interactions between TB and nematodes. Nematodes suppress Th1 immunity in buffalo [33], and reduced Th1 immunity has been associated with reduced gut microbiota diversity in mice [64, 65]. Thus, the upregulation of Th1 immunity in response to TB infection may increase microbial diversity, explaining the tendency for buffalo with TB-nematode coinfection (TB-positive, control) to have similar levels of microbial diversity as buffalo with single TB infection (TB-positive, treated). Similarly, immune dynamics might explain why TB-associated differences in the abundance of a specific microbial genus, Methanosphaera, were dampened during coinfection. Methanosphaera stimulates Th17 and proinflammatory cell responses [66, 67], which contribute to TB defense [16]. However, helminth infections have been shown to decrease the abundance of methanogens [68]. Thus, while Methanosphaera may increase during TB infection alongside anti-TB immune responses, nematodes may counteract this effect during coinfection. Intriguingly, since nematodes might modulate host immunity by altering the gut microbiota [69,70,71], future work should explore whether nematode-associated decreases in Methanosphaera weaken anti-TB immunity during coinfection. Nonetheless, these results suggest that immune-mediated interactions between pathogens can mask microbiota changes induced by single infections.

Unlike the pattern we observed for Methanosphaera, coinfection amplified the effects of single pathogens on another microbial taxon, SHD-231. In this case, nonimmune-mediated interactions between pathogens may explain effects of coinfection on the microbiota. We found that helminth-associated differences in the abundance of SHD-231 were only observed in the presence of concurrent TB infection. Specifically, in TB-positive buffalo, control individuals had a lower abundance of SHD-231 than treated individuals. Additive effects of two species on the abundance of a third are a common outcome of species interactions [72, 73], including pathogen interactions [74, 75]. One common mechanism explaining such additive interactions is resource competition [76]. Both TB and nematode infections are frequently associated with changes in host nutrition [77, 78], and in combination, the two infections reduce buffalo body condition [31]. Both of these effects could have implications for substrate utilization by gut microbes [52, 79, 80]. Since SHD-231 abundance has been linked to dietary changes in wild primates [81] and domestic ruminants [82, 83], we speculate that TB-nematode coinfection may exacerbate single pathogen–microbe relationships via impacts on host nutrition and microbial resource availability. However, more research is required to fully understand the mechanisms by which pathogen interactions shape the gut microbiota.

It is important to note that we examined the effects of nematode infection on the gut microbiota by giving some buffalo an anthelmintic drug and this treatment itself may have affected the microbiota. However, the drug we used, fenbendazole, and related drugs, have not been found to have significant effects on the gut microbiota [84,85,86]. Thus, the effects of anthelmintic treatment we observed likely represent the effects of nematode removal rather than effects of the drug [85], although it is possible that the physical placement of the long-lasting fenbendazole bolus in the rumen of hosts also disturbed the microbiota. In addition, while our treatment effectively reduced nematode burdens compared to control buffalo, the incomplete clearance of nematodes in some treated individuals may have dampened the effects of treatment on gut microbes. Nonetheless, our repeated finding that the microbiota was affected by interactions between TB and anthelmintic treatment supports our conclusion that microbiota responses to infection can differ in the presence of other pathogens.

In addition to coinfection, accounting for the duration of infection also clarified how pathogens affect the microbiota. We found that TB duration explained more variation in microbial composition and diversity than TB status alone. This difference suggests that pathogen effects on the microbiota can change over time. For example, microbiota composition changed over the course of TB infection in coinfected, but not singly-infected, animals. In addition, there was a tendency for microbial diversity to increase early in TB infection (first 12 months of infection), then decrease later in infection (12- and 18-months post-infection). In Mtb-infected humans, changes in microbial diversity also varied with stage of TB infection [12]. Likewise, Mtb-infected mice showed similar trends in microbial diversity over time, with diversity decreasing shortly after Mtb challenge, then gradually increasing throughout infection, and decreasing prior to host death [87]. Interestingly, these diversity patterns appear to mirror changes in Th1 and Th2 immune responses [87,88,89]. Since Mb-infected cattle shift from Th1- to Th2-dominated responses as infection progresses [19], the diversity patterns we observed might also reflect immune dynamics. This immune mechanism is also consistent with our finding that temporal microbiota patterns were more pronounced in coinfected buffalo, which show reduced Th1 immune function and accelerated TB mortality [33]. Therefore, our results again point to a role for infection heterogeneities, especially those linked to immune variation, in shaping the gut microbiota.

Host demographic and environmental factors are common drivers of variation in the gut microbiota [22,23,24,25], and our observations support this pattern. We found that diet quality (fecal nitrogen content), age, and body condition were associated with all attributes of the buffalo gut microbiota we quantified. Surprisingly, though, some effects of single and coinfection on the gut microbiota were of comparable importance to these demographic and environmental variables. For example, single and coinfections affected nearly as many microbial genera (16–23%) as body condition and year (17–22%). Moreover, during coinfection, TB duration explained more variation (~17%) in microbiota composition than diet quality (~8–9%) or year (~12.5%). A similar pattern was described in a study of Trichostrongylus-infected rabbits, where infection appeared to have equal or larger effects on gut microbial diversity as nutritional constraints [29].

It is now recognized that pathogen dynamics cannot be fully understood by considering only single pathogens or time points of infection in isolation [90,91,92]. Yet, this perspective is rarely extended to the study of how pathogens affect the microbiota [6, 14]. Our findings emphasize that both coinfection and infection duration can alter effects of single pathogens on gut microbial patterns. In addition, these nuances in infection status had nearly as much influence on the microbiota as well-studied demographic and environmental factors. As such, acknowledging the heterogeneities that exist among real-world hosts may be key to improving our understanding of the gut microbiota and its relationship to infectious diseases across host–pathogen systems.