Skip to main content
PLOS Computational Biology logoLink to PLOS Computational Biology
. 2026 Mar 19;22(3):e1014083. doi: 10.1371/journal.pcbi.1014083

Epistasis mediates the role of negative frequency-dependent selection in bacterial strain structure

Martin Guillemet 1,2,3,*, Sonja Lehtinen 1,2,3
Editor: Tommy Tsan-Yuk Lam4
PMCID: PMC13029793  PMID: 41855219

Abstract

Strain structure is a well-documented phenomenon in many pathogenic and commensal bacterial species, where distinct strains persist over time exhibiting stable associations between genetic or phenotypic traits. This structure is surprising, particularly in highly recombinogenic species like Streptococcus pneumoniae, because recombination typically breaks down linkage disequilibrium, the non-random association of alleles at different loci. Recent work suggests that multi-locus negative frequency-dependent selection (NFDS) acts to maintain allelic diversity across bacterial genomes, a pre-requisite for the existence of patterns of linkage disequilibrium. Here, using modeling and genomic analysis, we show that multi-locus NFDS can also shape bacterial strain structure through epistatic effects between these loci. We develop models of two NFDS mechanisms – metabolic niche differentiation and competition-colonisation trade-offs – and show how they can produce epistasis. Notably, both models generate frequency-dependent epistasis. Unlike classical constant sign epistasis, this acts to either reinforce or weaken existing linkage disequilibrium, making observed allele associations contingent on the evolutionary history of the population. We then use a dataset of over 3000 S. pneumoniae genomes to test our model predictions, and make observations consistent with frequency-dependent epistatic effects on gene associations. Our results extend and generalise previous theoretical work on the role of antigen-specific acquired immunity (a diversity-maintaining mechanism) on allele associations. Overall, this work contributes to a better understanding of the evolutionary processes shaping the structure of bacterial populations, which is central to predictive modeling of multi-strain pathogens.

Author summary

Many bacterial species maintain distinct strains with stable genetic associations despite frequent recombination, which should break them down. We propose that mechanisms known to maintain genetic diversity also shape strain structure. Using epidemiological models and genomic analysis of a large Streptococcus pneumoniae dataset, we show that diversity-maintaining mechanisms combining across multiple genes can readily generate epistasis. Furthermore, this epistasis that can be frequency-dependent: it either reinforces existing associations, making structure contingent on history, or actively dismantles them. This contrasts with classical constant epistasis. Our findings provide a general mechanism linking the maintenance of diversity to the maintenance of its structure, contributing to the persistence of distinct strains in recombining bacteria and highlighting the role of evolutionary history in shaping pathogen populations.

Introduction

Many pathogenic and commensal bacterial species exist as distinct strains that are stable through time, a phenomenon referred to as strain structure. These strains can vary significantly in their phenotypic traits, such as immunological characteristics, antibiotic resistance, competitive abilities, or average duration of carriage [1–5]. For instance, certain strains of Streptococcus pneumoniae are more likely to cause invasive disease, impacting vaccine design and implementation [3]. Similarly, hyper-invasive clonal complexes in Neisseria meningitidis have been observed to persist and spread globally over several decades [1,2]. Strain structure is characterised by strong patterns of linkage disequilibrium (LD) over the whole genome, meaning that pairs of alleles tend to be found together more or less often than expected [6]. This leads to stable associations between phenotypic traits. For example, resistances to different antibiotics tend to co-occur [5], and pneumococcal strains characterised by a longer duration of carriage are more likely to be resistant [4]. Characterising the mechanisms leading to stable associations between phenotypes of interest is important for understanding the ecology of these traits and the dynamics of bacterial strains.

In the absence of recombination, widespread linkage disequilibrium and strain structure are fundamental consequences of clonal reproduction [6]. However, recombination breaks down this structure by shuffling alleles between different genetic backgrounds, thus eroding non-random associations between loci. Over time, in the absence of other factors, recombination is expected to lead to linkage equilibrium. The recombination rate required for strain structure to be eroded in the presence of genetic drift is not entirely clear. This also raises the question whether observed cases of linkage equilibrium arise because of recombination or because of selective forces which maintain a diversity of allele combinations. Nevertheless, especially in highly recombinogenic species such as S. pneumoniae [7], we would expect stable associations between accessory genes or core gene alleles to require active maintenance by selective forces – more specifically epistasis.

Epistasis refers to the interaction between genes at different loci, where the effect of one allele (or gene) on a phenotype is affected by the presence of one or more other alleles: the combined effect is different from the sum of the individual allele effects. Epistasis can stem from molecular interactions, for example with compensatory mutations that alleviate the cost of antibiotic resistance genes [8]. It can also arise from effects on distinct life-history traits because of how these life-history traits combine in the expression of fitness. For instance, antibiotic resistance is expected to be more advantageous to strains that have a long duration of carriage [4,9], and for most vaccine types, emerging resistance is expected to co-occur with virulence alleles [10]. More broadly, however, the extent to which observed allele associations across bacterial genomes arise from epistasis and the mechanisms giving rise to this epistasis are not fully understood.

Here, we explore the role of multi-locus negative frequency-dependent selection (NFDS) in giving rise to epistasis and in shaping bacterial strain structure. The work is motivated by the detection of widespread NFDS acting across bacterial genomes [11–13]. NFDS is a form of balancing selection which promotes allelic diversity through rare alleles having a selective advantage and thus maintains accessory genes at intermediate frequencies. The specific mechanisms maintaining the accessory genome are not fully characterised, and plausibly include a combination of NFDS and other forms of balancing selection (e.g., spatially or temporally fluctuating selection). Here, we specifically focus on NFDS mechanisms–the impact of fluctuating selection on allele associations has been studied previously (e.g., [5]). In epidemiological models, NFDS can arise through antigen-specific acquired immunity [14–16]; within-host niche differentiation (typically conceptualised as metabolic niches) [17] and trade-offs related to direct bacterial competition [18]. We are not aware of other mechanisms giving rise to NFDS in epidemiological models, although additional mechanisms may well exist. Note that here we use the term NFDS consistently with previous literature [11], which, in the case of acquired immunity, may not be strictly accurate [19] because the fitness of variants depends on their historical rather than current frequency. Previous modeling work has suggested NFDS acts to maintain strain structure when combined with asymmetric recombination favouring gene deletion over gene acquisition, through the emergence of outbreeding depression [20]. In this work, we suggest NFDS also shapes strain structure more directly, through epistasis, in particular frequency-dependent epistasis.

Previous models of multi-locus NFDS [11,20] have generally assumed selection acting on multiple loci combines additively. However, because NFDS is a complex form of selection involving feedback from the population composition, it is unclear what this assumption of additivity means biologically and whether it should hold, particularly for functionally related loci. For example, NFDS on antigenic alleles arises because antigen-specific acquired immunity makes transmission to previously colonised hosts more difficult, disadvantaging historically frequent antigens [21]. When considering multiple loci, how this NFDS combines across the loci depends on the relative strength of the immune response to strains carrying one versus two previously encountered antigens. There is no a priori reason to assume this should be additive. Indeed, there is considerable theoretical work exploring the effects of different assumptions on the associations between antigenic alleles [22–27], with recent work clarifying how the strength and specificity of cross-protection determine whether antigenic alleles are in LD [27].

Here, we expand and generalise these ideas beyond the role of antigenic loci in generating strain structure, to how NFDS mechanisms more generally impact allele associations. We show that multi-locus NFDS can – depending on how it combines across loci – either abolish or maintain strain structure through emerging frequency-dependent effects on allele combinations. We explore two multi-locus epidemiological models with different mechanisms of NFDS, metabolic niche differentiation and competition-colonisation trade-offs, to demonstrate how these effects arise. We then test specific predictions from these models in a dataset of more than 3000 pneumococcal isolates, showing patterns consistent with the frequency-dependent effects we predict.

Results

A simple model of multi-locus negative frequency-dependent selection

We begin by revisiting linkage disequilibrium in the multi-locus NFDS model from Corander et al. [11], in which NFDS combines additively across loci. Our goal here is not to provide new results, but rather to build intuitions and introduce concepts and terminology important to understand the rest of the paper.

This model considers a population of bacteria with two bi-allelic loci, resulting in four possible genotypes G={ab, Ab, aB, AB}. The dynamics of each genotype are governed by logistic growth with additive effects from NFDS at each locus. The growth rates (in the absence of recombination) of the genotype with alleles i and j are given by:

rij=r(1−Xtotκ)+ρ(pi*−pi)+ρ(pj*−pj) (1)

Here r is the intrinsic growth rate, κ is the carrying capacity, px is the frequency of allele x, px* is the allele frequency favoured by selection and ρ is the strength of NFDS (see Table 1 for the list of parameters). Under this model, NFDS acts independently on each allele, favouring alleles that are below their optimum frequency and disadvantaging those above it. This mechanism ensures that allele frequencies are maintained at an intermediate frequency, but is not expected to affect strain structure in the presence of recombination [20].

Table 1. List of parameters, their dimensions, and the values or ranges used in figures. The epidemiological parameters correspond to a basic reproduction number of 3 (in the plausible range for S. pneumoniae [44]). However, the specific values are not important: the key results relating the k parameters to the effect on strain structure (Equations 5 and 8) do not depend on the epidemiological parameters. The bounds on the k parameters (0,1) arise from the assumption that co-colonisation is not as efficient as primary colonisation, in line with empirical findings (e.g., [33]).

Symbol Description Dimension Value(s) in figures
Simple NFDS Model
r Intrinsic growth rate Time−1
κ Carrying capacity Population density
px* Allele frequency favoured by selection Dimensionless
ρ Strength of NFDS Time−1
Mechanistic models
b Birth rate Time−1 4
d Death rate Time−1 1
β0 Baseline transmission rate (Population density· Time)−1 2
γ Clearance rate Time−1 2
σ Recombination rate (Population density· Time)−1 0 – 0.05
q Scaling factor for transmission Dimensionless 0 – 1
from co-colonized hosts
Metabolic Niche Model
k0,k1,k2 Co-colonization efficiency parameters Dimensionless 0−1
k0<k1<k2
Competition-Colonization Trade-off Model
m Benefit associated with the colonizing allele Dimensionless 0.8-2.2
kΔ Co-colonization efficiency parameters Dimensionless 0−1
k−2<k−1<k0<k+1<k+2

To formalise this idea, we quantify LD using D:

D=pAB−pApB (2)

Thus, D = 0 indicates random association between alleles, while positive D indicates over-representation of AB and ab, and negative D indicates over-representation of Ab and aB. Note that we use the metric D for derivations, but prefer to use the metric D’ in figures as it is more readily interpretable and always bounded by −1≤D′≤1 independently of allele frequencies, see Methods. To understand the dynamics of LD, it is helpful to also define the individual additive selection coefficient [9] on allele A and B (wA and wB) and an epistatic term (wAB) as:

wA=rAb-rabwAB=rAB-rAb-raB+rab (3)

Introducing recombination, the dynamics of LD are given by [27]:

dDdt=∑G∈{A,B}DwG(1−2pG)+wAB(pApB+D)((1−pA)(1−pB)−D)+Δσ (4)

where Δσ is the net effect of recombination in the population on D. In the case of unbiased recombination, this is of sign opposite to current LD [28]. Note how the first term vanishes when the individual selection coefficients at each locus go to zero, i.e., when allele frequencies are at equilibrium. Finally, due to the bounds on the values of D, the term multiplying wAB is ≥0. Thus, when individual allele frequencies are at equilibrium, the sign of wAB drives the build-up of negative or positive LD.

Turning back to our model of multi-locus NFDS, when allele frequencies are optimal, the growth rate is the same for all genotypes (Equation 1), and thus epistasis wAB = 0. In other words, in the absence of recombination, this model predicts neither increasing nor decreasing effects on LD. Introducing recombination into the model (see Methods, section Multi-locus NFDS), we get Δσ=−σD where σ is the recombination rate. Recombination drives D towards 0 over time, confirming that in this model, NFDS combining additively across loci does not sustain strain structure under this recombination scheme.

Epidemiological models of NFDS give rise to frequency-dependent epistasis

It is unclear what the assumption about NFDS combining additively across loci in the phenomenological model means biologically. To understand this better, we now turn to epidemiological models of multi-locus NFDS where the diversity-maintaining mechanism is modeled explicitly. Specifically, we model two mechanisms of NFDS (Fig 1): within-host metabolic niches and a competition-colonisation trade-off. We use these models to explore how assumptions about the underlying biology impact how NFDS combines across loci and how this shapes strain structure.

