Odile Maliet
email: odile.maliet@orange.fr

Nicolas Loeuille

Hélène Morlon

An individual based model for the eco-evolutionary emergence of bipartite interaction networks

Keywords: ecological networks, mutualism, antagonism, nestedness, coevolution

How ecological interaction networks emerge on evolutionary time scales remains unclear. Here we build an individual-based eco-evolutionary model for the emergence of mutualistic, antagonistic and neutral bipartite interaction networks. Exploring networks evolved under these scenarios, we find three main results. First, antagonistic interactions tend to foster species and trait diversity, while mutualistic interactions reduce diversity. Second, antagonistic interactors evolve higher specialization, which results in networks that are often more modular than neutral ones; resource species in these networks often display phylogenetic conservatism in interaction partners. Third, mutualistic interactions lead to networks that are more nested than neutral ones, with low phylogenetic conservatism in interaction partners. These results tend to match overall empirical trends, demonstrating that structures of empirical networks that have most often been explained by ecological processes can result from an evolutionary emergence. Our model contributes to the ongoing effort of better integrating ecological interactions and macroevolution.

Introduction

Species in ecological communities engage in a diverse set of antagonistic and mutualistic interactions such as predation, parasitism, pollination and seed dispersal. These interactions are thought to have important consequences for species and trait diversity [START_REF] Ehrlich | Butterflies and plants: a study in coevolution[END_REF][START_REF] Van Valen | A new evolutionary law[END_REF][START_REF] Hembry | Coevolution and the diversification of life[END_REF], as well as the structure of ecological networks [START_REF] Bascompte | Plant-animal mutualistic networks: the architecture of biodiversity[END_REF][START_REF] Thébault | Stability of ecological communities and the architecture of mutualistic and trophic networks[END_REF][START_REF] Suweis | Emergence of structural and dynamical properties of ecological mutualistic networks[END_REF][START_REF] Dormann | Identifying causes of patterns in ecological networks: opportunities and limitations[END_REF]. In terms of diversity, empirical examples of very diverse communities seem more numerous in antagonistic (e.g. plant defense strategies, [START_REF] Futuyma | Macroevolution and the biological diversity of plants and herbivores[END_REF] than mutualistic interactions [START_REF] Hembry | Coevolution and the diversification of life[END_REF][START_REF] Chomicki | The impact of mutualisms on species richness[END_REF]. Eco-evolutionary models have indeed found that antagonistic interactions foster, while mutualistic interactions impede, trait diversity [START_REF] Yoder | When does coevolution promote diversification?[END_REF]. If and how antagonistic and mutualistic interactions affect the generation and maintenance of species diversity is less clear [START_REF] Weber | Evolution in a community context: on integrating ecological interactions and macroevolution[END_REF].

In terms of the structure of ecological networks, empirical studies have repeatedly shown that this structure is highly non-random [START_REF] Fontaine | The ecological and evolutionary implications of merging different types of networks[END_REF]. Two main patterns have been reported: modularity, with subsets of species interacting more strongly among each other than with the rest of the community [START_REF] May | Will a large complex system be stable?[END_REF][START_REF] Krause | Compartments revealed in food-web structure[END_REF], and nestedness, with specialist species preferentially interacting with generalists [START_REF] Bascompte | The nested assembly of plantanimal mutualistic networks[END_REF][START_REF] Jordano | Invariant properties in coevolutionary networks of plant-animal interactions[END_REF][START_REF] Lewinsohn | Structure in plant-animal interaction assemblages[END_REF][START_REF] Bascompte | Plant-animal mutualistic networks: the architecture of biodiversity[END_REF][START_REF] Thébault | Stability of ecological communities and the architecture of mutualistic and trophic networks[END_REF][START_REF] Rohr | On the structural stability of mutualistic systems[END_REF]. While several factors play a role in explaining network structure, including intimacy (i.e. the degree of physical proximity or integration of partner taxa, [START_REF] Fontaine | The ecological and evolutionary implications of merging different types of networks[END_REF]) and phylogenetic scale [START_REF] Beckett | Coevolutionary diversification creates nested-modular structure in phage-bacteria interaction networks[END_REF], the nature of the interaction seems particularly important. In a comparison of 95 networks, [START_REF] Fontaine | The ecological and evolutionary implications of merging different types of networks[END_REF] showed that non-intimate antagonistic networks are often modular, while mutualistic networks are often nested, although there are clearly deviations from this general pattern [START_REF] Olesen | The modularity of pollination networks[END_REF][START_REF] Pilosof | Host-parasite network structure is associated with community-level immunogenetic diversity[END_REF]. Many studies have sought to explain the processes driving these non-random structures without reaching consensus.

One of the main hypotheses put forward for explaining non-random network structures is the stability hypothesis. Species rich communities are not stable when species interact at random [START_REF] May | Will a large complex system be stable?[END_REF][START_REF] Krause | Compartments revealed in food-web structure[END_REF][START_REF] Jordano | Invariant properties in coevolutionary networks of plant-animal interactions[END_REF][START_REF] Montoya | Ecological networks and their fragility[END_REF]; this instability is counteracted by nonrandom network structures that depend on the type of interaction [START_REF] Fontaine | The ecological and evolutionary implications of merging different types of networks[END_REF]. In particular, stable species coexistence is reached in modular networks in the case of antagonistic interactions, and in nested networks in the case of mutualistic interactions [START_REF] Thébault | Stability of ecological communities and the architecture of mutualistic and trophic networks[END_REF]. Nestedness reduces effective interspecific competition [START_REF] Bastolla | The architecture of mutualistic networks minimizes competition and increases biodiversity[END_REF] and broadens the range of ecological conditions under which mutualistic species can coexist [START_REF] Rohr | On the structural stability of mutualistic systems[END_REF][START_REF] Saavedra | Nested species interactions promote feasibility over stability during the assembly of a pollinator community[END_REF][START_REF] Grilli | Feasibility and coexistence of large ecological communities[END_REF], especially in the presence of adaptive foraging [START_REF] Valdovinos | Niche partitioning due to adaptive foraging reverses effects of nestedness and connectance on pollination network stability[END_REF]. Anti-modularity has a destabilizing effect in most ecological communities [START_REF] Grilli | Modularity and stability in ecological communities[END_REF]. Nestedness in mutualist networks and modularity in antagonist networks also limit co-extinction cascades [START_REF] May | Will a large complex system be stable?[END_REF][START_REF] Krause | Compartments revealed in food-web structure[END_REF][START_REF] Memmott | Tolerance of pollination networks to species extinctions[END_REF][START_REF] Stouffer | Compartmentalization increases food-web persistence[END_REF].

A second family of hypotheses to explain nonrandom, interaction-dependent structures, relies on trait-dependent interactions. For example, [START_REF] Santamaría | Linkage rules for plant-pollinator networks: trait complementarity or exploitation barriers?[END_REF] and Rezende et al. (2007a) showed that interactions determined by either phenotypic difference or phenotypic similarity can generate nested networks, in particular when several traits are involved and when there is a phylogenetic signal in trait values. [START_REF] De Andreazzi | Coevolution by different functional mechanisms modulates the structure and dynamics of antagonistic and mutualistic networks[END_REF] also recently showed that a strong effect of species trait values on the probability for two species to interact helps in explaining network structure, and in particular that trait matching fosters trait coevolution and helps in explaining the structure of antagonistic networks. Related to the trait-based hypothesis is the observation that the non-random structure of networks can emerge without being selected for when interaction strength is inherited from the parent species (the "network spandrel" hypothesis [START_REF] Maynard | Network spandrels reflect ecological assembly[END_REF][START_REF] Valverde | The architecture of mutualistic networks as an evolutionary spandrel[END_REF]. Finally, differences in abundances across species can on their own generate non-random structures. In a neutral world where individuals encounter and interact at random with one another, individuals from rare specialist species are more likely to interact with individuals from abundant generalists. As species abundance distributions are generally imbalanced, with many rare species and a few abundant ones, this leads to nested networks [START_REF] Vázquez | Degree distribution in plant-animal mutualistic networks: forbidden links or random interactions?[END_REF][START_REF] Vázquez | Evaluating multiple determinants of the structure of plant-animal mutualistic networks[END_REF][START_REF] Santamaría | Linkage rules for plant-pollinator networks: trait complementarity or exploitation barriers?[END_REF][START_REF] Krishna | A neutral-niche theory of nestedness in mutualistic networks[END_REF][START_REF] Staniczenko | The ghost of nestedness in ecological networks[END_REF][START_REF] Coelho | Neutral community dynamics and the evolution of species interactions[END_REF]. Hence, while the often-observed modularity of antagonistic networks cannot be explained by neutral processes alone, the frequent nestedness of mutualistic networks can be a pure result of neutral encounters.

Studies seeking to explain the non-random structure of species interaction networks have rarely focused on their emergence over evolutionary time scales, despite empirical evidence that there are evolutionary (phylogenetic) constraints to who interacts with whom (Rezende et al., 2007b;[START_REF] Elias | Evolutionary history and ecological processes shape a local multilevel antagonistic network[END_REF]. They have instead often fixed the ecological context, for example by assuming an initial network is subject to local extinctions [START_REF] Thébault | Stability of ecological communities and the architecture of mutualistic and trophic networks[END_REF], or fixing the number of species and either the species abundance distribution [START_REF] Nuismer | Coevolution and the architecture of mutualistic networks[END_REF] or the species trait distribution [START_REF] Santamaría | Linkage rules for plant-pollinator networks: trait complementarity or exploitation barriers?[END_REF]. There are notable exceptions though. [START_REF] Minoarivelo | Trait-mediated interaction leads to structural emergence in mutualistic networks[END_REF] used an adaptive dynamics framework to show that coevolution can lead to both nested and modular networks for mutualistic interactions. In de Andreazzi et al. (2019), the authors investigated the effect of trait coevolution on network structure, but with the number of both species and interactions fixed according to empirical networks. In [START_REF] Poisot | How ecological networks evolve[END_REF], the authors fitted to empirical networks a macroevolutionary model formalizing the evolution of species interactions, and surprisingly did not detect major differences between antagonistic and mutualistic networks. A recent study showed that neutral networks can evolve nested structures, probably as a result of asymmetric abundances, but did not investigate the effect of mutualistic and antagonistic interactions [START_REF] Coelho | Neutral community dynamics and the evolution of species interactions[END_REF]. Finally, [START_REF] Maynard | Network spandrels reflect ecological assembly[END_REF] and [START_REF] Valverde | The architecture of mutualistic networks as an evolutionary spandrel[END_REF] showed that nestedness and modularity may emerge from speciation divergence dynamics within antagonistic networks. The lack of a unified model mimicking the evolutionary emergence of species interaction networks as species diversify clearly limits our understanding of the macroevolutionary dynamics and consequences of inter-species interactions [START_REF] Weber | Evolution in a community context: on integrating ecological interactions and macroevolution[END_REF][START_REF] Harmon | Detecting the macroevolutionary signal of species interactions[END_REF].

Here we investigate the emergence of ecological networks as species coevolve, when individuals engage into mutualistic, antagonistic or neutral interactions. We develop an individual-based, stochastic eco-evolutionary model (BipartiteEvol) that allows us to assess the effect of interaction type on species and trait diversity, network structure, and phylogenetic signal in interaction partners. We discuss results obtained when simulating the model in light of previous literature and empirical observations.

Methods

An individual-based model for the eco-evolutionary emergence of bipartite interaction networks

We develop an individual-based, stochastic model, with discrete time steps and fixed population size, described in detail in our Supplementary Information. This model can be seen as an extension, in two main directions, of the spatially explicit neutral model of biodiversity where dynamics are modeled on a grid of N cells [START_REF] Chave | A spatially explicit neutral model of β-diversity in tropical forests[END_REF]. As in the metacommunity version of this model, our model best represents evolutionary outcomes in a closed community without immigration. The first extension is that here each cell is occupied by two individuals, one from each of two interaction guilds (guild A and B), and this co-occurrence determines interaction [START_REF] Canard | Empirical evaluation of neutral interactions in host-parasite networks[END_REF]. The second extension is that each individual is characterized by its (potentially multidimensional) trait value, and has fitness determined by both its trait value and that of the individual from the other guild occupying the cell. Offspring experience mutations that induce genetic differentiation and small trait deviations from their parents [START_REF] Loeuille | Effects of local negative feedbacks on the evolution of species within metacommunities[END_REF].

Genetic differentiation eventually leads to speciation [START_REF] Manceau | Phylogenies support out-of-equilibrium models of biodiversity[END_REF][START_REF] Rosindell | Unifying ecology and macroevolution with individual-based theory[END_REF].

The nature of the interactions can affect evolutionary outcomes in an eco-evolutionary feedback loop between who interacts with whom, the resulting adaptive pressures, and the gain or loss of interactions linked to adaptations to these pressures. At each time step, we track the trait values of each individual, their genealogical relationship, whether they experienced a mutation, and who they interact with. At the end of the simulations, we construct the resulting species phylogenies and species interaction networks.

Eco-evolutionary dynamics

We start the simulations with a monomorphic population in each guild, all descending from a unique parent. At each time step we update the grid as follows:

• We select one individual from guild A at random and kill this individual. We record the trait value x B of the individual of guild B present on this cell.

• We compute the fitness of all individuals of guild A present in the grid, should it interact with an individual of trait x B .

• We select an individual from guild A to be the parent of the individual that replaces the killed one with probabilities proportional to each individual fitness. Hence, the filiation of the new individual depends on trait values and chance. We do not introduce dispersal limitation here, but this could be done in future work by selecting the parent with a probability proportional to its fitness times a dispersion kernel.

• The new individual from guild A has a probability µ A to experience a mutation, in which case its new trait is drawn independently in each dimension in a normal distribution centered on the parental trait with standard deviation σ. If no mutation occurs, the new individual inherits the trait value of its parent.

• We repeat the four previous steps for guild B.

• We record the genealogy obtained in each of the two guilds, as well as the mutations that occurred on this genealogy.

Modeling the effect of trait-specific interactions on fitness Each individual is characterized by its trait value x, which can have any dimension d. The distance in trait space of two interacting individuals determines the effect of the interaction on their fitness. Classical traits with fitness effects include proboscis and floral tube length, color preferences, and organism sizes or phenology in mutualist partners such as plants and their pollinators, or the presence of metabolic compounds and the ability to metabolize these compounds in antagonist partners such as plants and their herbivores. For example, a mismatch in phenology between a plant and its pollinator would induce a cost in reproductive success for the plant and in the ability to feed for the pollinator. We use a classical trait matching expression given by a Gaussian function, with maximal fitness effect when the traits of two interacting individuals are similar (Fig. S1, [START_REF] Loeuille | Evolutionary emergence of size-structured food webs[END_REF]; Yoder and Nuismer ( 2010)). The fitness function is parametrized by α, which measures the specificity of the trait matching: high α values correspond to scenarios where fitness effects are preponderant in interactors with very similar trait values (i.e. highly specialized interactions), while low α values correspond to more neutral scenarios. Thereafter for simplicity we refer to 1 α as "niche width". The fitness function is further parametrized by a parameter r, the ratio between the maximum and minimum fitness, that measures the overall effect of trait differences.

In mutualistic interactions, individuals from both guilds have higher fitness (W A and W B ) when they have similar trait values:

W A (x A , x B ) = 1 r A -1 + e -x A -x B 2 ×(α 2 A /2) W B (x A , x B ) = 1 r B -1 + e -x A -x B 2 ×(α 2 B /2) (1)
In antagonistic interactions, individuals from the consumer clade (B) have higher, and those from the resource clade (A) lower, fitness when they have similar trait values, so the fitness differs from the mutualistic scenarios only for clade A:

W A (x A , x B ) = 1 r A -1 + 1 -e -x A -x B 2 ×(α 2 A /2) W B (x A , x B ) = 1 r B -1 + e -x A -x B 2 ×(α 2 B /2) (2)
We obtained the neutral case by taking α = 0 in the expression for mutualistic fitness (taking α = 0 in the antagonistic version would yield identical simulations).

Defining species and phylogenies Based on the resulting genealogies with mutations, we define species following the model of Speciation by Genetic Differentiation [START_REF] Manceau | Phylogenies support out-of-equilibrium models of biodiversity[END_REF], except that we allow s, the number of mutations needed to belong to different species, to vary (similarly to what is done in [START_REF] Rosindell | Unifying ecology and macroevolution with individual-based theory[END_REF]). Species are thus the smallest monophyletic group of individuals from the genealogy such that two individuals separated by less than s mutations belong to the same species. This is a protracted mode of speciation, and the time needed for speciation to complete increases with parameter s. This species definition allows for polymorphic species.

We compute the resulting species-level phylogenies from the genealogy with mutation positions [START_REF] Manceau | Phylogenies support out-of-equilibrium models of biodiversity[END_REF]. Speciation occurs as the result of accumulating mutations, whatever their effect on the phenotype. It can thus merely result from drift, and we expect species diversity to build up under neutral dynamics. However, if trait diversity is favored -as would be the case if the presence of predators generates disruptive selection -we expect to see an increased species diversity as more mutations are likely to get fixed.

From individuals' interaction to species interaction networks The interaction network is defined at the scale of the entire grid and is based on individuals' co-occurrence: we consider that two individuals interact if they co-occur in the same cell. Next, at the species level, we consider both a quantitative and a binary network. For the quantitative network, we take the strength of the interaction between two species to be the number of pairs of individuals of these species interacting together. For the binary network, we consider that two species interact if at least one pair of individuals of these species interact (that is if their interaction strength in the quantitative network is nonzero). While interactions in our networks are constructed based on only co-occurrence, they depend on trait values through the effect of traits on invasion probabilities. An interaction network in our model thus results from the cumulative effects of smaller scale interaction events (as for example in [START_REF] Pillai | Metacommunity theory explains the emergence of food web complexity[END_REF].

We provide codes for running simulations of BipartiteEvol in RPANDA (Morlon et al., 2016, function sim.BipartiteEvol).

Analyzing emerging patterns

In order to explore emerging patterns, we performed a series of simulations under neutral, mutualistic and antagonistic scenarios. We followed the evolution of a (closed) community made of N = 4000 individuals in each guild during 8e7 death events. This simulation duration was enough for most of the simulations to have reached stationary state, at least for the summary statistics we followed (Fig. S2-S3). We ran most of our simulations with a trait dimension d = 3, as ecological networks are thought to be best described by traits with several yet few dimensions [START_REF] Eklöf | The dimensionality of ecological networks[END_REF]. To check the robustness of our result to trait dimensionality, we also ran simulations for d = 1 and d = 10 for a selected parameter set (Fig S28 -S34). We chose initial trait values 2 and 0 for guild A and B in all trait dimensions. We also chose a standard deviation σ = 1; considering a different σ would be equivalent to dividing α A and α B by σ. We held the mutation probabilities µ A and µ B constant at 0.05. We fixed r A at 10 and r B at +∞. In the case of mutualistic interactions, this renders species from guild B obligate mutualists (their fitness is zero if they do not interact with species from guild A, e.g. pollinators that entirely depend on a specific clade of plants) while species from guild A are facultative mutualists (e.g. plants that can be pollinated by pollinators not represented in B). In the case of antagonistic interactions, r B = +∞ means that consumer species entirely depend on interaction with their resources. Besides the neutral case (α A = α B = 0), we simulated all the combinations of α A and α B in 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 10 for both mutualistic and antagonistic interactions. We performed 10 simulations for each scenario and each parameter set (20 in the neutral case).

At the end of each simulation, we built the resulting phylogenies and interaction networks using three different species definition thresholds s (s = 1, 10 and 50). We computed species richness, as well as trait diversity on each trait dimension as the variance in trait values across all individuals. In addition, in order to investigate under which conditions trait coevolution between species on the two sides of the network occurs, we measured the correlation in trait values of co-occurring individuals.

We computed nestedness and modularity using the R-package bipartite (Almeida-Neto and Ulrich, 2011; [START_REF] Dormann | Introducing the bipartite package: analysing ecological networks[END_REF]). Nestedness was measured with the NODF metric using the function nested, with method = "weighted NODF" for quantitative networks and method = "NODF2" for binary networks. Modularity was computed for quantitative networks only, using the function computeModules (the corresponding quanBiMo algorithm is not adapted to binary networks (Dormann and Strauss, 2014)). We compared the binary nestedness values to the distribution of values obtained for two null models. In the first, thereafter called NM1, the network connectance is kept constant (method "shuffle.web" in the function nullModel). In the second, thereafter called NM2, row and column sums of the interaction matrix are kept constant (method "r2d"). This is equivalent to randomly reassigning a position on the grid for all individuals regardless of their trait values, which is also how we generate interactions in our neutral simulations and provides a way to correct for species abundances. We also compared the quantitative nestedness and modularity values to the distribution of values obtained for NM2 (NM1 is applicable to only binary networks). We computed Z-scores, defined as x-µ σ , where for a given metric x is the value outputted by our simulation and µ and σ are the mean and standard deviation of the values under the null model. While Z-scores are not appropriate for comparing nestedness values between networks of different sizes [START_REF] Song | Why are some plant-pollinator networks more nested than others?[END_REF], they are a good way of assessing the significance of nestdedness values against a null model. Finally, we computed the phylogenetic signal of interaction partners using a Mantel test that assesses the significance of the correlation between the phylogenetic distance of two species and the dissimilarity of their interaction partners. In order to limit the effect of species definition on our results, we used a phylogenetic metric to quantify this dissimilarity. We used the (weighted) fraction of unshared phylogenetic branch length between the two sets of interaction partners (computed using quantitative uniFrac [START_REF] Lozupone | Quantitative and qualitative β diversity measures lead to different insights into factors that structure microbial communities[END_REF], "d_1" in the function GUniFrac from the R package GUniFrac [START_REF] Chen | Gunifrac: generalized unifrac distances[END_REF]). We also performed the analyses with a non-phylogenetic metric, the Jaccard dissimilarity index -computed with the function cluster_similarity from the R-package clusteval -for comparison.

Results

Figure

Trait diversity

In mutualistic scenarios, trait values stay fairly constant through time (Fig. 1A) and trait diversity is lower than in neutral scenarios (Fig. 2A & Fig. S4). Trait matching in mutualistic networks results in stabilizing selection that constrains trait evolution on both sides of the network.

Trait diversity within a guild is generally constrained by niche width in this guild, but not by niche width in the interacting guild, even if exceptions occur in extreme cases when niche width in one of the two guilds is smaller than, or comparable to, the effect size of mutations (here fixed to σ = 1, Fig. 2A & Fig. S4). The correlation between the traits of interacting individuals is slightly positive but stays very low (Fig. 2B & Fig. S5).

Patterns are strikingly different in antagonistic scenarios, where clusters of traits progressively emerge from co-evolutionary dynamics (Fig. 1B). Disrupting selection acting on resource species typically increases trait diversity compared to neutral scenarios for both consumers and resources, with similar levels of diversity in the two guilds (Fig. 2A & Fig. S4). Trait diversity increases with the niche widths of both resource and consumer species, but collapses when consumers have a larger niche than resources (Fig. 2A & Fig. S4). The traits of interacting individuals are positively correlated, suggesting strong trait coevolution (Fig. 2B & Fig. S5).

Species richness

Consistent with temporal dynamics of trait diversity, species diversification is lower in mutualistic than antagonistic networks (Fig. 1A versus B). Species richness is systematically larger in antagonistic than in mutualistic networks, regardless of niche width and species definition (Fig. 2C,D & Fig. S6-S9).

In mutualistic scenarios, species richness tends to be lower than in neutral scenarios (Fig. 2C,D & Fig. S6-S9). Species richness is comparable to what is obtained in the neutral case when species' niches are so large that individuals have approximately the same fitness regardless of who they interact with. But for narrower niches, trait matching is more influential and stabilizing selection inhibits speciation. Species richness within a guild thus decreases when niches in that guild become narrower (Fig. 2C,D & Fig. S6-S9).

In antagonistic scenarios, species richness is in general higher for resource than for consumer species (Fig. 2C,D & S7-S9). The effect of niche width on species richness depends on the species definition threshold s. For a low s, resource species richness is similar to what is obtained in neutral simulations and unaffected by niche width of either resource or consumer species (Fig. 2C & S7).

Consumer species richness tends to be lower than in neutral simulations (Fig. 2C & S7). It is not affected by the niche width of resource species (Fig. 2C) but decreases when the niches of consumer species become narrower, as long as it remains larger than the effect size of mutations. For a higher s (around 50, Fig. 2D & S9), species richness is affected by niche width in a similar way for resource and consumer species, and can be either higher or lower than in neutral simulations. Cases when species richness is higher than in neutral simulations correspond to scenarios with intermediate resource niche width, and narrower niche widths for consumer than resource species (Fig. 2D,S9).

Network structure

Mutualistic interactions typically lead to the progressive emergence of nested networks (Figure 1A), while antagonistic interactions lead to modular networks (Figure 1B). When we look at network metrics without any comparison to a null model, most networks that have higher nestedness values than those in the neutral case were generated in mutualistic scenarios, while most of those that have higher modularity values than those in the neutral case were generated in antagonistic scenarios (Fig. 3A,

Fig S10 & S15).
When compared to the null model that corrects for only connectance (NM1), all networks show up as significantly nested, including neutral ones (Fig. 3B, S12-S13 & S17-S18). Z-values are very high and mostly depend on the diversity of the community, with higher Z-values obtained for more diverse communities (Fig. S14).

When compared to the null model that corrects for abundance (NM2), neutral models are neither nested nor anti-nested, and they are not modular either (Fig. 3C,D & Fig. S19-S20, S22-S23).

Mutualistic networks are similar to neutral ones. The only deviation occurs when the facultative mutualists have an intermediate niche width that is larger than that of the obligate mutualists; in this case, mutualistic networks are slightly anti-nested and modular (Fig. S19-S20, S22-S23).

Antagonistic networks deviate sharply from neutral ones; they most often exhibit a modular, antinested structure that peaks at intermediate resource niche width (Fig. 3C,D) and small consumer niche width (Fig. S19,S22). The results stay qualitatively similar for s = 10 (Fig. S20,S23).

Phylogenetic signal

While modules in antagonistic networks seem strongly constrained by phylogenetic history (Fig. 1B), interactions in mutualistic networks seem rather independent from this history (Fig. 1A).

Indeed, the Mantel correlation between phylogenetic distance and similarity in interaction partners is generally weak and non-significant on both sides of mutualistic networks, comparable to what is found for neutral networks (Fig. 4A &B). The correlation is stronger in antagonistic networks, and significant in many simulations (Fig. 4A,B). This phylogenetic signal is often stronger for resource than for consumer species and higher for an intermediate consumer niche width and/or wider resource niche width (Fig. 4B, Fig. S26). Results are qualitatively similar across species definition thresholds and dissimilarity metrics, although fewer networks display significant correlation values for s = 1 than for s = 10 and for the Jaccard than for the Unifrac metric (Fig. S24-S27).

Discussion

Our model allows a direct comparison of the effect of antagonistic, mutualistic, and neutral interactions on the dynamics of trait and species diversity as well as on the structure of the interaction network. We find that antagonistic interactions enhance both trait and species diversity, and result in modular interaction networks with phylogenetic signal in interaction partners. Mutualistic interactions instead limit trait and species diversity, and result in interaction networks that otherwise resemble neutral networks, with a tendency for nestedness rather than modularity, and low phylogenetic signal in interacting partners.

We discuss these results in light of empirical observations, keeping in mind that our model best mimics eco-evolutionary dynamics in a closed metacommunity, where diversity is the result of speciation-extinction dynamics, while most empirical networks are built at the community level,

where diversity can also be introduced through immigration, which can change qualitative patterns (as in [START_REF] Maynard | Network spandrels reflect ecological assembly[END_REF]. Similar to what has been done in developments of the neutral biodiversity model, our model could be developed to include dispersal limitation and to sample local communities at different spatial scales, or as a continent-island model, where the local community receives immigrants from the metacommunity. This would also help understand how local networks assemble from 'meta-networks' [START_REF] Gravel | Trophic theory of island biogeography[END_REF][START_REF] Morlon | Effects of trophic similarity on community composition[END_REF]. Other limitations of our model include the 'zero-sum' assumption that total population size remains constant, not accounting for sexual reproduction, and not varying the degree of intimacy, which can all affect network structure.

Our result that antagonistic interactions tend to enhance, while mutualistic ones impede, trait and species diversity, is generally consistent with previous empirical and theoretical studies [START_REF] Ehrlich | Butterflies and plants: a study in coevolution[END_REF][START_REF] Yoder | When does coevolution promote diversification?[END_REF][START_REF] Janz | Ehrlich and raven revisited: mechanisms underlying codiversification of plants and enemies[END_REF][START_REF] Hembry | Coevolution and the diversification of life[END_REF]. For example, previous studies suggest that investment in defense traits results in higher diversification rates in North American milkweeds [START_REF] Agrawal | Evidence for adaptive radiation from a phylogenetic study of plant defenses[END_REF], while specialized pollination in Yucca-moth interactions does not increase Yucca diversification [START_REF] Smith | Pattern and timing of diversification in yucca (agavaceae): specialized pollination does not escalate rates of diversification[END_REF]. Consistently, [START_REF] Armbruster | Associations between floral specialization and species diversity: cause, effect, or correlation?[END_REF] showed that in several groups of angiosperms, diversity promotes floral specializationthrough character displacement -rather than the reverse. Still, we do not exclude the possibility that in some systems mutualism has a positive impact on diversification, as has been suggested by other studies, such as in the case of fig-wasp interactions [START_REF] Cruaud | An extreme case of plant-insect codiversification: figs and fig-pollinating wasps[END_REF]. Indeed our model may output different results regarding the effect of mutualism if we allowed total population sizes to vary and/or if we accounted for dispersal limitation and/or sexual reproduction. Mutualistic interactions may indeed increase the density of individuals a community can sustain, either through more efficient feeding and reproduction or by opening new adaptive zones. This could in turn allow the maintenance of more diverse communities [START_REF] Rosenzweig | Species diversity in space and time[END_REF][START_REF] Emerson | Species diversity can drive speciation[END_REF][START_REF] Joy | Symbiosis catalyses niche expansion and diversification[END_REF]. It has also been proposed that geographical isolation is necessary for mutualism to promote speciation, and our non-spatial model cannot account for this potential effect [START_REF] Thompson | Geographic structure and dynamics of coevolutionary selection[END_REF][START_REF] Kay | The role of animal pollination in plant speciation: integrating ecology, geography, and genetics[END_REF]. In the case of pollination, mutualistic interactions can also facilitate reproductive isolation, which cannot be modeled by our asexual model (van der Niet and Johnson, 2012). Our results suggest that mutualism on its own, in the absence of such mechanisms, is unlikely to promote diversity.

Our model generates clear structural differences between antagonistic and mutualistic communities. We find that antagonist interactions generate modular networks, regardless of whether modularity values are corrected for abundance or not. This modularity emerges as a response to reciprocal specialization and coevolution between resources and consumers, as demonstrated by the positive correlation between the traits of interacting partners. Our results regarding nestedness are much more contingent on whether or not nestedness values are corrected for connectance and/or abundance. Raw nestedness values are higher in mutualistic than neutral (and antagonistic) communities, as observed in empirical networks [START_REF] Thébault | Stability of ecological communities and the architecture of mutualistic and trophic networks[END_REF][START_REF] Fontaine | The ecological and evolutionary implications of merging different types of networks[END_REF].

When we do not correct for species abundances, all the networks, including neutral and antagonistic networks, are significantly nested. Finally, when we correct for species abundances, nestedness values are non-significant for neutral communities, and either non-significant or significantly lower than those obtained for the null model for antagonist (and a few mutualist) communities. These results are consistent with the literature, as most empirical or theoretical studies that found significant nestedness in bipartite networks did not use a null model correcting for species abundances [START_REF] Thébault | Stability of ecological communities and the architecture of mutualistic and trophic networks[END_REF][START_REF] Lewinsohn | Structure in plant-animal interaction assemblages[END_REF][START_REF] Bascompte | The nested assembly of plantanimal mutualistic networks[END_REF], while those that corrected for abundances did not find a clear nested pattern [START_REF] Vázquez | Degree distribution in plant-animal mutualistic networks: forbidden links or random interactions?[END_REF][START_REF] Staniczenko | The ghost of nestedness in ecological networks[END_REF][START_REF] Canard | Empirical evaluation of neutral interactions in host-parasite networks[END_REF]. The nestedness signal observed in bipartite networks may thus well be linked to uneven species abundance distributions, in agreement with the neutral hypothesis [START_REF] Vázquez | Degree distribution in plant-animal mutualistic networks: forbidden links or random interactions?[END_REF][START_REF] Vázquez | Evaluating multiple determinants of the structure of plant-animal mutualistic networks[END_REF][START_REF] Santamaría | Linkage rules for plant-pollinator networks: trait complementarity or exploitation barriers?[END_REF][START_REF] Krishna | A neutral-niche theory of nestedness in mutualistic networks[END_REF][START_REF] Staniczenko | The ghost of nestedness in ecological networks[END_REF][START_REF] Coelho | Neutral community dynamics and the evolution of species interactions[END_REF]. In this case, understanding differences in raw nestedness values between mutualist, neutral, and antagonist communities boils down to understanding why communities are increasingly asymmetrical in abundances as we move from antagonist to neutral and finally mutualist communities. Under our model, the relatively low asymmetry of species abundances in antagonist networks could be linked to the coexistence of several abundant species facilitated by modular structures. The strong asymmetry of species abundances in mutualist networks could be linked to the transient nature of many rare species; we indeed often observed a single adaptive optimum in our simulated mutualist networks, suggesting that mutants could frequently be maladapted. In addition to this dominating effect of abundance, trait-based preferential interactions reduce nestedness in antagonist communities, while this effect is generally insignificant in mutualist communities in which trait values are quite constrained. The differences in network structure between antagonistic and mutualistic communities generated by our model are consistent with the classical dichotomy between antagonistic and mutualistic structures [START_REF] Thébault | Stability of ecological communities and the architecture of mutualistic and trophic networks[END_REF][START_REF] Fontaine | The ecological and evolutionary implications of merging different types of networks[END_REF]. While many empirical examples show that this dichotomy is not as general as once thought [START_REF] Pilosof | Host-parasite network structure is associated with community-level immunogenetic diversity[END_REF][START_REF] Olesen | The modularity of pollination networks[END_REF], our model shows that it can emerge from simple evolutionary rules at the individual level. Relaxing simplifying hypotheses of our model could provide a more nuanced view. For example, sexual reproduction, spatial structure, fluctuation in population sizes and intimacy could generate modular mutualistic communities, as is sometimes observed in empirical data [START_REF] Olesen | The modularity of pollination networks[END_REF], by allowing trait diversification and the creation of clusters in trait space.

Our results regarding phylogenetic signal, which measures evolutionary conservatism in interaction partners, are also consistent with empirical observations for antagonistic communities, in which resource species generally show a stronger phylogenetic signal than consumer species, once again in accordance to empirical observations [START_REF] Krasnov | Phylogenetic signal in module composition and species connectivity in compartmentalized host-parasite networks[END_REF][START_REF] Elias | Evolutionary history and ecological processes shape a local multilevel antagonistic network[END_REF][START_REF] Fontaine | Comparing the conservatism of ecological interactions in plantpollinator and plant-herbivore networks[END_REF]. In plant-herbivore systems, the stronger conservatism in interaction partners seen in plants has sometimes been interpreted as the combination of factors acting on both sides of the network. Chemical defenses in plants are difficult and therefore slow to evolve and thus display a high phylogenetic conservatism. In herbivores on the contrary, resource shifts among close relatives to avoid enemies and/or reproductive interference are frequent, reducing phylogenetic conservatism [START_REF] Fontaine | Comparing the conservatism of ecological interactions in plantpollinator and plant-herbivore networks[END_REF]. However, in our simulations trait evolutionary rates, which are controlled by the mutation probability and the effect size of mutations, were symmetrical between resource and consumer species. We did not include enemies or reproductive interference either. We instead suggest that the difference in phylogenetic signal between resource and consumer species is linked to a difference in the nature of the selection pressure they experience. Resource species experience a selection pressure to avoid consumption, and they can evolve in almost any direction to escape consumers (only the few directions in trait space favorable to consumers must be avoided).

Consumers instead experience a selection pressure to evolve specific traits adapted to consuming the existing resource species, and it is thus not uncommon to see resource shifts and convergence in traits, even between rather phylogenetically distant species, which weakens phylogenetic signal.

In mutualistic communities, our model generally does not display a significant phylogenetic signal.

While a tendency towards lower phylogenetic signal in mutualist compared to antagonistic communities has been observed in empirical communities [START_REF] Fontaine | Comparing the conservatism of ecological interactions in plantpollinator and plant-herbivore networks[END_REF], it is significant (Rezende et al., 2007b). This disconnect between our model and empirical networks is likely linked to the restricted evolved trait range produced by our mutualistic model, and the result could change if sexual reproduction, spatial structure and/or variable population size were accounted for.

The general qualitative patterns discussed above hold for a large range of parameter space with a noticeable effect of niche width -which in our model is closely related to selection pressures -on the values of the different metrics we measured. In antagonistic communities, we found the strongest patterns -for all observed metrics, including diversity, network structure and phylogenetic signal -when niche width is larger for resources than for consumers. This situation corresponds to the case when selection pressures promote the evolution of specialization to specific resources in consumers. As detailed above, this specialization leads to modular structures, and imposes a strong disruptive selection pressure on resources that enhances diversity and strengthens phylogenetic signal by preventing trait convergence. In mutualistic scenarios, niche width in one guild impacts mostly trait and species diversity in that guild, but not in the interacting guild; small niche width indeed results in stronger stabilizing selection that constrains diversity, but does not affect the strength of stabilizing selection in the interacting guild. The only cases when niche width impacts network structure in mutualist networks occur when there is a very high asymmetry in niche width between the two guilds, in which case species from the small niche guild will evolve specialization in response to the high trait variability in the large niche guild, leading to the emergence of modular networks that resemble these seen in antagonistic scenarios, or some empirical mutualistic networks [START_REF] Olesen | The modularity of pollination networks[END_REF]. The patterns were robust to trait dimensionality, which we did not expect considering previous literature [START_REF] Gilman | Coevolution in multidimensional trait space favours escape from parasites and pathogens[END_REF][START_REF] Ispolatov | Individual-based models for adaptive diversification in high-dimensional phenotype spaces[END_REF]. Future work could investigate this aspect more thoroughly, along with adding limits to the trait space and/or a correlation between the traits. Trait correlations could produce interesting emerging behaviors, especially if they are asymmetrical between the two guilds.

Our eco-evolutionary model allowed us to study the effect of different types of interactions on the emergence of ecological networks as species and traits diversify. Despite the simplicity of the processes involved, the model generated clear differences between mutualistic and antagonistic communities that are broadly consistent with empirical observations. There is a lot of room for future developments, such as accounting for geographical processes [START_REF] Thompson | The geographic mosaic of coevolution[END_REF], dispersal from meta-to local communities, and the simultaneous effects of different interaction types [START_REF] Fontaine | The ecological and evolutionary implications of merging different types of networks[END_REF][START_REF] Montesinos-Navarro | Network structure embracing mutualism-antagonism continuums increases community robustness[END_REF]. Developing an inference tool associated to this model would also be an important step to quantify, for example, the actual effect of trait matching or trait differences on selection pressures and trait coevolution from empirical data [START_REF] Manceau | A unifying comparative phylogenetic framework including traits coevolving across interacting lineages[END_REF] . Such efforts are required if we want to better understand the macroevolutionary consequences of species interactions [START_REF] Weber | Evolution in a community context: on integrating ecological interactions and macroevolution[END_REF][START_REF] Harmon | Detecting the macroevolutionary signal of species interactions[END_REF]. Results were similar for the other two trait dimensions (results not shown). C : Species richness in each guild for a species definition threshold s = 1. Diversity is higher in antagonistic scenarios than in mutualistic ones but always stays bellow that obtained for neutral scenarios. D : Species number in each guild for a species definition threshold s = 50. Diversity is higher in antagonistic scenarios than in mutualistic ones, and a few antagonistic scenarios display a diversity that is higher than in neutral simulations. q qq q q q q q q q qq q qq q q q q q q qq q q q q q q q qq q qq q q q q q 0.0

  Figure1shows two typical simulations, one mutualistic and the other antagonistic, that illustrate general results concerning the evolution of trait values and species interaction networks. Other figures in the main text show emergent properties of mutualistic, antagonistic and neutral networks when the niche width of species from guild A (i.e. resources in antagonistic networks and facultative mutualists in mutualistic networks) varies and that of guild B (i.e. consumers in antagonistic networks and obligate mutualists in mutualistic networks) is fixed, and for three-dimensional traits.Figures in the SupplementaryMaterial report results for other parameter sets, including results when the niche width of species from guild B varies and that of guild A is fixed, and for trait dimension d = 1 and d = 10. Results for these trait dimensions were qualitatively similar (Fig S28-S34).

Figure 2 :

 2 Figure2: Effect of interaction type on the emergence of trait and species diversity. A : Logarithm of the variance of the first dimension of the species trait as a function of niche width for guild A (green boxplots) and B (white boxplots). The blue area shows values obtained for neutral simulations (range of values, quartiles and median). Antagonistic interactions commonly lead to higher, and mutualistic scenarios lower, trait diversity than in neutral simulations. Results for the other two trait dimensions are similar (results not shown). B : Correlation of the first dimension of the traits of the interacting individuals. Traits are consistently positively correlated in antagonistic scenarios, and correlation values stay pretty low in mutualistic ones. Results were similar for the other two trait dimensions (results not shown). C : Species richness in each guild for a species definition threshold s = 1. Diversity is higher in antagonistic scenarios than in mutualistic ones but always stays bellow that obtained for neutral scenarios. D : Species number in each guild for a species definition threshold s = 50. Diversity is higher in antagonistic scenarios than in mutualistic ones, and a few antagonistic scenarios display a diversity that is higher than in neutral simulations.

Figure 3 :

 3 Figure 3: Effect of interaction type on nestedness and modularity A : Each point shows quantitative modularity and nestedness values for a single simulated network. The networks that have high nestedness values are mostly mutualistic ones (in green), while those with high modularity values are mostly antagonistic ones (in red). Blue points show the results for neutral simulations. B : Z-values for the binary NODF metric corrected by null model NM1 as a function of niche width. The blue area shows values obtained for neutral simulations (range of values, quartiles and median). All networks show up as significantly nested. C : Z-values for the quantitative NODF corrected by null model NM2. Mutualistic and neutral networks have similar levels of nestedness and are neither significantly nested nor anti-nested. A large proportion of antagonistic networks are significantly anti-nested. D : Z-values for the quantitative modularity metric corrected by null model NM2. Mutualistic and neutral networks have similar levels of modularity and are not significantly modular. Most of the antagonistic networks are significantly modular. Results are shown for a species definition threshold s = 1.

Acknowledgements

The authors are very grateful to Isabelle Dajoz, Michael Blum, Elisa Thébault, Leandro Arístide, Carmelo Fruciano, Sophia Lambert, Benoît Perez, Ignacio Quintero, Ana Catarina Silva and Guilhem Sommeria-Klein for their helpful comments on an earlier version of this manuscript. This work was supported by an AMX grant (from Ecole Polytechique) and the Labex MemoLife to OM, ANR ARSENIC (grant no. 14-CE02-012) to NL and the European Research Council (ERC CoG-PANDA) to HM.

sharing not applicable to this article as no new data were generated during the current study.

-100 0 100 200 -150 -50 0 50 100 q q q q q Index 1e+05 -100 0 100 200 -150 -50 0 50 100 q q q Index 1e+05 -100 0 100 200 -150 -50 0 50 100 q q q q q q q Index 1e+05 Index -50 0 50 100 q q q q q q q q 1e+05 -100 0 100 200 -150 -50 0 50 100 q q q q q q q q q q 1e+05 Index time Index Index 1000 In each panel the upper row shows the evolution of trait values (in a three-dimensional trait space, point color representing the third trait dimension). The lower row shows the evolution of interaction networks and associated phylogenies. Darker links in the network correspond to interactions of higher strength; branches in the phylogenies are colored according to the value of the trait's third dimension so that it matches the colors of the corresponding dots in the upper row. Round dots correspond to species from guild A, square ones to species from guild B. q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q -0.