Fig 1. NFDS models of metabolic niche or competition-colonisation trade-offs.

Fig 1

We represent the two epidemiological models for the case of one bi-allelic locus. In the metabolic niche model (left), co-colonisation rates are reduced when the resident and incoming strains share the same allele, modeled by parameters k1<k0. In the competition-colonisation model (right), allele a is “colonising”, leading to an increased rate of primary colonisation m, while the competitive allele A leads to higher rates of co-colonisation on average. Co-colonisation rates are dependent on the difference in number of competitive alleles between the incoming and the resident strain Δ through the parameters kΔ. λa and λA represent respectively the partial forces of infection of allele a and A, taking into account that strains in co-colonisation have reduced transmission rates through parameter q. Solid orange lines represent colonisation and dashed blue lines represent clearance.

Metabolic niche model

We begin by considering a model in which NFDS arises from within-host competition being stronger when strains are similar. Here we frame this as arising from metabolic niche overlap, although other effects such as strain-specific immunity could also give rise to the same model structure.

Model description. Again, we consider a two-locus, two-allele model (G={ab, Ab, aB, AB}). The full model structure is given in the Methods and the one locus case is represented in Fig 1 (see Fig A in S1 File Supplementary Information for the two-locus case). Briefly, hosts can be uncolonised (S), colonised with a single strain (I•) or co-colonised with two strains (I•,•). Colonisation is cleared at rate γ, hosts become colonised through density-dependent transmission at baseline rate β0. Onward transmission of each strain from a co-colonised host is scaled down by a factor q compared to singly colonised hosts, reflecting reduced density within the host. A resident strain inhibits co-colonisation by incoming strains, modifying the transmission rate to already colonised hosts by a competition efficiency parameter k:

  • k0 If the incoming strain differs from the resident strain at both loci (i.e., no shared alleles)

  • k1 If the incoming strain shares one allele with the resident strain

  • k2 If the incoming strain shares both alleles with the resident strain

These parameters represent metabolic niches wherein different alleles provide access to different resources, with k0>k1>k2. Strains sharing metabolic pathways (i.e., with the same allele at a locus) have a high niche overlap, competing for the same resources within the host, while strains with different metabolic capabilities (i.e., with different alleles) can coexist within a host more readily. This gives rise to NFDS at each locus, driving allele frequencies to 0.5 without the need for an explicit equilibrium frequency like was used in the phenomenological model (1) (see Supplementary Note A and Fig C in S1 File Supplementary Information for an analysis of the NFDS in the one-locus case). We explore in Fig B in S1 File Supplementary Information the neutral case (k0=k1=k2=1) to show that the model structure itself does not influence the gene frequencies and LD dynamics.

Metabolic niche differentiation leads to frequency-dependent effects on allele associations. To understand the dynamics of LD in this model, we derive the expression for epistasis wAB (Equation (3)). Assuming q = 1 for simplicity:

wAB=β0(IAB+Iab−IAb−IaB)(k0−2k1+k2) (5)

This expression indicates that epistasis is dependent on both the strain composition of the population and parameters relating to metabolic competition. The strain density term can be decomposed into the sum of the density of strains associated with positive LD (AB, ab), minus the sum of the density of strains associated with negative LD (Ab, aB). Thus, in this model, epistasis acts to reinforce or abolish existing LD, depending on the sign of the competition term.

The competition term (k0−2k1+k2) reflects how NFDS combines across loci:

If k1=(k0+k2)/2, NFDS combines additively across loci. Compared to co-colonising a host carrying an identical strain (i.e., two shared alleles, competition efficiency k2), each additional divergent allele provides the same additional benefit. In this case, epistasis is zero and there is no effect on strain structure.

If k1<(k0+k2)/2, NFDS combines super-additively (Fig 2a, red line). Compared to co-colonising a host carrying an identical strain (k2), one divergent allele (k1) provides a small benefit relative to two divergent alleles (k0). The biological interpretation here is that both loci are important: one private resource (k1) facilitates co-colonisation only to a limited extent compared to both resources being private (k0). The (k0−2k1+k2) term is positive: epistasis will therefore act to reinforce existing LD. This produces bistability (Fig 2b and Fig D in S1 File Supplementary Information): LD reaches either D′=±1 at equilibrium without recombination, depending on the initial sign of D.

Fig 2. Different competition regimes lead to maintenance or abolishment of strain structure.

Fig 2

In (a), we show how different values of the competition efficiencies k0, k1 and k2 influence epistasis and therefore strain structure according to Eq (5). Equilibrium D’ (t = 5000) is shown as a function of the competition parameters k1 and k2 in the absence (b) and the presence (c) of recombination. Müller plots in panel (b) show the dynamics of the cumulative frequencies of all genotypes through time, depending on the competition parameters, starting for an initial LD of D’ = 0.4. Some specific values of D’ are noted on panel (c). Parameter values used: β0=2,b=4,γ=2,d=1,k0=1,q=0.5, (b) σ=0 and (c) σ=0.02. Initial allele frequencies were initialised to pA=pB=0.5, and this was applied to every figure of this work unless stated otherwise.

If k1>(k0+k2)/2, NFDS combines sub-additively (Fig 2a, grey line). Compared to co-colonising a host carrying an identical strain (k2), one divergent allele (k1) provides a large benefit relative to two divergent alleles (k0). The biological interpretation here is that there is redundancy between the loci: one private resource (k1) facilitates co-colonisation to a large extent, and the benefit of the other additional resource is limited (k0). The (k0−2k1+k2) term is negative: epistasis will therefore act to abolish existing LD, driving D’ to zero at equilibrium (Figs 2b and D in S1 File Supplementary Information).

In other words, NFDS combining super-additively across loci gives rise to positive frequency dependent selection (PFDS) on pairs of non-overlapping genotypes (i.e., AB and ab, or Ab and aB). This reinforces existing strain structure. On the other hand, NFDS combining sub-additively across loci gives rise to NFDS on genotypes. This abolishes strain structure, even in the absence of recombination. The model is only neutral with respect to LD when NFDS combines precisely additively. These results are robust to relaxing the assumption q = 1 as long as q does not become too small, a regime where co-colonised hosts are considerably less infectious overall than singly colonised hosts (q = 0.1 for the parameter set we use, see Fig E in S1 File Supplementary Information). The behaviour is qualitatively unchanged for this metabolic competition model when we introduce asymmetry with one allele (a and b) at each locus conferring an additional benefit to transmission. The only exception is when this leads to the absence of the least fit genotype AB (see Supplementary Note B and Fig H in S1 File Supplementary Information). We also explore the effect of asymmetric recombination which could play an important role in maintaining strain structure [20]. We find that asymmetric recombination is slightly less destructive of LD than symmetric recombination (see Fig I in S1 File Supplementary Information).

Introducing recombination into the model (see Methods) accelerates the decay of LD when genotypes are under NFDS (Fig F in S1 File Supplementary Information). When genotypes are under PFDS, the addition of recombination has a two-fold effect (Fig 2). Firstly, the parameter space in which linkage disequilibrium is promoted decreases: in the presence of recombination, existing allele associations are abolished unless PFDS is strong enough to overcome its effects. Secondly, in the parameter space in which strain structure is maintained, D’ < 1 at equilibrium due to the balance between the effects of epistasis and recombination. These results are robust to deviations in initial allele frequencies (see Fig G in S1 File Supplementary Information), except for specific cases: (i) absence of epistasis without recombination where only the first terms of Equation 4 drive LD dynamics and (ii) PFDS with initial LD negative but close to zero, where the first terms of equation 4 can push LD towards a positive value early in the dynamics, and this positive LD is then reinforced by epistasis.

In summary, the metabolic niche model demonstrates that epistatic interactions resulting from NFDS processes combining across loci can lead either to abolishment or maintenance of allele associations, depending on the geometry of the generated fitness effects.

Competition-colonisation trade-off model

We now explore a second epidemiological model, in which NFDS arises through a different mechanism: a competition-colonisation trade-off. This type of NFDS arises when one allele provides an advantage in transmitting to uncolonised hosts (‘colonisation’) while the other leads to better rates of co-colonisation to already colonised hosts (‘competition’). This gives rise to NFDS because more colonisers decreases the ratio of uncolonised hosts to single infected hosts thus favouring competitors, and vice versa. This type of trade-off can arise from bacteriocin systems [29] or metabolic genes adapted to high vs low-nutrient (i.e., already colonised) environment.

Model description We use the same co-colonisation SIS framework, which is described in the methods, and the one locus case is represented in Fig 1 (see Fig A in S1 File Supplementary Information for the two-locus case). In this model, each locus has two alleles: a ‘colonising’ allele (a and b), which increases transmission to uncolonised hosts (S), and a ‘competitive’ allele (A and B), which increases transmission to already colonised hosts. We assume additive effects of the colonising alleles such that the primary colonisation rates of the i genotype, β(i,S) is:

β(ab,S)=β0(1+2m)β(Ab,S)=β(aB,S)=β0(1+m)β(AB,S)=β0 (6)

where (β0) is the baseline transmission rate and m is the benefit associated with the colonising allele. Transmission to already colonised hosts is modulated by kΔ, with Δ the difference in the number of competitive alleles between the incoming (i) and the resident (j) strains:

β(i,j)=β0kΔ(i,j) (7)

where Δ∈{−2,−1,0,1,2}. For example kΔ(Ab,AB)=k−1 and kΔ(AB,ab)=k+2, with 0≤k−2<k−1<k0<k+1<k+2≤1. Note that unlike the metabolic niche model, the alleles are not symmetric. However, genotypes Ab and aB are now phenotypically equivalent. This mechanistic model, similarly to the metabolic niche model, also gives rise to an equilibrium frequency favoured by selection, without it being an explicit component. We explore this model and the resulting NFDS and equilibrium frequency in the case of a single bi-allelic locus in Supplementary Note C and Fig J in S1 File Supplementary Information.

Competition-colonisation trade-offs lead to a variety of linkage disequilibrium patterns. The epistatic term wAB for q = 1 is given by (see Methods):

wAB=β0(Iab(k+2−2k+1+k0)+IAB(k−2−2k−1+k0)+(IaB+IAb)(k+1−2k0+k−1)) (8)

As before, this expression can be decomposed into k-parameter terms multiplying the densities of strains. For each Ii term, the corresponding k-parameter term captures information about how effectively genotypes can co-colonise hosts already carrying strain i. More specifically, each term reflects the impact of additional competitive alleles on the co-colonisation efficiency. For example, the first term (k+2−2k+1+k0) represents the difference between i) the incoming strain having two vs one competitive allele (k+2−k+1) and ii) the incoming strain having one vs no competitive alleles (k+1−k0). Thus, as before, these terms capture how effects combine across loci. Again, this can be represented by the geometry of the parameter curve (Fig 3a): negative terms correspond to the sub-additive effects (the second competitive allele has a smaller effect than the first) and a concave curve; positive terms correspond to super-additive effects (the second competitive allele has a greater effect than the first) and a convex curve.

Fig 3. The geometry of competitive interactions shapes epistasis and allelic associations in a competition-colonisation trade-off model.

Fig 3

(a) A linear relationship between all the competition parameters kΔ leads to additivity in how fitness effects combine across loci and thus no epistasis, see Eq (8). However a concave or a convex geometry will lead to epistasis of constant sign, as shown with solid lines. More complex geometries which are not purely concave or convex can produce epistasis which sign is frequency-dependent. The red dashed line scenario leads to PFDS wherein the most frequent pair of non-overlapping strains (those associated with either positive or negative linkage) is favoured. In contrast, the blue dashed line geometry leads to NFDS at the genotype level, favouring the least frequent pair of strains and thus abolishing allelic associations. D’ trajectories are shown in (b,c) using the parameter sets shown in panel (a), starting from both positive and negative initial D’. Other parameter values: β0=2,b=4,γ=2,d=1,q=1,m=1.3,σ=0. See Fig K in S1 File Supplementary Information and L in S1 File Supplementary Information for equilibrium LD from simulations for a wider range of parameters.

The consequences of how these effects combine across loci are more complex than in the metabolic niche model. If all terms are positive (i.e., the entire curve is convex), wAB is also always positive: competitive alleles are always most beneficial when on the same genome as their effect is synergistic, leading to positive LD (i.e., more ab and AB strains) (Fig 3b). Conversely, if all terms are negative (i.e., the entire curve is concave), wAB is also always negative: the effect of gaining additional competitive alleles is saturating as every additional allele provides a smaller benefit than the last, leading to negative LD (i.e., more Ab and aB strains) (Fig 3b).

The model gives rise to frequency-dependent epistasis when the curve of the competition parameters kΔ is not strictly concave or convex (Fig 3a), or in other words when the (ki+2−2ki+1+ki) terms in (8) are not all of the same sign. In these scenarios, an additional competitive allele can have either a synergistic or an antagonistic effect, depending on how many competitive alleles are already present. In this case, the overall effect on wAB depends on strain frequencies. For example, if the terms multiplying Iab and IAB (i.e., strains associated with positive LD) are positive and the term multiplying the IaB and IAb (i.e., strains associated with negative LD) is negative, wAB will have the same sign as the current LD. In other words, the model will give rise to PFDS on genotypes, reinforcing existing LD (Fig 3c). Conversely, if the terms multiplying Iab and IAB are negative and the term multiplying IaB and IAb positive, wAB will have the opposite sign to current LD, therefore abolishing allele associations and driving absolute LD down (Fig 3b). Note that the equilibrium D’ for the negative frequency-dependent epistasis case is not necessarily 0, and depends on the relative frequencies of AB and ab genotypes, which depends for instance on the value of m.

To explore a diversity of possible geometries, we illustrate in Fig K in S1 File Supplementary Information and L in S1 File Supplementary Information the equilibrium LD for a variety of parameter sets, as described in Supplementary Note D in S1 File Supplementary Information. These figures show the robustness of the results for q = 1 and q = 0.5. Note however that we adjust the value of the colonising benefit m to maintain an equilibrium frequency of 0.5. This is because a low value of q disproportionately affects the competitive alleles, which are more likely to be found in co-colonising strains. Overall, depending on how the effects of individual alleles combine across loci, competition-colonisation trade-offs can generate i) constant epistasis generating and maintaining structure, ii) PFDS on pairs of non-overlapping genotypes reinforcing pre-existing structure or iii) NFDS at the genotype level, abolishing structure.

Evidence for frequency-dependent effects on allele associations in S. pneumoniae

The key prediction from our models is that NFDS acting across multiple loci can give rise to frequency-dependent effects on allele associations. This prediction is difficult to test because, depending on parameter values, these effects can act to either abolish or reinforce allele associations. Furthermore, LD may also arise through other constant epistatic interactions between genes, or stochastic effects such as drift and hitch-hiking. Simply observing LD is thus not enough to discriminate between the mechanism suggested by our modeling and other possible causes. However, constant epistasis and PFDS make different predictions about LD across populations. Under constant epistasis, the same association is always favoured and the sign of LD must thus be the same across populations. PFDS, however, acts to reinforce existing structure; the sign of LD at equilibrium therefore depends on initial conditions. Pairs of genes with strong LD of different signs across different populations would therefore be consistent with PFDS, but not other forms of epistasis.

To test this idea, we examine patterns of linkage between 900 intermediate frequency genes across over 3000 pneumococcal genomes from three different locations: Thailand, Massachusetts and Southampton [30–32] represented in Fig M in S1 File Supplementary Information. To limit the impact of physical linkage on the chromosome, we apply a filter to only keep pairs of genes that are separated by at least 100kb on the genome. Note that this filtering is likely to remove some pairs of genes in strong positive epistasis (e.g., genes within the same operon).

We first analyse the functional categorisation of pairs of genes in LD (defined as |D’| > 0.6). Without the distance-based filtering, we find that pairs of genes sharing a function are more likely to be in LD than random gene pairs (Fig R in S1 File Supplementary Information). This effect is strongly decreased in the filtered dataset (Fig 4a), presumably due to the removal of genes for which proximity is an indicator of functional association (e.g., operons). Nevertheless, a significant effect remains where genes with certain functions are more likely to be strongly linked or unlinked to each other: cell cycle control, carbohydrate metabolism and transport, translation and inorganic ion transport and metabolism. Genes in the translation category “J” (which notably includes integrases and transposases) show the strongest overall linkage, potentially reflecting the role of mobile genetic elements in LD distribution.

Fig 4. Observed patterns of linkage disequilibrium in several populations.

Fig 4

(a) shows, according to the KEGG annotation of a focal gene, the probability to be in strong linkage disequilibrium (|D’| > 0.6) with any given gene. An asterisk on the diagonal signifies that there is significantly more linkage for that combination (two genes with a shared KEGG category) compared to the rest of the row/column (one gene of that category with genes of different categories). See Fig R in S1 File Supplementary Information for the extension of this figure to all genes, without the 100kb distance filtering. In (b,c), we study the distributions of absolute difference of LD across populations. We show for gene pairs highly linked in the Massachusetts dataset (|D’| > 0.6) the distribution of change in linkage compared to (b) the Southampton dataset or (c) the MaeLa dataset. The observed changes distributions are shown in green and the purple distributions show the changes in the simulated population. Note how there are fewer pairs of genes being shown for the simulated populations, consistent with the observation that there is overall less LD in the simulated than the real dataset (Fig P in S1 File Supplementary Information). See Fig S in S1 File Supplementary Information for all the population pairwise comparisons.

We then examine LD patterns across multiple populations, assessing the extent to which LD is conserved (strong LD of the same sign) or reversed (strong LD of opposite sign) across populations. For each pair of populations, we identify the set of gene pairs showing strong linkage (|D’| > 0.6) in a focal population and look at their LD in the second population (Figs 4b, 4c and S in S1 File Supplementary Information). To distinguish between patterns arising from epistatic selection and those resulting solely from clonal population structure, we compare observed LD patterns against a phylogenetically constrained null model. In this null model, we simulate the evolution of accessory genes in both populations along the inferred core genome phylogenies using transition rates calibrated to match observed gene mobility (see Methods). This generates a “neutral” dataset that preserves the phylogenetic structure of the populations but is devoid of specific epistatic interactions. We then compare the frequency of LD Conservation (maintaining |D’| > 0.6 with the same sign) and LD Reversal (switching to |D’| > 0.6 with the opposite sign) in the observed vs simulated data.

We find clear evidence of LD reversal when comparing the MaeLa population with the two other populations (Table 3): reversal is over twice as common as expected by chance (odds ratio (OR) >2 and p < 0.001, two-sided empirical test) for all comparisons. This excess of reversals cannot be explained by clonal structure alone and is consistent with frequency-dependent epistasis reinforcing local LD. In contrast, we see no significant deviation from the null model when comparing the two Western populations (Massachusetts and Southampton). This likely reflects greater mixing between these populations (Fig M in S1 File Supplementary Information).

Table 3. Significance of LD Reversal across populations and time (Two-Sided Empirical Test).

Comparison Focal Population N Pairs Observed Observed Prop. Rev. Simulated Prop. Rev. Odds Ratio p-value
MaeLa ↔ South MaeLa 11388 0.0587 0.0232 2.53 < 0.001
South 27428 0.0244 0.0044 5.60 < 0.001
Mass ↔ MaeLa Mass 27313 0.0113 0.0032 3.53 < 0.001
MaeLa 11388 0.0272 0.0122 2.22 < 0.001
Mass ↔ South Mass 27313 0.0059 0.0078 0.76 0.577
South 27428 0.0059 0.0056 1.05 0.921
Pre- ↔ Post-vaccine 2007 44450 0.0393 0.0416 0.94 0.709
2011 45410 0.0384 0.0402 0.96 0.752

The table shows linkage analysis results between population pairs using a two-sided empirical test. Columns represent: compared populations, which focal population was analysed (Focal Population), number of strong linkage pairs analysed in the observed datasets (N Pairs Observed), observed and simulated proportions of reversal events (Prop. Rev.) and p-values. The simulated reversal events proportion is the average over 1000 simulations. Odds-ratios over 1 are shown in bold.

The evidence for LD conservation is not consistent across populations (Table 2): we find that observed levels of conservation are often indistinguishable from, or even lower than, those expected from the null model. This suggests an absence of constant-sign epistasis acting between long-range gene pairs. As we remove physically close gene pairs, the analysis does not reflect potential constant-sign epistasis between genes in close proximity (e.g., positive epistasis within the same operon). Thus, for genes separated by large genomic distances, we do not find evidence that classical constant sign-epistasis consistently maintains specific allele associations across different geographical regions.

Table 2. Significance of LD Conservation across populations and time (Two-Sided Empirical Test).

Comparison Focal Population N Pairs Observed Observed Prop. Cons. Simulated Prop. Cons. Odds Ratio p-value
MaeLa ↔ South MaeLa 11388 0.2425 0.3198 0.76 < 0.001
South 27428 0.1007 0.0601 1.68 < 0.001
Mass ↔ MaeLa Mass 27313 0.1064 0.0746 1.43 < 0.001
MaeLa 11388 0.2551 0.2837 0.90 0.022
Mass ↔ South Mass 27313 0.3913 0.4260 0.92 0.007
South 27428 0.3896 0.3047 1.28 < 0.001
Pre- ↔ Post-vaccine 2007 44450 0.3483 0.3704 0.94 0.100
2011 45410 0.3409 0.3583 0.95 0.146

The table shows linkage analysis results between population pairs using a two-sided empirical test. Columns represent: compared populations, which focal population was analysed (Focal Population), number of strong linkage pairs analysed in the observed datasets (N Pairs Observed), observed and simulated proportions of conservation events (Prop. Cons.) and p-values. The simulated conservation events proportion is the average over 1000 simulations. Odds-ratios over 1 are shown in bold.

In principle, LD maintained through PFDS on strain frequencies might not be robust to strong perturbations. To test this, we examined changes in LD following the introduction of the pneumococcal conjugate vaccine in Massachusetts (2001 vs. 2007). Observed conservation rates remained high (≈34%) and were statistically similar to the null model (OR≈1.0−1.1). Similarly, there is no significant difference in LD reversal from the neutral expectation between the pre- and post-vaccine isolates. Therefore, although vaccination restructured the population and removed some key virulent strains, these results suggest that the LD distribution remained largely stable over this short timescale compared to the divergence accumulated between geographically separated populations.

Discussion

In this work, we show that NFDS (negative frequency-dependent selection, i.e., when rare traits are selected for) acting across bacterial genomes [11–13] is expected to shape bacterial strain structure. Phenomenological models of multi-locus NFDS typically assume that the effects of NFDS combine additively across different loci [11,20]. Here, we develop two mechanistic models of NFDS – within-host niches and competition-colonisation trade-off – and show that there is no a priori reason to assume effects combine additively. Deviating from this assumption leads to epistatic effects. Under some parameter regimes, the competition-colonisation model gives rise to constant-sign epistatic effects, which predict stable associations between loci. More interestingly, both models also give rise to emergent frequency-dependent effects on strain structure. Negative frequency-dependence actively abolishes allele associations, while positive frequency-dependence acts to reinforce existing allele associations. The direction of associations reinforced by positive frequency-dependent epistasis can therefore be in either direction, and is determined by historical contingency.

We examine patterns of association between intermediate frequency genes in more than 3000 pneumococcal genomes, from three different geographical populations. We find that strong positive or negative LD is more common than expected between functionally related genes. However this effect is, as expected, highly diminished when filtering out pairs of physically close genes, as it filters out for instance genes within an operon, which likely share similar functions and are strongly linked. Overall, this analysis suggests that some of these associations are driven by epistatic rather than stochastic or demographic effects resulting from the clonality of bacterial species.

We then assess the fate of strongly linked gene pairs across geographical populations, comparing observed patterns of LD conservation (consistent with both constant-sign epistasis and frequency-dependent epistatic effects) and reversal (consistent with frequency-dependent epistatic effects) against a null model conserving the phylogenetic structure of the population. We do not see clear evidence of LD conservation. These results are not straightforward to interpret. Firstly, they are affected by the difference in the number of LD pairs in the two populations (see Supplementary Note E in S1 File Supplementary Information). Secondly, the removal of physically close gene pairs underestimates the extent of positive epistasis (Table A in S1 File Supplementary Information). On the other hand, we do see a clear signal of LD reversal. LD reversal is not observed between Southampton or Massachusetts. This is not unexpected, given the extent of mixing between the populations (Fig M in S1 File Supplementary Information). Overall, these observations are consistent with the presence of frequency-dependent effects reinforcing epistasis where local historical contingency determines the direction of the association.

Our empirical results support the role of frequency-dependent effects in shaping strain structure. We found evidence of LD reversal across populations, consistent with frequency-dependent interactions, but no clear signal of LD conservation beyond what is expected from the core phylogeny. This suggests that while constant-sign epistasis may occur at short ranges (such as within operons), it does not appear to be a force maintaining non-random associations between distant loci across the species. However, assessing the practical importance of these effects on observed LD patterns remains a challenge. Firstly, predicted frequency-dependent effects can act to either reinforce or abolish allele associations depending on how effects combine across loci. While our null model analysis supports that the observed patterns of LD reversal cannot be explained by clonality alone, disentangling exactly what part of the observed effect is due to frequency-dependent epistasis remains difficult. Empirical estimates of variation in colonisation efficiency are feasible (e.g., [33]) and could help to delineate the contribution of epistatic effects. However, estimating how these effects are influenced by multiple loci requires large sequenced surveys of bacterial colonisation.

Secondly, NFDS is hypothesised to maintain intermediate frequencies for genes across a wide range of functions, including immunity, metabolism, direct competition and antibiotic resistance [11]. We hypothesise that the emergence of frequency-dependent epistasis from multi-locus NFDS is a general effect. This work focuses on two mechanisms. The first is within-host niches, which we conceptualise as arising from metabolic differentiation, though it could also reflect immunity. The second is a competition-colonisation trade-off, which can arise from bacteriocin systems [29]. Previous work has considered the role of antigen-specific acquired immunity in maintaining allele associations [22,27], with similar frequency-dependent epistatic effects also arising in these models [27]. Whether similar effects are predicted to arise for other functions is, in principle, easy to address through modeling. However, the mechanisms giving rise to NFDS across the genome are not well characterised.

Thirdly, in the mechanistic models we consider, both loci are under the same form of NFDS, and it is unclear whether these effects also arise between loci under different forms of NFDS. Previous modeling suggests that NFDS on metabolic and antigenic loci can lead to LD between the two types of alleles [34]. In the model giving rise to these results, NFDS on antigenic and metabolic loci is assumed to arise through relatively similar mechanisms (i.e., effects on colonisation efficiency). It is unclear whether the same applies if NFDS arises through very different mechanisms for different loci. Similarly, addressing how effects combine across more than two loci under NFDS is also important.

Fourth, we analyse a simple model focusing on a single pair of loci. Microbial genomes are composed of thousands of loci potentially interacting through epistasis. We cannot expect that the behaviour of a pair of loci is independent from the rest of the genome and so pairwise observations do not tell the whole story. For instance, it is expected that when considering many loci with weak epistasis and recombination, there can be an emergent regime where blocks of interacting genes can be locked and transmitted together [35]. Our work suggests that such epistatic interactions are plausible between many genes involved in within-host interactions.

Overall, our theoretical results represent qualitative insights into the role of NFDS in shaping strain structure and our empirical results suggest patterns of LD consistent with these effects. By using a simulated null model which conserves the phylogenetic structure of the species, we take into account the maintenance or reversal of linkage due to clonal expansion, which would otherwise be a major confounding effect. A number of other mechanisms such as demographic bottlenecks [6], asymmetric recombination [20], heterogeneity in recombination rates, and population structure [36]–also plausibly contribute to observed strain structure. Quantifying the relative impact of these processes will require more complex models than the ones presented in this work. While our simulation controls for the average rate of gene gain and loss along the tree, it assumes a homogeneous process across the genome. Future work could incorporate more complex null models that account for recombination hotspots, gene-specific mobility rates or physical proximity to further refine these estimates.

Our results have implications for understanding the response of pathogen populations to disturbances, such as vaccinations. Associations reinforced by positive frequency-dependent epistasis are contingent on the population’s evolutionary history. Such associations may therefore not be stable to large perturbations, leading to potentially restructuring of patterns of associations. We tested this in the Massachusetts data following the introduction of the pneumococcal conjugate vaccine and observed large-scale conservation of LD and few cases of LD sign reversal. The observed rate of LD reversal was not significantly different from the null model, in contrast with the geographic comparisons (OR > 2.0). This suggests that while vaccination could have perturbed frequency-dependent epistatic interactions, the LD distribution remained largely unchanged over the short timescale observed (6 years). This is in contrast to the divergence seen between geographically separated populations. A caveat here is that this is a single example of vaccine introduction, and it would be interesting to study more examples of such longitudinal data. More broadly, models of NFDS are used to predict which strains will increase in frequency following removal of vaccine-targeted serotypes [11,13,37]. Such models make considerably better predictions than naive models (e.g., R2 between observed and predicted post-vaccine strain frequencies are 0.2 vs 0.02 for a NFDS model vs a model based on pre-vaccine strain frequencies). Yet, accurately predicting post-vaccine strain frequencies remains very challenging. Accounting for epistatic interactions may improve the predictive power of such models.

The presence of stable strain structure requires both the presence of allelic diversity and epistatic mechanisms which promote non-random associations between alleles. Here, we show that NFDS, which gives rise to the former, can also impact the latter through frequency-dependent epistasis. NFDS is only neutral with respect to allele associations under very specific assumptions, and, for genes under a similar form of NFDS, there is no a priori reason to expect these assumptions to hold. These mechanisms that maintain genetic diversity across loci are thus also fundamentally linked to how this diversity is structured.

Methods

Measures of linkage disequilibrium

Linkage disequilibrium can be measured with the D metric defined as:

D=pAB−pApB (9)

which is bounded by −0.25≤D≤0.25. However this interval is reduced as frequencies of alleles A or B diverge from 0.5. In order to get a more interpretable metric, we use throughout most of the figures in this article the metric D’ which is bounded by -1 and 1 independently of the frequencies of individual alleles (provided they are not 0 or 1):

D′={Dmin(pA(1−pB),(1−pA)pB),if D>0,Dmin(pApB,(1−pA)(1−pB)),if D<0.  (10)

Multi-locus NFDS

In this section, we present how we implement recombination in the multi-locus NFDS model. We use mass-action recombination where two genotypes exchange an allele at a rate dictated by their respective densities and a recombination rate σ. This gives the following expression for the changes in density due to recombination φij of genotype ij:

φab=φAB=σ(XaBXAb−XABXab) (11)
φaB=φAb=σ(XABXab−XaBXAb) (12)

the two terms in each expression respectively showing the creation and the disappearance of the focal genotype through recombination.

SIS with co-colonisation

We consider an SIS (susceptible-infectious-uncolonised) for commensal bacteria circulating in a homogeneous host population. Uncolonised hosts are characterised by a birth rate b and a death rate d. There are several strains of commensals, and we denote with Ii hosts colonised by strain i. Commensals are transmitted through a mass action mechanism with a baseline transmission rate of β0, and can be cleared with a rate γ. There is no virulence (or additional mortality) associated with the carriage of a commensal. In this model we allow for co-colonisation by two commensals, which may or may not be of the same strain. We denote with Ii,j such a host co-colonised by both strains i and j. Note that there is no meaning to the order of strains in the notation and so Ii,j and Ij,i can be used interchangeably. Each co-colonising bacteria is transmitted at rate β0q where q is the efficiency associated with being in co-colonisation. This means that if q = 1, the co-colonised host Ii,i is exactly twice as infectious as host Ii. There is no interaction between co-colonising bacteria acting on the duration of carriage and so a co-colonised host Ii,j leaves the co-colonised compartment at rate 2γ: it becomes Ii or Ij at rate γ respectively. Two strains in co-colonisation can recombine upon secondary colonisation with probability σ, leading to a term Δrec detailed in the next section. The resulting system of ordinary differential equations is:

dSdt=b-Sd-S(∑x∈GIxβ(x,S)+q∑x,y∈GIx,y(β(x,S)+β(y,S))⏟primary colonisation)+γ∑x∈GIx⏟recoverydIidt=SIiβ(i,S)+Sq(2Ii,iβ(i,S)+(1-σ)∑xIi,xβ(i,S)⏟primary colonisation)+γ(Ii,i+∑x∈GIi,x)⏟recovery-Ii(∑x∈GIxβ(i,x)+q(1-σ)∑x,y∈GIx,y(β(x,i)+β(y,i))⏟co-colonisation)-Ii(d+γ)⏟death, recovery+Δrec(Ii)dIi,jdt=IiIj(β(i,j)+(1-δ(i=j))β(j,i))+q(1-σ)Ii∑x∈GIx,jβ(j,i)+Ij∑x∈GIi,xβ(i,j)⏟co-colonisation-Ii,j(d+2γ)⏟death, recovery+Δrec(Ii,j) (13)

Recombination

As we model co-colonisation, we can model recombination directly at the level of interacting strains and not use a population-wide recombination rate. We model recombination as happening upon the colonisation of a new host, from a co-colonised host. From a co-colonised host Ii,j, if strain i recombines with strain j upon infection, strain i will receive the allele of strain j in a random locus. δz(i,j) is the probability, upon recombination, that genotype i recombines with genotype j to form genotype z. For instance:

{δaB(ab,AB)=1/2δaB(aB,AB)=1/2δaB(ab,Ab)=0δAB(AB,AB)=1  (14)

The resulting terms of growth rate dependent on recombination are then given by:

Δrec(Ii)=qσ(S∑x,y∈GIx,yβ(i,S)(δi(x,y)+δi(y,x))⏟primary colonisation-Ii∑x,y,j∈GIx,y(δj(x,y)β(j,i)+δj(y,x)β(j,i))⏟co-colonisation)Δrec(Ii,j)=qσ(∑x,y∈GIx,y(Ii(δj(x,y)β(j,i)+δj(y,x)β(j,i))+Ij(δi(x,y)β(i,j)+δi(y,x)β(i,j))))⏟co-colonisation (15)

Evolutionary dynamics of LD

Evolutionary dynamics can be monitored through the dynamics of the frequency of each allele and of linkage disequilibrium [28].

dpAdt=wApA(1-pA)+wBD+wAB(1-pA)pABdpBdt=wBpB(1-pB)+wAD+wAB(1-pB)pABdDdt=wA(1-2pA)D+wB(1-2pB)D+wAB(pApB+D)((1-pA)(1-pB)-D) (16)

The parameter q is important in the expression of the epistasis wAB and dictates the effective force of infection by a certain strain depending on the number of hosts where this strain is in single infection and the number of hosts where that strain is co-colonising. We define the effective colonising density for strain i φi(t) as:

φi(t)=Ii(t)+q(Ii,i(t)+Ii,ab(t)+Ii,Ab(t)+Ii,aB(t)+Ii,AB(t)) (17)

and the per-capita effective rate of new infections by strain ab:

Ei(t)=β(i,S)S+β(i,ab)Iab(t)+β(i,aB)IaB(t)+β(i,Ab)IAb(t)+β(i,AB)IAB(t) (18)

Hence Ei(t)φi(t) is the force of infection, or rate of new colonisation by the strain i. With these terms we can express the growth rate of strain i:

ri(t)=Ni′Ni=Ii′+Ii,i′+∑j∈GIi,j′Ii+Ii,i+∑j∈GIi,j=β0φi(t)Ei(t)Ni(t)-(d+γ) (19)

To finally get an expression for the epistasis:

wAB=rAB+rab-raB-rAb=EAB(t)φAB(t)NAB(t)+Eab(t)φab(t)Nab(t)-EaB(t)φaB(t)NaB(t)-EAb(t)φAb(t)NAb(t) (20)

In the special case of q = 1, a strain in co-colonisation is as infectious as a strain in a single infected host. This leads to the equality between the effective density and the total density of strain i φi(t)=Ni(t).

Genome data

Genomes of S. pneumoniae were downloaded from NCBI BioProjects (MaeLa [30]:) PRJEB2357, PRJEB2393, PRJEB2395, PRJEB2479, PRJEB2480, (Southampton [31]:)PRJEB2417, (Massachusetts [32]:)PRJEB2632. The final dataset contains 2120 isolates from MaeLa, 605 from Massachusetts and 456 from Southampton. The phylogenetic tree for these isolates was downloaded on https://microreact.org/project/multilocusNFDS [11]. Gene sequences were clustered into clusters of orthologous genes using the easy-cluster workflow of MMSEQS2 [38]. Ancestral reconstruction of accessory gene content was carried out with PAST-ML using the JOINT prediction method [39] and protein annotation into KEGG functional categories was done with eggnog mapper v2 [40] using the emapper workflow and the diamond database.

Gene filtering

All subsequent analysis of the genome data was carried out using R 4.3.1 [41] and the ape package [42]. Accessory genes were filtered with frequency threshold 0.1 < f < 0.9 in each geographical population. Next, we only keep pairs separated by at least 100 kb on the chromosome. For each gene pair, we counted the frequency, among genomes where both genes are present, of the two genes being more than 100 kb apart or on different contigs. We kept only the pairs of genes for which this condition was true in more than 99% of genomes. We use this frequency based threshold because accessory genes are not always located in the same position.

Phylogenetic null model simulation

To distinguish between linkage disequilibrium arising from epistatic selection and that resulting from clonal population structure, we generated a null model dataset by simulating gene gain and loss dynamics along the phylogenetic tree. Evolutionary simulations were performed using a continuous-time Markov chain (Mk model) implemented in the castor R package [43].

The goal is for each gene to find the gain and loss rates, and this can be decomposed into two steps: finding the relative gain and loss rates that correctly simulate the gene frequencies, and then scaling these rates to match the observed number of changes.

For each accessory gene i, the transition rates for gene gain (q0→1) and gene loss (q1→0) were defined to ensure that the simulated genes had the same distribution of frequencies (fi) as found in the observed data:

q0→1=fiμi (21)
q1→0=(1−fi)μi (22)

where μi is the baseline substitution rate for gene i derived from the density of observed events of gains and losses (Ei) over the total tree length (L). This baseline was adjusted by a global scaling factor (F):

μi=SEiL (23)

The scaling factor was empirically calibrated to F = 5.7, a value that aligned the median distribution of total evolutionary changes in the simulated dataset with the median number of changes observed in the real dataset (see Fig O in S1 File Supplementary Information). This scaling factor is necessary and necessarily positive. We assess the parsimony score (number of gains and losses) in the observed dataset and we want to match this with the simulated dataset. To do so, we estimate μi so that each simulated gene i changes the observed number of times. However, because in reality several gain and loss events can happen in the same branch, the estimated parsimony score computed from the tips of the tree is necessarily lower than the true number of changes that happened. Therefore the scaling factor is necessary, must be above one, and depends on the specific phylogenetic tree. The state of the root node for each gene was fixed to the state inferred from the ancestral reconstruction of the observed data.

Because the Mk model is stochastic, the simulated frequency of a gene may deviate from the observed frequency. To ensure the null model accurately reflected the observed gene frequencies, the simulation was re-run for every gene until its final frequency was within a ±1% margin of the observed frequency (see Fig N in S1 File Supplementary Information for the observed and simulated frequency distributions). We show in Fig P in S1 File Supplementary Information the distribution of D’ in the observed and simulated populations, and in Fig Q in S1 File Supplementary Information the distribution of accessory genes on the phylogenetic tree in the observed and simulated Southampton population as an example. To robustly capture the variance expected under neutral evolution, we generated 100 independent replicate simulated populations.

Strong linkage pairs across populations

We calculated the D’ measure of LD for all physically distant gene pairs to ensure statistical independence (pairs separated by distance thresholds described previously). For each pair of populations (e.g., Pop1 vs. Pop2), we identify “Strong Linkage” pairs, defined as having |D’| > 0.6 in the reference population (Pop1). We then observe the change in |D’| for these specific pairs in the target population (Pop2). Pairs were classified as Conserved if they maintained strong LD with the same sign (|D’|pop2 > 0.6 and sign consistent) and reversed if they switched to strong LD with the opposite sign (|D’|pop2 > 0.6 and sign flipped). We repeated this analysis in 1000 simulated replicate datasets, comparing LD changes between simulated populations, to obtain a null distribution for the mean rates of reversal and conservation events. Finally, we tested whether observed mean rates were significantly different from the neutral expectation. We obtain a p-value by comparing the observed mean rates to the empirical distribution. The results are found in Tables 2 and 3. An Odds Ratio (OR > 1) indicates that the event (Conservation or Reversal) occurs more frequently in the observed data than expected in the simulated populations where there is no epistasis.

To distinguish biological signal from phylogenetic inertia, we compared the observed rates of Conservation and Reversal against a null distribution derived from 1,000 simulated datasets generated under a neutral model. For each simulation replicate, we identified strongly linked pairs in the simulated focal population and calculated the resulting event rates in the simulated target population. Statistical significance was assessed using an empirical P-value, defined as the proportion of simulations where the simulated rate met or exceeded the observed rate (P=Nsim≥obs+1Ntotal+1). We quantified the effect size using an Odds Ratio (OR), calculated as the observed rate divided by the mean simulated rate. An OR > 1 indicates that the event (Conservation or Reversal) occurs more frequently in the observed data than expected under neutral phylogenetic drift, suggesting the action of selection. Results are detailed in Tables 2 and 3.

Fate of strong linkage pairs

We calculated D’ for all physically distant gene pairs (pairs separated by distance thresholds described previously). For each directed comparison between two populations (Pop1→Pop2), we identified “Strongly Linked” pairs, defined as having |D’| > 0.6 in the focal population (Pop1). We then determined the status of these specific pairs in the target population (Pop2). Pairs were classified as conserved if they maintained strong LD with the same sign (|D′|Pop2>0.6; consistent sign) and reversed if they switched to strong LD with the opposite sign (|D′|Pop2>0.6; flipped sign).

We then compared the observed rates of conservation and reversal against a null distribution derived from 1,000 simulated datasets generated under the neutral model. For each simulation replicate, we identified strongly linked pairs in the simulated focal population and calculated the resulting event rates in the simulated target population. Statistical significance was assessed using a two-sided empirical P-value. This was defined as the proportion of simulations where the absolute deviation of the simulated rate (rsim) from the mean simulated rate (r¯sim) was greater than or equal to the absolute deviation of the observed rate (robs):

P=∑i=1N𝕀(|rsim,i−r¯sim|≥|robs−r¯sim|)+1N+1 (24)

where N is the total number of simulations (1,000) and 𝕀 is the indicator function. We quantified the effect size using an Odds Ratio (OR), calculated as the observed rate divided by the mean simulated rate. An OR≠1 accompanied by a significant P-value indicates that the event frequency differs significantly from neutral expectations, consistent with epistasis (e.g., OR > 1 suggests enrichment). Results are detailed in Tables 2 and 3.

Supporting information

S1 File. Supplementary information contains supplementary figures and supplementary notes referenced in the main text.

(PDF)

Data Availability

The genome data used in this work is publicly available and can be accessed as NCBI BioProjects PRJEB2357, PRJEB2393, PRJEB2395, PRJEB2479, PRJEB2480, PRJEB2417, PRJEB2632. All relevant code has been deposited on the repository: https://doi.org/10.5281/zenodo.17471803.

Funding Statement

The study was funded by a Swiss National Science Foundation (SNSF) grant to SL. The grant number is PR00P3_201618. Funder website: https://www.snf.ch/en. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

References

  • 1.Caugant DA, Frøholm LO, Bøvre K, Holten E, Frasch CE, Mocca LF, et al. Intercontinental spread of a genetically distinctive complex of clones of neisseria meningitidis causing epidemic disease. Proceedings of the National Academy of Sciences. 1986;83(13):4927–31. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Watkins ER, Maiden MCJ. Persistence of hyperinvasive meningococcal strain types during global spread as recorded in the PubMLST database. PLoS One. 2012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Mitchell AM, Mitchell TJ. Streptococcus pneumoniae: virulence factors and variation. Clin Microbiol Infect. 2010;16(5):411–8. doi: 10.1111/j.1469-0691.2010.03183.x [DOI] [PubMed] [Google Scholar]
  • 4.Lehtinen S, Blanquart F, Croucher NJ, Turner P, Lipsitch M, Fraser C. Evolution of antibiotic resistance is linked to any genetic mechanism affecting bacterial duration of carriage. Proc Natl Acad Sci U S A. 2017;114(5):1075–80. doi: 10.1073/pnas.1617849114 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Lehtinen S, Blanquart F, Lipsitch M, Fraser C, Maela Pneumococcal Collaboration. On the evolutionary ecology of multidrug resistance in bacteria. PLoS Pathogens. 2019;15(5):e1007763. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Tibayrenc M, Ayala FJ. Reproductive clonality of pathogens: a perspective on pathogenic viruses, bacteria, fungi, and parasitic protozoa. Proc Natl Acad Sci U S A. 2012;109(48):E3305-13. doi: 10.1073/pnas.1212452109 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Chaguza C, Cornick JE, Everett DB. Mechanisms and impact of genetic recombination in the evolution of Streptococcus pneumoniae. Comput Struct Biotechnol J. 2015;13:241–7. doi: 10.1016/j.csbj.2015.03.007 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Levin BR, Perrot V, Walker N. Compensatory mutations, antibiotic resistance and the population genetics of adaptive evolution in bacteria. Genetics. 2000;154(3):985–97. doi: 10.1093/genetics/154.3.985 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.McLeod DV, Gandon S. Understanding the evolution of multiple drug resistance in structured populations. Elife. 2021;10:e65645. doi: 10.7554/eLife.65645 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.McLeod DV, Gandon S. Effects of epistasis and recombination between vaccine-escape and virulence alleles on the dynamics of pathogen adaptation. Nat Ecol Evol. 2022;6(6):786–93. doi: 10.1038/s41559-022-01709-y [DOI] [PubMed] [Google Scholar]
  • 11.Corander J, Fraser C, Gutmann MU, Arnold B, Hanage WP, Bentley SD, et al. Frequency-dependent selection in vaccine-associated pneumococcal population dynamics. Nat Ecol Evol. 2017;1(12):1950–60. doi: 10.1038/s41559-017-0337-x [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.McNally A, Kallonen T, Connor C, Abudahab K, Aanensen DM, Horner C, et al. Diversification of Colonization Factors in a Multidrug-Resistant Escherichia coli Lineage Evolving under Negative Frequency-Dependent Selection. mBio. 2019;10(2):e00644-19. doi: 10.1128/mBio.00644-19 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Azarian T, Martinez PP, Arnold BJ, Qiu X, Grant LR, Corander J, et al. Frequency-dependent selection can forecast evolution in Streptococcus pneumoniae. PLoS Biol. 2020;18(10):e3000878. doi: 10.1371/journal.pbio.3000878 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Andreasen V, Lin J, Levin SA. The dynamics of cocirculating influenza strains conferring partial cross-immunity. J Math Biol. 1997;35(7):825–42. doi: 10.1007/s002850050079 [DOI] [PubMed] [Google Scholar]
  • 15.Ferguson NM, Galvani AP, Bush RM. Ecological and immunological determinants of influenza evolution. Nature. 2003;422(6930):428–33. doi: 10.1038/nature01509 [DOI] [PubMed] [Google Scholar]
  • 16.Cobey S. Pathogen evolution and the immunological niche. Ann N Y Acad Sci. 2014;1320(1):1–15. doi: 10.1111/nyas.12493 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Feng J, Qian Y, Zhou Z, Ertmer S, Vivas EI, Lan F, et al. Polysaccharide utilization loci in Bacteroides determine population fitness and community-level interactions. Cell Host Microbe. 2022;30(2):200-215.e12. doi: 10.1016/j.chom.2021.12.006 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Livingston G, Matias M, Calcagno V, Barbera C, Combe M, Leibold MA, et al. Competition–colonization dynamics in experimental bacterial metacommunities. Nature Communications. 2012;3(1):1234. [DOI] [PubMed] [Google Scholar]
  • 19.Brisson D. Negative Frequency-Dependent Selection Is Frequently Confounding. Front Ecol Evol. 2018;6:10. doi: 10.3389/fevo.2018.00010 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Harrow GL, Lees JA, Hanage WP, Lipsitch M, Corander J, Colijn C, et al. Negative frequency-dependent selection and asymmetrical transformation stabilise multi-strain bacterial population structures. ISME J. 2021;15(5):1523–38. doi: 10.1038/s41396-020-00867-w [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Cobey S, Lipsitch M. Niche and neutral effects of acquired immunity permit coexistence of pneumococcal serotypes. Science. 2012;335(6074):1376–80. doi: 10.1126/science.1215947 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Gupta S, Maiden MC, Feavers IM, Nee S, May RM, Anderson RM. The maintenance of strain structure in populations of recombining infectious agents. Nat Med. 1996;2(4):437–42. doi: 10.1038/nm0496-437 [DOI] [PubMed] [Google Scholar]
  • 23.Gomes MGM, Medley GF, Nokes DJ. On the determinants of population structure in antigenically diverse pathogens. Proc Biol Sci. 2002;269(1488):227–33. doi: 10.1098/rspb.2001.1869 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Recker M, Gupta S. A model for pathogen population structure with cross-protection depending on the extent of overlap in antigenic variant repertoires. J Theor Biol. 2005;232(3):363–73. doi: 10.1016/j.jtbi.2004.08.026 [DOI] [PubMed] [Google Scholar]
  • 25.Buckee CO, Jolley KA, Recker M, Penman B, Kriz P, Gupta S, et al. Role of selection in the emergence of lineages and the evolution of virulence in Neisseria meningitidis. Proceedings of the National Academy of Sciences. 2008;105(39):15082–7. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Pilosof S, He Q, Tiedje KE, Ruybal-Pesántez S, Day KP, Pascual M. Competition for hosts modulates vast antigenic diversity to generate persistent strain structure in Plasmodium falciparum. PLoS Biol. 2019;17(6):e3000336. doi: 10.1371/journal.pbio.3000336 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.McLeod DV, Bank C, Gandon S. A multilocus perspective on the evolutionary dynamics of multistrain pathogens. Proc Natl Acad Sci USA. 2024;121(42). doi: 10.1073/pnas.2401578121 [DOI] [Google Scholar]
  • 28.Day T, Gandon S. The evolutionary epidemiology of multilocus drug resistance. Evolution. 2012;66(5):1582–97. doi: 10.1111/j.1558-5646.2011.01533.x [DOI] [PubMed] [Google Scholar]
  • 29.Lehtinen S, Croucher NJ, Blanquart F, Fraser C. Epidemiological dynamics of bacteriocin competition and antibiotic resistance. Proc Biol Sci. 2022;289(1984):20221197. doi: 10.1098/rspb.2022.1197 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Chewapreecha C, Harris SR, Croucher NJ, Turner C, Marttinen P, Cheng L, et al. Dense genomic sampling identifies highways of pneumococcal recombination. Nat Genet. 2014;46(3):305–9. doi: 10.1038/ng.2895 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Gladstone RA, Devine V, Jones J, Cleary D, Jefferies JM, Bentley SD, et al. Pre-vaccine serotype composition within a lineage signposts its serotype replacement - a carriage study over 7 years following pneumococcal conjugate vaccine use in the UK. Microb Genom. 2017;3(6):e000119. doi: 10.1099/mgen.0.000119 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32.Croucher NJ, Finkelstein JA, Pelton SI, Mitchell PK, Lee GM, Parkhill J, et al. Population genomics of post-vaccine changes in pneumococcal epidemiology. Nature Genetics. 2013;45(6):656–63. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 33.Krishna A, Tonkin-Hill G, Morel-Journel T, Bentley S, Turner P, Blanquart F, et al. Quantifying the effects of antibiotic resistance and within-host competition on strain fitness in Streptococcus pneumoniae. bioRxiv 2025.03.09.642042; 10.1101/2025.03.09.642042 [DOI] [PMC free article] [PubMed]
  • 34.Watkins ER, Penman BS, Lourenço J, Buckee CO, Maiden MCJ, Gupta S. Vaccination Drives Changes in Metabolic and Virulence Profiles of Streptococcus pneumoniae. PLoS Pathog. 2015;11(7):e1005034. doi: 10.1371/journal.ppat.1005034 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Neher RA, Shraiman BI. Competition between recombination and epistasis can cause a transition from allele to genotype selection. Proceedings of the National Academy of Sciences. 2009;106(16):6866–71. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Jacopin E, Lehtinen S, Débarre F, Blanquart F. Factors favouring the evolution of multidrug resistance in bacteria. J R Soc Interface. 2020;17(168):20200105. doi: 10.1098/rsif.2020.0105 [DOI] [Google Scholar]
  • 37.Colijn C, Corander J, Croucher NJ. Designing ecologically optimized pneumococcal vaccines using population genomics. Nat Microbiol. 2020;5(3):473–85. doi: 10.1038/s41564-019-0651-y [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38.Steinegger M, Söding J. MMseqs2 enables sensitive protein sequence searching for the analysis of massive data sets. Nat Biotechnol. 2017;35(11):1026–8. doi: 10.1038/nbt.3988 [DOI] [PubMed] [Google Scholar]
  • 39.Ishikawa SA, Zhukova A, Iwasaki W, Gascuel O. A Fast Likelihood Method to Reconstruct and Visualize Ancestral Scenarios. Mol Biol Evol. 2019;36(9):2069–85. doi: 10.1093/molbev/msz131 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40.Cantalapiedra CP, Hernández-Plaza A, Letunic I, Bork P, Huerta-Cepas J. eggNOG-mapper v2: Functional Annotation, Orthology Assignments, and Domain Prediction at the Metagenomic Scale. Mol Biol Evol. 2021;38(12):5825–9. doi: 10.1093/molbev/msab293 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41.R Core Team. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. 2023. [Google Scholar]
  • 42.Paradis E, Schliep K. Ape 5.0: an environment for modern phylogenetics and evolutionary analyses in R. Bioinformatics. 2019;35:526–8. [DOI] [PubMed] [Google Scholar]
  • 43.Louca S, Doebeli M. Efficient comparative phylogenetics on large trees. Bioinformatics. 2018;34(6):1053–5. doi: 10.1093/bioinformatics/btx701 [DOI] [PubMed] [Google Scholar]
  • 44.Colijn C, Cohen T, Fraser C, Hanage W, Goldstein E, Givon-Lavi N, et al. What is the mechanism for persistent coexistence of drug-susceptible and drug-resistant strains of Streptococcus pneumoniae?. J R Soc Interface. 2010;7(47):905–19. doi: 10.1098/rsif.2009.0400 [DOI] [PMC free article] [PubMed] [Google Scholar]
PLoS Comput Biol. 2026 Mar 19;22(3):e1014083. doi: 10.1371/journal.pcbi.1014083.r001

Author response to Decision Letter 0


Transfer Alert

This paper was transferred from another journal. As a result, its full editorial history (including decision letters, peer reviews and author responses) may not be present.

15 Jul 2025

PLoS Comput Biol. doi: 10.1371/journal.pcbi.1014083.r002

Decision Letter 0

Tommy Tsan-Yuk Lam

3 Sep 2025

PCOMPBIOL-D-25-01407

Emergent epistasis mediates the role of negative frequency-dependent selection in bacterial strain structure

PLOS Computational Biology

Dear Dr. Guillemet,

Thank you for submitting your manuscript to PLOS Computational Biology. After careful consideration, we feel that it has merit but does not fully meet PLOS Computational Biology's publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

Please submit your revised manuscript within 60 days Nov 03 2025 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at ploscompbiol@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pcompbiol/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

* A rebuttal letter that responds to each point raised by the editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'. This file does not need to include responses to formatting updates and technical items listed in the 'Journal Requirements' section below.

* A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

* An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

If you would like to make changes to your financial disclosure, competing interests statement, or data availability statement, please make these updates within the submission form at the time of resubmission. Guidelines for resubmitting your figure files are available below the reviewer comments at the end of this letter

We look forward to receiving your revised manuscript.

Kind regards,

Tommy Tsan-Yuk Lam, Ph.D.

Academic Editor

PLOS Computational Biology

Jennifer Flegg

Section Editor

PLOS Computational Biology

Journal Requirements:

1) We ask that a manuscript source file is provided at Revision. Please upload your manuscript file as a .doc, .docx, .rtf or .tex. If you are providing a .tex file, please upload it under the item type u2018LaTeX Source Fileu2019 and leave your .pdf version as the item type u2018Manuscriptu2019.

2) Please provide an Author Summary. This should appear in your manuscript between the Abstract (if applicable) and the Introduction, and should be 150-200 words long. The aim should be to make your findings accessible to a wide audience that includes both scientists and non-scientists. Sample summaries can be found on our website under Submission Guidelines:

https://journals.plos.org/ploscompbiol/s/submission-guidelines#loc-parts-of-a-submission

3) Please upload all main figures as separate Figure files in .tif or .eps format. For more information about how to convert and format your figure files please see our guidelines:

https://journals.plos.org/ploscompbiol/s/figures

4) We notice that your supplementary Figures, Tables, and information are included in the manuscript file. Please remove them and upload them with the file type 'Supporting Information'. Please ensure that each Supporting Information file has a legend listed in the manuscript after the references list.

5)  Thank you for indicating that "The genome data used in this work is publicly available and the identifiers are described in the manuscript." Please update your Data Availability Statement in the online submission form to include the accession number(s) of the dataset(s).

6) Thank you for stating "No competing interests." Please revise your current Competing Interest statement to the standard "The authors have declared that no competing interests exist."

Note: If the reviewer comments include a recommendation to cite specific previously published works, please review and evaluate these publications to determine whether they are relevant and should be cited. There is no requirement to cite these works unless the editor has indicated otherwise.

Reviewers' comments:

Reviewer's Responses to Questions

Reviewer #1: This manuscript by Guillemet & Lehtinen is an intriguing exploration of the interaction between epistasis and frequency-dependent selection on bacterial strain structure. This builds on previous work on McLeod et al (https://www.pnas.org/doi/10.1073/pnas.2401578121), which focused on immune selection. This manuscript extends the work to consider competition between commensals through two different mechanisms.

My major criticisms of the work are:

[1] The title and Discussion refer to “emergent epistasis”. An emergent property is one that the system has, but the components do not. Yet in each case, the epistasis is assumed by the equations that define the model, rather than being inferred from observations of simulation results.

To clarify, the Discussion states, “there is no a priori reason to assume effects combine additively. Deviating from this assumption leads to emergent epistatic effects”. Yet one of the original definitions of epistasis, by Fisher, is “any statistical deviation from the additive combination of two loci in their effects on a phenotype” (https://pmc.ncbi.nlm.nih.gov/articles/PMC2689140/#BX2). Therefore the epistasis is assumed, intrinsic to the equations, not emergent.

The results shown in Figure 3 are the closest to being emergent. However, in these simulations, the epistasis still requires that the effect of a two allele deviation is not equal to double the effect of a one allele deviation. This again is a violation of additivity, and therefore implicit epistasis within the equations that define the model.

The authors should therefore comment on how their work compares with previous analyses of the effect of epistasis on the emergence of strain structure in a recombining population (e.g. https://doi.org/10.1073/pnas.0812560106).

[2] The validation of the model predictions using genomic data do not appear to consider physical linkage through spatial proximity of genes in a chromosome. The null distribution to which the biological data are compared was generated through shuffling the presence of genes across genomes, which is inconsistent with the known genome biology of these bacteria (e.g. the structuring of genes into operons), and their population structure (which is not panmictic). Therefore is it unsurprising that the observed distribution deviates from the null distribution. The authors should limit their comparisons to genes separated by a significant distance (e.g. 100 kb) to minimise the effects of physical linkage.

The authors do sensibly limit their analysis to genes that are gained or lost at least 30 times on the tree. However, such rapidly moving genes are likely to be mobile genetic elements. These often represent blocks of many genes that, by definition, move as a single linked unit. Therefore it is to be expected that they will exhibit high LD. It is probable that these structures account for the lower-than-expected proportion of reversals observed following vaccine introduction. This explanation fits with the authors noting there are many integrases and transposes in the set of genes showing the highest linkage, “potentially reflecting the role of mobile genetic elements in LD”. This issue should also be fixed by using the distance threshold suggested above to only look at distantly-separated genes.

Additionally, if there are epistatic interactions between genes, why would selection not result in them being found in the same operon? At which point, would it not be expected that they would be co-inherited, and therefore cease to affect population structure?

[3] Equation 1 features “the allele frequency favored by selection” for each allele, which features in the fitness calculations. However, these do not appear to be mentioned again in the paper. Figure 2b suggests that all four favored frequencies are 0.5. Is this the case? Do all the equations generalize to any favored frequency? What effect do unequal frequencies have?

Additionally, it would be reassuring to see the framework used to undertake neutral simulations, with the results included in the SOM for comparison with the NFDS simulations.

My minor comments are:

[a] Equation (3) – the top equation only applies when fitneses are additive, according to McLeod et al (page 6, SOM) – this should be clarified

[b] Equation (4) – does not match equation (16), or McLeod et al SOM equation 22c – can the authors explain this discrepancy?

[c] L129 – sigma not defined here, only in Methods

[d] Figure 2 – why is there an infinity sign next to D’ in the scale? (see also Fig. S6) Also, the zero of beta_0 is not subscript in many figure legends.

[e] L256 – “D’egative”

[f] L312 – there is no Figure 4d.

[g] Equation 9 – "B" should be subscript

[h] L611-613: “bacteria” is plural

[i] Figure S3 – should be “null or negative”

[j] The graphs in panel a of Figure S7 and S8 appear to be misformatted.

[j] "Streptococcuc" in the keywords

Reviewer #2: Summary:

This manuscript explores how multi-locus negative frequency-dependent selection (NFDS) generates emergent epistasis, thereby shaping bacterial strain structure. Using two mechanistic epidemiological models (metabolic niche differentiation and competition–colonisation trade-offs), coupled with genomic analysis of >3000 Streptococcus pneumoniae genomes, the authors argue that frequency-dependent epistasis explains patterns of linkage disequilibrium (LD). The study aims to generalise beyond antigen-driven NFDS to broader mechanisms.

The study is conceptually rich, methodologically sophisticated, and relevant to evolutionary epidemiology. However, critical issues limit its clarity and robustness:

1. Insufficient justification of model assumptions (e.g., additivity vs. non-additivity of NFDS).

2. Ambiguity in parameter choices and simulation setups (e.g., competition parameters k values, recombination rates, initial genotype frequencies).

3. Limited exploration of alternative explanations for LD patterns (e.g., demographic effects, hitchhiking, clonality).

4. Data analysis lacks transparency in statistical testing, null model assumptions, and robustness across populations.

5. Overinterpretation: the empirical results are suggestive but not conclusive about emergent epistasis.

Major Critiques:

1. Abstract: Claims strong support for emergent epistasis from genomic data, yet the empirical evidence is largely correlative. This overstates certainty.

2. Introduction: While antigen-specific immunity is mentioned, the transition to metabolic and competition–colonisation models feels abrupt. The rationale for focusing on these two mechanisms should be justified more strongly with literature. Moreover, the introduction does not sufficiently discuss alternative balancing mechanisms (e.g., fluctuating selection, spatial heterogeneity, migration).

3. Methods, Epidemiological Models: Model assumptions are critical but under-justified. Why assume symmetric bi-allelic loci? Why ignore asymmetry in gene gain vs. loss (noted later in Supplementary but not addressed in main text)? Equations (5) and (8): Terms governing epistasis depend sensitively on parameter geometry (k0, k1, k2, kΔ). How were these parameter ranges chosen? Are they biologically realistic? Moreover, recombination treatment (σ terms) is simplistic. Empirical pneumococcal recombination is asymmetric, biased toward deletions. The model omits this key factor despite its known importance.

Phenomenological baseline (Eq. 1): assumptions, units, regime of validity: Eq. (1) adds one-locus NFDS terms to logistic growth to show that with recombination there is no sustained LD because w_AB = 0 at the allele optimum. However, the conditions under which Eq. (1) approximates the mechanistic models (weak selection, quasi-linkage equilibrium, additive fitness, timescale separation) are not stated. Please add an explicit 'Assumptions & Units' paragraph and a parameter table (confirm r, ρ have units 1/time; p is unitless).

4. Results, Simulation Evidence: Figure 2b/2c & Figure 3b/3c: The authors claim PFDS vs. NFDS regimes emerge depending on parameter geometry, but it is unclear how initial genotype frequencies (D′ = 0.4) were selected. Different starting conditions may bias toward observing bistability. In addition, figure S7/S8: Exploration of parameter space is extensive, but the biological interpretation of "concavity" and "step" parameters is not intuitive. The authors should connect these meta-parameters explicitly to measurable biological quantities and this earlier on in the texts for benefit of readership…

5. Results, Genomic Data Analysis: LD analysis is interesting but the statistical testing is insufficiently detailed. The permutation null assumes average LD = 0, which is unrealistic under recombination–selection balance. More sophisticated nulls (e.g., coalescent simulations incorporating recombination rates, clonality, demography) should be considered. Moreover, the evidence for LD sign reversals (PFDS) is rare (2.7~4.5% of pairs?). Yet this is central to the argument. The rarity of reversals suggests that constant epistasis and demographic structure may still explain most observations.

6. Discussion: The discussion overstates the empirical support for frequency-dependent epistasis. At minimum, claims should be tempered: the data are "consistent with" rather than "demonstrating" the mechanism. Also, while limitations are acknowledged, they are not sufficiently addressed. For example:

a. No discussion of recombination rate heterogeneity across populations.

b. Lack of validation against longitudinal data beyond the Massachusetts vaccine rollout.

c. No comparison to simpler explanations such as persistent clonal structure.

7. Overall Replicability: The ODE systems are detailed, but the parameterization is not fully transparent. Supplementary material provides equations but not always parameter ranges or biological justification. Furthermore, the Zenodo link to the cited code appears broken, making it impossible to verify or reproduce the simulation workflow directly. As a result, the manuscript text alone does not provide sufficient information to ensure full reproducibility without access to external files.

Minor Critiques:

1. Abstract, "emerging epistasis … unlike classical epistasis" Needs clearer definition; the distinction between frequency-dependent and classical epistasis is not well explained.

2. Results, Figure 2 captions: Ambiguity in describing "competition efficiencies"—should be defined consistently.

3. Methods: Clarify whether allele frequencies were initialized deterministically or stochastically in simulations.

4. The main text should summarize key points instead of relegating critical assumptions (like recombination asymmetry) to Supplementary.

Issue of Grammar, Spelling, Proofreading, etc.

1. Generally well written, but several sentences are long and convoluted (e.g., Discussion pp. 13–14). Shorter, more direct sentences would aid readability.

2. Inconsistent hyphenation: “co-colonisation” vs. “co colonisation”.

3. Abbreviation NFDS/PFDS should be redefined in the Discussion for clarity to non-specialist readers.

4. Typo in Eq. 9.

Reviewer #3: This manuscript addresses how multilocus negative frequency-dependent selection (NFDS) can generate emergent epistasis that, in turn, structures bacterial populations into strains. By analyzing two mechanistic models (metabolic niches and competition–colonization trade-offs), the authors show that both frequency-independent and frequency-dependent forms of epistasis can arise, including positive frequency-dependent selection (PFDS). They then test these predictions with large-scale genomic data using linkage disequilibrium (LD) analyses of accessory genes. The study is ambitious, broad in scope, and effectively bridges theoretical and empirical approaches, making it well suited for PLOS Computational Biology.

Major Comments

In the analysis of large-scale genomic data of S. pneumoniae, the identification of PFDS relies on detecting LD sign reversals across populations, under the assumption that stationary epistasis would not lead to such reversals. However, other processes (e.g., lineage-specific recombination rates, mobile genetic elements, historical bottlenecks/founder events) could also generate sign reversals. The authors should explain in greater detail how these alternative mechanisms can be excluded.

The permutation scheme shuffles gene presence/absence across strains while preserving frequencies, but this procedure destroys phylogenetic structure and signals of clonal expansion. Alternative null models—such as block permutations within lineages or phylogeny-based simulations (e.g., PAST-ML–consistent evolutionary histories)—should be considered.

While the manuscript addresses an interesting and timely question, I find the current evidence insufficient to support the central claim that PFDS and NFDS emergently structure bacterial strain diversity. The modeling framework is overly simplified to capture the complexity of pneumococcal accessory genome dynamics, and the empirical LD analyses are heavily confounded by MGEs and population structure. The inference of PFDS from rare LD reversals is particularly weak and may reflect artifacts of the null model rather than true biological signals. A more refined discussion of the gap between theoretical models and empirical data is needed.

Minor Comments

i) There appear to be discrepancies between figure references and the text. For example, in line 175, the reference to “(Figure 2a, dashed line)” seems to correspond to the red line rather than a dashed one.

ii) In line 312, the reference to “(Figure 4d)” does not correspond to an existing figure.

**********

Have the authors made all data and (if applicable) computational code underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data and code underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data and code should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data or code —e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: Yes

Reviewer #3: None

**********

PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #2: No

Reviewer #3: No

[NOTE: If reviewer comments were submitted as an attachment file, they will be attached to this email and accessible via the submission site. Please log into your account, locate the manuscript record, and check for the action link "View Attachments". If this link does not appear, there are no attachment files.]

Figure resubmission:

While revising your submission, we strongly recommend that you use PLOS’s NAAS tool (https://ngplosjournals.pagemajik.ai/artanalysis) to test your figure files. NAAS can convert your figure files to the TIFF file type and meet basic requirements (such as print size, resolution), or provide you with a report on issues that do not meet our requirements and that NAAS cannot fix.

After uploading your figures to PLOS’s NAAS tool - https://ngplosjournals.pagemajik.ai/artanalysis, NAAS will process the files provided and display the results in the "Uploaded Files" section of the page as the processing is complete. If the uploaded figures meet our requirements (or NAAS is able to fix the files to meet our requirements), the figure will be marked as "fixed" above. If NAAS is unable to fix the files, a red "failed" label will appear above. When NAAS has confirmed that the figure files meet our requirements, please download the file via the download option, and include these NAAS processed figure files when submitting your revised manuscript.

Reproducibility:

To enhance the reproducibility of your results, we recommend that authors of applicable studies deposit laboratory protocols in protocols.io, where a protocol can be assigned its own identifier (DOI) such that it can be cited independently in the future. Additionally, PLOS ONE offers an option to publish peer-reviewed clinical study protocols. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols

PLoS Comput Biol. doi: 10.1371/journal.pcbi.1014083.r004

Decision Letter 1

Tommy Tsan-Yuk Lam

2 Dec 2025

PCOMPBIOL-D-25-01407R1

Epistasis mediates the role of negative frequency-dependent selection in bacterial strain structure

PLOS Computational Biology

Dear Dr. Guillemet,

Thank you for submitting your manuscript to PLOS Computational Biology. After careful consideration, we feel that it has merit but does not fully meet PLOS Computational Biology's publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

Please submit your revised manuscript by Feb 01 2026 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at ploscompbiol@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pcompbiol/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

* A rebuttal letter that responds to each point raised by the editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'. This file does not need to include responses to formatting updates and technical items listed in the 'Journal Requirements' section below.

* A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

* An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

If you would like to make changes to your financial disclosure, competing interests statement, or data availability statement, please make these updates within the submission form at the time of resubmission. Guidelines for resubmitting your figure files are available below the reviewer comments at the end of this letter

We look forward to receiving your revised manuscript.

Kind regards,

Tommy Tsan-Yuk Lam, Ph.D.

Academic Editor

PLOS Computational Biology

Jennifer Flegg

Section Editor

PLOS Computational Biology

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Authors:

Please note here if the review is uploaded as an attachment.

Reviewer #1: [1] The authors ask, “we wonder if you would agree that the genotype frequency-dependent aspect of the epistasis is an emerging property?” I think this is reasonable, as it emerges from an interaction in the simulations, not an explicit definition within the model.

[2] I thank the authors for introducing the correction for physical linkage shown in Figures S16 and S17. These figures should replace Fig. 4a and 4b, because the comparison demonstrates that the vast majority of gene pairs showing consistent linkage between populations are close together, which is not relevant to the effect of epistasis on population structure. Similarly, S15 should be dropped, and S18 recalculated using the distance thresholds. Only these figures that incorporate the physical distance thresholds enable the reasoning below, which is detailed such that the authors can correct me if I have misunderstood:

(a) The authors state in the manuscript “the strong linkage is conserved across populations (defined as ∣D′∣ > 0.6 and same sign LD) for 30.6% of gene pairs” (this should be updated in a revision). In Fig. 4b, the shuffled population has a mode around 0.6, which is consistent with there being zero LD, as expected in these permuted data (the comparison is between D’> 0.6 in one population, and D ~ 0 in the shuffled data). The mass of smaller delta D’ values in the observed data was used as evidence of widespread epistasis in the original submission.

(b) However, 23.9% of gene pairs have to be removed through close physical linkage – similar to the proportion that exhibit strong linkage conservation across populations. Accordingly, Fig. S16 shows that the mode for the observed data delta D’ is also now 0.6 – that is, strong linkage pairs in the focal population are generally not linked in the comparator population. Therefore linkage that is observed in one population is not apparent in another. This is not consistent with widespread stable epistasis across populations. This should be made explicit.

(c) Nevertheless, the authors claim that Table S3 (note this table has this symbol in the legend: “¿100 kb”) shows that there are significantly more LD conservation events than expected between populations. This is based on the tail of small delta D values in Fig. S16, that lie outside of the narrower shuffled population distribution used as the null. However, the reason for this difference is not a difference in the position of the mode, it is a difference in the variance of the null and observed distributions. The larger variance of the observed data is due to the effects of population structure that are not accounted for in the permutations: permutation treats each isolate as an individual sample, rather than one that shares gene content through ancestry with other isolates. Hence the effective sample size of the observed population is smaller than the sample size of the shuffled population (i.e. why effective population sizes are smaller than census population sizes). Therefore the variance of the null distribution shrinks relative to the observed population.

(d) The problem this creates is best illustrated with the Maela-Southampton comparison (Table S3):

(i) There are three time more strong LD pairs in the Maela population than the Southampton one

(ii) There are the same number of observed conservation events in the comparison between the two (which is necessarily the case)

(iii) The number of expected conservation events is 2,500-fold higher for the Southampton-Maela comparison than the Maela-Southampton comparison, despite there being more strong LD pairs in Maela.

(iv) A comparison with Table S1 shows that these differences are not down to chance fluctuations in the permutation distribution – there is a 1,600-fold difference in the expected numbers for the Southampton-Maela comparison compared to the Maela-Southampton in that analysis as well

(v) After trying to work this out for some time, I found the size of the sample from Maela is much larger than the size of the sample from Southampton (https://microreact.org/project/multilocusNFDS) – this information should be reported in the manuscript – narrowing the variance of the null distribution, resulting in a reduced number of expected conservation events

(vi) Yet Fig. S16 shows the observed delta D’ distribution is approximately consistent across all population comparisons, regardless of sample size – indicating that the difference between the observed and expected values should not be strongly affected by sample size, if the comparison were appropriately calibrated

(e) This also affects the number of reversals (Table S4), which corresponds to the tail of delta D’ values >1.2. The expected number is again lowest in the comparisons using the Maela population as the focus, suggesting the effects are driven by sample size, rather than epistasis.

The authors claim that their use of genes that have been gained or lost 30 times or more will eliminate the effects of clonality. However, https://microreact.org/project/multilocusNFDS shows there are >70 Sequence Clusters, so a gene could easily be conserved within half of these (and absent from the other half), while also being gained/lost more than 30 times. For a more convincing statistical analysis:

(i) Sequence clusters observed in both compared populations (e.g. Sequence Cluster 18, found in all three) should be dropped from the comparisons, as their presence makes populations similar through common ancestry

(ii) The observed distribution of gain/loss numbers should be shown to justify the selected threshold (or it should be adjusted, as appropriate)

(iii) Null simulations should be used that replicate this gain/loss distribution – this can be done using the tree and population genetics simulation software (e.g. https://academic.oup.com/sysbio/article/65/2/334/2427219)

(iv) D’ values from these null simulations (with genes having similar gain/loss distributions in the observed and simulated populations) can then be compared with the observed ones as in the current manuscript

All these problems also affect the pre/post vaccine analysis of the Massachusetts population. The current version is making claims that simply cannot be robustly justified (e.g. much of the Discussion). While I appreciate the authors have added some caveats, they are not sufficient to highlight the problems to many readers with a biological background.

Additionally, what is the explanation for the atypically strong associations seen with Translation genes in Fig 4a/S17? Is this down to a small number of genes, as translation machinery should rarely be in the accessory genome?

[3] Thank you for these additions – Fig. S2 needs a legend.

Reviewer #2: The comments and concerns raised have been addressed.

Reviewer #3: The authors have satisfactorily addressed all previous comments and concerns. The revisions have significantly improved the clarity and quality of the manuscript. I am satisfied with the current version and recommend acceptance in its present form.

**********

Have the authors made all data and (if applicable) computational code underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data and code underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data and code should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data or code —e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: None

Reviewer #3: None

**********

PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #2: No

Reviewer #3: No

[NOTE: If reviewer comments were submitted as an attachment file, they will be attached to this email and accessible via the submission site. Please log into your account, locate the manuscript record, and check for the action link "View Attachments". If this link does not appear, there are no attachment files.]

Figure resubmission:

While revising your submission, we strongly recommend that you use PLOS’s NAAS tool (https://ngplosjournals.pagemajik.ai/artanalysis) to test your figure files. NAAS can convert your figure files to the TIFF file type and meet basic requirements (such as print size, resolution), or provide you with a report on issues that do not meet our requirements and that NAAS cannot fix.

After uploading your figures to PLOS’s NAAS tool - https://ngplosjournals.pagemajik.ai/artanalysis, NAAS will process the files provided and display the results in the "Uploaded Files" section of the page as the processing is complete. If the uploaded figures meet our requirements (or NAAS is able to fix the files to meet our requirements), the figure will be marked as "fixed" above. If NAAS is unable to fix the files, a red "failed" label will appear above. When NAAS has confirmed that the figure files meet our requirements, please download the file via the download option, and include these NAAS processed figure files when submitting your revised manuscript.

Reproducibility:

To enhance the reproducibility of your results, we recommend that authors of applicable studies deposit laboratory protocols in protocols.io, where a protocol can be assigned its own identifier (DOI) such that it can be cited independently in the future. Additionally, PLOS ONE offers an option to publish peer-reviewed clinical study protocols. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols

PLoS Comput Biol. doi: 10.1371/journal.pcbi.1014083.r006

Decision Letter 2

Tommy Tsan-Yuk Lam

5 Feb 2026

PCOMPBIOL-D-25-01407R2

Epistasis mediates the role of negative frequency-dependent selection in bacterial strain structure

PLOS Computational Biology

Dear Dr. Guillemet,

Thank you for submitting your manuscript to PLOS Computational Biology. After careful consideration, we feel that it has merit but does not fully meet PLOS Computational Biology's publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

Please submit your revised manuscript by Apr 07 2026 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at ploscompbiol@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pcompbiol/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

* A letter that responds to each point raised by the editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'. This file does not need to include responses to formatting updates and technical items listed in the 'Journal Requirements' section below.

* A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

* An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

If you would like to make changes to your financial disclosure, competing interests statement, or data availability statement, please make these updates within the submission form at the time of resubmission. Guidelines for resubmitting your figure files are available below the reviewer comments at the end of this letter.

We look forward to receiving your revised manuscript.

Kind regards,

Tommy Tsan-Yuk Lam, Ph.D.

Academic Editor

PLOS Computational Biology

Jennifer Flegg

Section Editor

PLOS Computational Biology

Journal Requirements:

If the reviewer comments include a recommendation to cite specific previously published works, please review and evaluate these publications to determine whether they are relevant and should be cited. There is no requirement to cite these works unless the editor has indicated otherwise.

1) We ask that a manuscript source file is provided at Revision. Please upload your manuscript file as a .doc, .docx, .rtf or .tex. If you are providing a .tex file, please upload it under the item type u2018LaTeX Source Fileu2019 and leave your .pdf version as the item type u2018Manuscriptu2019.

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Authors:

Please note here if the review is uploaded as an attachment.

Reviewer #1: I thank the authors for their patience, and the changes they have made to the analysis, which address my concerns.

My only remaining comments regard the presentation of the Results. The authors state that “The evidence for LD conservation is less clear (Table 2): we find patterns of LD being both more and less conserved than expected by chance.” As it is unlikely that simulations can exactly replicate the observed level of LD, this result essentially implies that the observed level is indistinguishable from that expected by chance, and therefore there is no significant evidence of LD.

The authors state in the Results, “This filtering is likely to remove some pairs of genes in strong positive epistasis (e.g. genes within the same operon),” then in the Discussion they state, “the removal of physically close gene pairs underestimates the extent of positive epistasis.” Similarly, elsewhere in the revised Results it is stated that “the distance-based filtering we use to limit the impact of physical linkage is very likely to filter out gene pairs in strong positive LD, which would contribute to the lack of conservation we observe.”

However, such short-range interactions do not affect the structure of the population, because each of the genes will be co-transferred by individual horizontal gene transfer events. The authors themselves acknowledge this in the Introduction, which states, “Epistasis refers to the interaction between genes at different loci.”

The authors should change the Results and Discussion to reflect the lack of evidence for classical epistasis shaping the population structure, as there is no evidence for long-range epistasis being conserved across populations.

Additionally, in the Abstract, it is stated, “make observations consistent with epistatic effects on gene associations”. This would be interpreted by a casual reader as evidence of classical epistasis. It would be helpful to clarify the findings by editing the statement to “make observations consistent with frequency-dependent epistatic effects on gene associations.”

One additional comment: the text refers to “clonal genealogies.” However, it is not clear that recombination could have been removed when constructing such a phylogeny, so I suspect it is not “clonal,” but an approximation from an alignment of recombining genotypes.

Reviewer #2: No further comments.

Reviewer #3: The authors have satisfactorily addressed all previous comments and concerns.

**********

Have the authors made all data and (if applicable) computational code underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data and code underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data and code should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data or code —e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: Yes

Reviewer #3: None

**********

PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #2: Yes: Rajib Saha

Reviewer #3: No

Figure resubmission:

While revising your submission, we strongly recommend that you use PLOS’s NAAS tool (https://ngplosjournals.pagemajik.ai/artanalysis) to test your figure files. NAAS can convert your figure files to the TIFF file type and meet basic requirements (such as print size, resolution), or provide you with a report on issues that do not meet our requirements and that NAAS cannot fix.

After uploading your figures to PLOS’s NAAS tool - https://ngplosjournals.pagemajik.ai/artanalysis, NAAS will process the files provided and display the results in the "Uploaded Files" section of the page as the processing is complete. If the uploaded figures meet our requirements (or NAAS is able to fix the files to meet our requirements), the figure will be marked as "fixed" above. If NAAS is unable to fix the files, a red "failed" label will appear above. When NAAS has confirmed that the figure files meet our requirements, please download the file via the download option, and include these NAAS processed figure files when submitting your revised manuscript.

Reproducibility:

To enhance the reproducibility of your results, we recommend that authors of applicable studies deposit laboratory protocols in protocols.io, where a protocol can be assigned its own identifier (DOI) such that it can be cited independently in the future. Additionally, PLOS ONE offers an option to publish peer-reviewed clinical study protocols. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols

PLoS Comput Biol. doi: 10.1371/journal.pcbi.1014083.r008

Decision Letter 3

Tommy Tsan-Yuk Lam

3 Mar 2026

Dear M. Guillemet,

We are pleased to inform you that your manuscript 'Epistasis mediates the role of negative frequency-dependent selection in bacterial strain structure' has been provisionally accepted for publication in PLOS Computational Biology.

Before your manuscript can be formally accepted you will need to complete some formatting changes, which you will receive in a follow up email. A member of our team will be in touch with a set of requests.

Please note that your manuscript will not be scheduled for publication until you have made the required changes, so a swift response is appreciated.

IMPORTANT: The editorial review process is now complete. PLOS will only permit corrections to spelling, formatting or significant scientific errors from this point onwards. Requests for major changes, or any which affect the scientific understanding of your work, will cause delays to the publication date of your manuscript.

Should you, your institution's press office or the journal office choose to press release your paper, you will automatically be opted out of early publication. We ask that you notify us now if you or your institution is planning to press release the article. All press must be co-ordinated with PLOS.

Thank you again for supporting Open Access publishing; we are looking forward to publishing your work in PLOS Computational Biology.

Best regards,

Tommy Tsan-Yuk Lam, Ph.D.

Academic Editor

PLOS Computational Biology

Jennifer Flegg

Section Editor

PLOS Computational Biology

***********************************************************

Reviewer's Responses to Questions

Comments to the Authors:

Please note here if the review is uploaded as an attachment.

Reviewer #1: I thank the authors for their patience with my comments.

Reviewer #2: It seems the comments raised were addressed.

Reviewer #3: There are no additional comments.

**********

Have the authors made all data and (if applicable) computational code underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data and code underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data and code should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data or code —e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: None

Reviewer #3: None

**********

PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #2: Yes: Rajib Saha

Reviewer #3: No

Associated Data

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

    Supplementary Materials

    S1 File. Supplementary information contains supplementary figures and supplementary notes referenced in the main text.

    (PDF)

    Attachment

    Submitted filename: PCompBiol Reviews.pdf

    pcbi.1014083.s002.pdf (291.8KB, pdf)
    Attachment

    Submitted filename: Revisions_2.pdf

    pcbi.1014083.s003.pdf (120.9KB, pdf)
    Attachment

    Submitted filename: response_reviewers_3.pdf

    pcbi.1014083.s004.pdf (38.8KB, pdf)

    Data Availability Statement

    The genome data used in this work is publicly available and can be accessed as NCBI BioProjects PRJEB2357, PRJEB2393, PRJEB2395, PRJEB2479, PRJEB2480, PRJEB2417, PRJEB2632. All relevant code has been deposited on the repository: https://doi.org/10.5281/zenodo.17471803.


    Articles from PLOS Computational Biology are provided here courtesy of PLOS

    RESOURCES