**Give them some space: how spatial structure affects the evolutionary transition towards mutualistic symbiosis**

**François Massol**based on reviews by Eva Kisdi and 3 anonymous reviewers### Mutualists construct the ecological conditions that trigger the transition from parasitism

**Codes used in this study**

**Abstract**

*Submission: posted 20 August 2021*

*Recommendation: posted 02 July 2022, validated 11 July 2022*

#### Recommendation

The evolution of mutualistic symbiosis is a puzzle that has fascinated evolutionary ecologist for quite a while. Data on transitions between symbiotic bacterial ways of life has evidenced shifts from mutualism towards parasitism and vice versa (Sachs et al., 2011), so there does not seem to be a strong determinism on those transitions. From the host’s perspective, mutualistic symbiosis implies at the very least some form of immune tolerance, which can be costly (e.g. Sorci, 2013). Empirical approaches thus raise very important questions: How can symbiosis turn from parasitism into mutualism when it seemingly needs such a strong alignment of selective pressures on both the host and the symbiont? And yet why is mutualistic symbiosis so widespread and so important to the evolution of macro-organisms (Margulis, 1998)?

While much of the theoretical literature on the evolution of symbiosis and mutualism has focused on either the stability of such relationships when non-mutualists can invade the host-symbiont system (e.g. Ferrière et al., 2007) or the effect of the mode of symbiont transmission on the evolutionary dynamics of mutualism (e.g. Genkai-Kato and Yamamura, 1999), the question remains whether and under which conditions parasitic symbiosis can turn into mutualism in the first place. Earlier results suggested that spatial demographic heterogeneity between host populations could be the leading determinant of evolution towards mutualism or parasitism (Hochberg et al., 2000). Here, Ledru et al. (2022) investigate this question in an innovative way by simulating host-symbiont evolutionary dynamics in a spatially explicit context. Their hypothesis is intuitive but its plausibility is difficult to gauge without a model: Does the evolution towards mutualism depend on the ability of the host and symbiont to evolve towards close-range dispersal in order to maintain clusters of efficient host-symbiont associations, thus outcompeting non-mutualists?

I strongly recommend reading this paper as the results obtained by the authors are very clear: competition strength and the cost of dispersal both affect the likelihood of the transition from parasitism to mutualism, and once mutualism has set in, symbiont trait values clearly segregate between highly dispersive parasites and philopatric mutualists. The demonstration of the plausibility of their hypothesis is accomplished with brio and thoroughness as the authors also examine the conditions under which the transition can be reversed, the impact of the spatial range of competition and the effect of mortality. Since high dispersal cost and strong, long-range competition appear to be the main factors driving the evolutionary transition towards mutualistic symbiosis, now is the time for empiricists to start investigating this question with spatial structure in mind.

**References**

Ferrière, R., Gauduchon, M. and Bronstein, J. L. (2007) Evolution and persistence of obligate mutualists and exploiters: competition for partners and evolutionary immunization. *Ecology Letters*, **10**, 115-126. https://doi.org/10.1111/j.1461-0248.2006.01008.x

Genkai-Kato, M. and Yamamura, N. (1999) Evolution of mutualistic symbiosis without vertical transmission. *Theoretical Population Biology*, **55**, 309-323. https://doi.org/10.1006/tpbi.1998.1407

Hochberg, M. E., Gomulkiewicz, R., Holt, R. D. and Thompson, J. N. (2000) Weak sinks could cradle mutualistic symbioses - strong sources should harbour parasitic symbioses.* Journal of Evolutionary Biology*, **13**, 213-222. https://doi.org/10.1046/j.1420-9101.2000.00157.x

Ledru L, Garnier J, Rohr M, Noûs C and Ibanez S (2022) Mutualists construct the ecological conditions that trigger the transition from parasitism. bioRxiv, 2021.08.18.456759, ver. 5 peer-reviewed and recommended by Peer Community in Evolutionary Biology. https://doi.org/10.1101/2021.08.18.456759

Margulis, L. (1998) Symbiotic planet: a new look at evolution, Basic Books, Amherst.

Sachs, J. L., Skophammer, R. G. and Regus, J. U. (2011) Evolutionary transitions in bacterial symbiosis. *Proceedings of the National Academy of Sciences*, **108**, 10800-10807. https://doi.org/10.1073/pnas.1100304108

Sorci, G. (2013) Immunity, resistance and tolerance in bird–parasite interactions. *Parasite Immunology*, **35**, 350-361. https://doi.org/10.1111/pim.12047

**Cite this recommendation as:**

François Massol (2022) Give them some space: how spatial structure affects the evolutionary transition towards mutualistic symbiosis.

*Peer Community in Evolutionary Biology, 100143.*

**https://doi.org/10.24072/pci.evolbiol.100143**

**Conflict of interest:**

The recommender in charge of the evaluation of the article and the reviewers declared that they have no conflict of interest (as defined in the code of conduct of PCI) with the authors or with the content of the article.

*Evaluation round ***#3**

**#3**

DOI or URL of the preprint: **https://doi.org/10.1101/2021.08.18.456759**

#### Author's Reply, 07 Jun 2022

We would like to thank the reviewer for this third round of review which enabled us to improve the overall quality of our manuscript. We mainly modified the models in Appendix A2 and we removed some irrelevant sections. Our detailed answers are on our reply files below.

#### Decision by **François Massol**, *posted 24 May 2022*

Dear authors,

from Eva Kisdi's review, you will see that some clarifications are still needed regarding the mathematical developments presented in appendices. These corrections are needed for the sake of mathematical accuracy.

I am looking forward to reading your response and the revised version of the paper.

Sincerely,

François Massol

#### Reviewed by **Eva Kisdi**, 14 May 2022

At this time, I checked only the points I raised in the previous round.

My main concern is still Appendix A2. The authors have corrected equation (17) with the appropriate Poisson probability. However, this equation is still unclear to me at two points:

(i) It seems that mortality is the first to happen in the life cycle. If so, then a factor (1-m) should multiply rho_hs in the bracketed expression (second line) of equation 17, because the host enjoys fecundity f^h(alpha_h,alpha_s) ony if its symbiont is present. The remaining fraction m of rho_hs are hosts who have lost their symbionts and therefore should reproduce with fecundity f^ha.

(ii) The term m(1-m)rho_hs is the fraction of sites where the symbiont is lost. Because mortality occurs first, these hosts can be re-infected with the symbiont still before the next census; this is missing from both equations in (17). I am sorry for not having spotted this earlier.

The equation tacitly assumes that if both a host and a symbiont arrive in an empty cell, only the host survives. - It would be good to offer some help for the reader to interpret the terms of equation 17.

Equation (19) [formerly (20)] has also been revised, but unfortunately is not correct: When both types of symbionts arrive at a host, the probability that type m establishes is not the fraction of fecundity-weighted symbiont densities as it appears in equation 19 (or in equation 5 in the author's response). Instead, one has to calculate the probability that k of type m and j of type p arrives (product of two Poisson factors) and in this case, the probability of m establishing is k/(k+j); then add up for all k and j. In other words, one needs to take the average of k/(k+j) and not the quantity (average k)/(average k + average j) as now. The two are not the same (Jensen's inequality).

It still seems to me that omitting the mathematical analysis would be the best option. Of course I like analytical results. However, the analysis needs to assume global dispersal of all hosts and symbionts (even a pair approximation of the lattice model would be a taxing task). Since the main hypothesis is that local dispersal and clustering is at the heart of transition to mutualism, a model which cannot capture clustering is of limited interest.

Other comments (numbering as in my previous review)

1. About R0 of the host: (1-m)(1+f^a) is the annual growth rate of the host, not R0. R0 is the lifetime number of offspring without competition, which is (1-m)f^a/m. To calculate R0, we start with a newborn at census. The first event is mortality, the newborn survives to first reproduction with probability 1-m. After this, it will reproduce on average 1+(1-m)+(1-m)^2+...=1/m times, each time producing f^a newborns. R0 >1 if and only if the annual growth rate>1, but the two are not the same.

2. On gamma_f being the selection strength on the trait alpha_s: the revision clarifies what the authors mean but "selection strength" is still inaccurate because gamma_f relates to how the _host fecundity increases with the _symbiont trait alpha_s. The symbiont is not directly selected by the advantage of the host (although indirectly yes, but the indirect effect is not so simple as gamma_f).

The following comments in my previous review (with line numbers referring to v2) went unnoticed: "In line 231, it is unclear why density is high when competition is strong. This is important to understand because the ms discusses the effect of competition strength but it is more likely the effect of density. In line 262, the % mutualistic symbionts decreases and not increases with gamma_c. At this point, I was lost."

Minor remarks

Speciation theory shows that recombination can prevent rather than only delay a transition like this. I do not understand why the authors are confident that recombination would only delay and not prevent the transition. (The last sentence of my previous review calling for the improvement of language was a general remark pertaining the whole paper, not only this sentence. Maybe the online system omitted a line break!)

*Evaluation round ***#2**

**#2**

DOI or URL of the preprint: **https://www.biorxiv.org/content/10.1101/2021.08.18.456759**

#### Author's Reply, 19 Apr 2022

We would like to thank the reviewers for this second round of review, including the minor comments (typos, unclear sentences) which enabled us to improve the overall quality. Naturally, we also took into account the important issues regarding (1) Appendix A2 and (2) the use of the beta distribution. Below, you will find the reviewers' comments in black, and our responses in blue. The line numbers in our responses refer to the revised manuscript.

#### Decision by **François Massol**, *posted 31 Mar 2022*

Dear authors,

given my reading of your ms and the four reviews, I ask you for a revision of the manuscript.

As you will see, one review (by Eva Kisdi) is pointing at important issues to be solved in Appendix A2. Three of the four reviews also list some points that need clarifications.

Personally, I had the same reading as E. Kisdi regarding Appendix A2 -- it seems that the "probability of getting a symbiont" have been lost and replaced by fecundities instead. I don't think doing the calculation with the right quantities is going to be much more difficult, so I encourage you to reiterate the exercise of obtaining some mathematical insights in this Appendix.

Regarding the mutation distribution, I am afraid I was misunderstood (and thus I deeply apologize for being too obscure in my description of the beta distribution). What I was thinking of as a perfect distribution for mutation was not to add a beta-distributed noise, but rather to draw the value of the new trait from a beta distribution centered on the value of the parent trait. In this way, there cannot be any problem of overshooting 0 or 1 (beta distributions are constrained between 0 and 1). The technical point is just to use the parameteriation of the beta that uses mean and precision, rather than the usual (a,b) parameters that is the natural parameterization of the distribution, such that mean = a/(a+b). With such a distribution of mutations, the mean of mutant traits is always the value of the parent's trait. The variance will vary depending on the localization of the parent trait value, but it will be less brutal than the doubly truncated exponential.

Aside from these issues, I was very pleased to see the arrival of the new appendices which are very useful to gauge the generality of your study.

I hope you will find all reviews useful for revising your paper. I am very eager to see the next version and I'm quite hopeful it will lead to swift recommendation.

Sincerely,

François Massol

#### Reviewed by anonymous reviewer, 22 Feb 2022

The authors have used previous comments by all referees to nicely rework their manuscript. All my comments have been addressed and I am sure the community will find the manuscript interesting.

#### Reviewed by anonymous reviewer, 09 Mar 2022

#### Reviewed by **Eva Kisdi**, 15 Mar 2022

The new mathematical analysis in Appendix A2 is based on incorrect equations of the population dynamics. In equation (17), the authors assume that a fraction f^s(alpha_h,alpha_s)*rho_hs of the surviving hosts will acquire the symbiont. This quantity is however not a fraction (and therefore 1 minus this quantity can well be negative, possibly rendering the density of symbiont-free hosts negative). The simulation model assumes that the symbiont propagules disperse at random and therefore the number of propagules arriving into one cell is Poisson distributed; if more than one propagule arrives, then one survives with the host and the rest die. These assumptions are not reflected in equation 17. Instead of the quantity f^s(alpha_h,alpha_s)*rho_hs, there should be the Poisson probability of having at least one propagule, which is 1-exp(-f^s(alpha_h,alpha_s)*rho_hs). In addition, a factor 1-m should multiply rho_hs because only the surviving symbionts reproduce (it appears that census is before mortality). Further, host competition for space is missing in equation (17) (the factor with gamma_C is resource competition). In equation (20), I don't understand why the unweighted sum of parasite densities appears in the denominator. – While I agree that a mathematical analysis would valuably complement the lattice simulations, at this point it seems to me that it is better to abandon this and focus on the simulations alone to publish this paper in a reasonable time.

Other comments

1. The formula given in line 198 is not with the parasitic symbiont but for the host without any symbiont. More importantly, this is the inverse of R0 and not the probability of extinction. For (infinitely) large populations, the probability of extinction is 0 when R0>1 and 1 when R0<1, with no values inbetween. For initially small populations, the formula is more complicated.

2. It is unclear why the strength of selection would be given by gamma_f (line 166) or why competition would be "strong" or "weak" depending on gamma_C smaller or greater than 1 (line 194). In line 231, it is unclear why density is high when competition is strong. This is important to understand because the ms discusses the effect of competition strength but it is more likely the effect of density. In line 262, the % mutualistic symbionts decreases and not increases with gamma_c. At this point, I was lost.

3. The authors declare that "the higher fecundity of mutualists is not advantageous enough to compensate for the ability of parasites to invade mutualistic clusters". How do we know that this is true in general, not only for the parameters used in the simulations?

Minor remarks

line 200, " In this case," -> with the parameters in Table 1 / with the parameters used (otherwise it reads as if for ALL parameters satisfying the viability condition you would get the same densities)

In line 416, it is unclear what kin selection refers to

line 419, competition between groups is local -> between individuals is local?

line 463, speciation theory shows that recombination can prevent rather than only delay a transition like this

The language could be improved.

#### Reviewed by anonymous reviewer, 04 Mar 2022

Since the first time I reviewed this manuscript, the authors have clearly put in a lot of effort to either address or clarify my previous comments, as well as included additional changes to further explore and address other implications/potentially important aspects of the model (e.g. the discussion on intra-host dynamics and multiple infections). As a consequence, I have no more remaining comments, except for a small number of minor comments related to phrasing, typos or some other small details (see the listed comments below). I would therefore also happily recommend this manuscript as an interesting contribution to the field. Kind regards,

Reviewer 4 (following the numbering in the authors reply document).

Line 31: eucaryotic cell should be eukaryotic cell

Line 32: eucaryote should be eukaryote

Line 156-158 and figure A1: In the text, it is written that individuals reproduce, potentially undergo mutation, and then disperse. In contrast, in the figure it is depicted that individuals reproduce, disperse, and only then undergo mutation. Whereas the order is unlikely to have a strong effect, it could affect the dispersal behaviour somewhat depending on whether mutation occurs before or after dispersal. To clarify this point, the representation in the text/figure should probably correspond, to make sure there is no confusion on the part of the reader, on the exact used approach.

Caption of figure 5, figure A6, figure A7: confident intervals should be confidence intervals

Caption of figure 5: You note here that the dashed red line is the 10 % transition threshold. This is indeed the case in panels A and B, but not so for panel C, where you use it to denote the transition/reversal. This should probably be clarified in the caption.

*Evaluation round ***#1**

**#1**

DOI or URL of the preprint: **https://doi.org/10.1101/2021.08.18.456759 **

#### Author's Reply, 07 Feb 2022

We would like to thank the reviewers for a thorough and thoughtful review to the manuscript titled 'Mutualists construct the ecological conditions that trigger the transition from parasitism'. We have worked on addressing the reviewers' comments and believe that the paper has significantly improved as a result. Since some comments are redundant, we refer to other comment's responses in our answers.

Below, you will find the reviewers' comments in black, and our responses in blue. The line numbers in our responses refer to the revised manuscript. We did not track the changes in the revised version of our manuscript to faciliate the reading.

#### Decision by **François Massol**, *posted 30 Sep 2021*

Dear authors,

four referees have reviewed your ms. Based on their remarks and my own reading, I would like you to revise your paper before I can recommend it.

Overall, I was very pleased to read your manuscript as it is very rich in terms of both biology and theoretical results. The way you present the goals of the study as well as the background / state-of-the-art is helpful to understand where you are going. Thank you for the excitement!

SCIENCE

One of my main concerns comes from the fact that you plunge right into the simulation model without trying to give some rough predictions based on some analytical approximation of the model. Considering global dispersal, some computations can be done, e.g. finding the proportion of cells occupied by hosts at "equilibrium" (I found 1-sqrt((1/f)*(m/(1-m))) because the way you formulate P_I and the fact that a cell must be unoccupied to be colonized make the density-dependence squared). Such an equation is interesting because it yields the occupancy of the grid when parasites are absent (64%) or present (20%), which set the limits for what you expect when evolution comes into play. You can also compute population growth rate using Euler-Lotka equation -- this would help you justify why the host population is viable in the absence of mutualistic symbionts, etc. I do appreciate the importance of a simulation model in the present case, but it is very difficult to be surprised or not surprised at the results if one has absolutely no clue as to what would be predicted by a simpler, approximated analytical model.

As remarked by at least one or two referees, the mutation model looks strange. As all the traits you want to have evolve are between 0 and 1, why don't you use beta distribution (or logit Gaussian) for mutation? The issue with truncated exponential is that the closer you get to the trait boundaries, the less likely mutation swill be accepted. So you would get an acceleration of mutations at mid values, and this could be problematic. The beta distribution looks like the cleanest contender for a mutation distribution in [0,1] and you can always specify it so that it looks hump-shaped rather than u-shaped.

The reproduction process also looked strange to me since you basically use the integer part of f as a given (i.e. you fix the number of offspring) and then us e the decimal part as a stochastic bonus. Why didn't you use a more classic approach such as drawing from Poisson distributions? Effectively, the variance in offspring number is very low in your simulations, which counteracts the possibility of extinction of the whole population. This might be worth discussing as extinction might sometimes happen before the transition to mutualism.

The introduction probably lacks a little bit of definitions/context:

* as noted by one of the referees, I guess you should use "joint evolution" instead of "coevolution" when you refer to the evolution of different traits in the same species

* the definition of symbiosis you use is not completely consensual -- some people still understand symbiosis as mutualistic symbiosis. For this reason, I encourage you to write your definition early in the introduction.

* since you use a parallel with altruism, I guess you also need to explicit what is altruism and how you distinguish mutualism from altruism

As you tackle the evolution of symbiotic entities, some background on symbiosis as an evolutionary force would help, e.g. Margulis & Sagan (2002). The notions of interactors and replicators of Hull (1980) are also interesting in your context, as well as the more recent idea of the holobiont (e.g. Bordenstein & Theis 2015; Doolittle & Booth 2017). I saw you referred to Sachs et al. (2011), maybe you could give the transition counts they put in their Fig. 3 to illustrate the importance of mutualistic transitions?

Because your initial state is one of parasitism, I found it bizarre that there is no mention of Red Queen dynamics in your introduction or discussion. For instance, would you expect the same speed of transitions if both hosts and symbionts had alleles that should match for the parasite to infect the host (or reciprocally for the host to be defended against the parasite)? It would probably be better if you could discuss a little what you think would happen in your model if either parasites and hosts were differentially locally adapted (as in the matching allele paradigm) or if parasites and hosts sequentially gained adaptations to counter the effect of the other (as in the gene-for-gene paradigm). In Sasaki et al. (2002), the effect of migration in a spatially explicit Red Queen dynamics model is studied and the authors conclude that migration is a "cheap alternative" to sex in Red Queen dynamics -- since your model includes dispersal but not sex, you might want to use this study as a benchmark for discussion.

Since you introduce and compare some of your results with those known in the evolution of altruism, I guess you could make the distinction between results due to kin vs. group selection. Group selection has had a bad press for some time, but modern models are able to incorporate both group and kin selections (e.g. Simon et al. 2013). In your model, the existence of clusters of mutualists is due to philopatry and increased fecundity, which leads to increased competition. However, if dispersal becomes local also for symbionts, these might suffer from a lack of percolation of cells in the grid (if host-occupied cells are not adjacent, a philopatric symbiont might not be able to "jump" over gaps in the host population). For a model dealing with the ecological considerations associated with local vs. global dispersal, see Huth et al. (2015)

At the end of the introduction, I was left with a big question: in your model, we don't know what exactly is understood by mutualistic effort. Since mutualism can take many forms, it would be useful if you could specify whether you think your model fits exchanges of resources more than shared immunity or anti-predator behaviours or other types of mutualisms involving symbionts.

Regarding the simulations, as noted by all referees, it would be nice to have the code somewhere accessible. Also, if you could give more details regarding simulations (duration, number of replicates per run, all tested parameter values, size of the grid, torus or absorbing boundaries or reflecting boundaries?), this would be invaluable.

In terms of statistics to present your simulation outputs, you use an assortment index which I did not understand -- can you write down its formula please? Also, why don't you give simpler things like Moran index of hosts and symbionts, join count statistics, spatial autocorrelation statistics, etc.? Computing the population growth rate (using Euler-Lotka or something similar) and plotting that in relation to e.g. competition strength might also help.

FORMAT

As some of the referees remarked, you can still improve the clarity of the text. Some sentences (especially at the end of the introduction and in the discussion) should be rewritten. Regarding presentation and formatting, my biggest remark would be to check thoroughly the names of authors in the references and when cited in the text: it looks like your bibliography is not very fond of authors with two surnames without hyphens, like the poor John MAYNARD SMITH who appears sometimes as Smith, sometimes as Maynard... Some other authors might have received the same treatment (I only saw Minus VAN BAALEN who lost his VAN, but others might have been injured too), so please pay attention and revise your .bib accordingly.

Another presentation/clarity item stems from the mathematical notations: some symbols (like c) are used to note very different quantities. My suggestion is to use other letters -- use a different letter for each different quantities. Also, as remarked by referees, please try to stay consistent in the way you write parameters (superscript vs. subscript, etc.).

It is quite frustrating not to have a more thorough explanation of the model in the main text -- can you please move some of the content from appendix A to the model & methods? Also, if you could add all parameters in the associated table, so that readers can refer to the table and find the interpretation of each parameter easily, that would be really nice.

A final remark: please pay attention to give all parameter values under plots if their values are not given by default in the summary table. For instance c_s is never given.

Literature cited

Bordenstein, S. R. & Theis, K. R. (2015) Host biology in light of the microbiome: Ten principles of holobionts and hologenomes. PLoS Biology, 13, e1002226.

Doolittle, W. F. & Booth, A. (2017) It’s the song, not the singer: an exploration of holobiosis and evolutionary theory. Biology & Philosophy, 32, 5-24.

Huth, G., Haegeman, B., Pitard, E. & Munoz, F. (2015) Long-distance rescue and slow extinction dynamics govern multiscale metapopulations. American Naturalist, 186, 460-469.

Margulis, L. & Sagan, D. (2002) Acquiring Genomes: A Theory Of The Origin Of Species, Basic Books, New York.

Sasaki, A., Hamilton, W. D. & Ubeda, F. (2002) Clone mixtures and a pacemaker: new facets of Red-Queen theory and ecology. Proceedings of the Royal Society of London. Series B: Biological Sciences, 269, 761-772.

Simon, B., Fletcher, J. A. & Doebeli, M. (2013) Towards a general theory of group selection. Evolution, 67, 1561-1572.

#### Reviewed by anonymous reviewer, 21 Sep 2021

The preprint by Ledru et al. “Mutualists construct the ecological conditions that trigger the transition from parasitism” investigates the transition from parasitism to mutualism that can be predicted to happen in the long term when parasites are closely associated (e.g. via vertical transmission) with their host. The interesting point explored in the preprint is that the spatial context may matter: dispersal evolution towards short-distance dispersal may kickstart the transition from parasitism to mutualism even when transmission is not strictly vertical.

The manuscript reads very nicely and I read it with great interest. Please find some general as well as some more details comments below.

Introduction: I would suggest to discuss a little more in detail the mechanisms of repeated interactions vs. relatedness. This would allow to link to classical prisoners’ dilemma work.

For readers who are not familiar with individual-based models it may be useful to more explicitly discuss kin interactions in the model and why the model includes this (e.g., Poethke et al. 2007 Ecol. Evol. Res.).

In addition, some more literature and discussion on horizontal vs. vertical transmission could be beneficial, such as Schinazi (2000) Math. Biosci., Saikkonen et al. 2002 PRSB, Su et al. (2018) Physica A, just as a few examples.

Finally, I would like to encourage the authors to publish the code of their simulations for the sake of reproducibility. Github and Zenodo, for example, allow to generate DOIs very easily.

Detailed comments:

Wording: I am wondering whether “coevolution” of mutualism and dispersal (throughout the manuscript) is the right term. I would have suggested “concurrent” evolution.

Mutation procedure - exponential distribution. A lot of individual-based models follow a “classical” assumption of normal distributions for mutations. Could the authors justify their choice of the exponential a little more and maybe even test whether this assumption impacts their results?

Sensitivity analysis / Tab A1: some of the parameters have been tested systematically (e.g., mortality) but other do not seem to have been tested. Please update the table with all tested values and perform a sensitivity analysis on the parameters that have not been varied, where appropriate.

Transition threshold of 10%. The choice looks OK from Fig. 2 but slightly more justification in the text would help the reader understand the consequences of this choice. A sensitivity analysis may also be appropriate.

Fig 3b: The correlation is fine, but stats with p-values don’t make a lot of sense on simulated data. Please delete the p-values.

#### Reviewed by **Eva Kisdi**, 30 Aug 2021

I found this paper interesting, especially the role of competition in the evolution of mutualism and the fact that it happens best on the edge of viability (Figure 6). This was unexpected to me and so the paper changed the way I think about the evolution of mutualism in spatial systems. I am happy to recommend accepting this paper after revisions.

What I expected to see is the following scenario: First dispersal evolves to be local due to the cost of global dispersal; and once this has happened, the resulting kinship structure selects for mutualism. After reading the paper, I still think that this is an important route to mutualism and this explains why mutualism evolves in 100% of simulations and within a short time when dispersal is costly (Figure 2a). The paper shows that mutualistic symbionts indeed have local dispersal, but Figure 3 is only a snapshot; it would be interesting to know whether it is dispersal that first evolves to be local and mutualism evolves later. In this case, there is no need for multiple random events to happen at the same time (explaining why the transition is fast). From my first reading of the paper, I got the impression that the authors consider the effect of dispersal cost to be analogous to the effect of mortality (both reduce density). In contrast to this, I think that the cost directly selecting for local dispersal is instrumental in the evolution of mutualistic clusters.

A main effect of competition is to reduce global density and hence the threat from invading parasites. The same effect should follow from increased mortality. Indeed, Figure 6 shows that increased mortality helps the evolution of mutualism, but the analogous effect to competition is not discussed. I think that strong competition is largely analogous to high mortality, with one difference: strong competition increases mortality (from failure of establishment) when mutualism evolves but not before, i.e., it allows for higher densities and therefore more mutations and simultaneous rare events at the beginning, perhaps shortening the time till mutualism appears.

The paper is reasonably well written, but at several places, I had to consult the appendix to make out what the main text means. Since there is no limit on the length of the main text, I propose moving all essential details of the model to the main text. Readers not interested in formulas can easily skip over if these specifications follow the current verbal description e.g. with the words "Specifically, we assume..." [and here the part moved from the Appendix follows].

Detailed comments:

- It may be useful to include the results of a baseline simulation with no competition at all but otherwise favourable conditions for the evolution of mutualism (relatively high mortality to be near the edge of viability, with and without dispersal cost).

- It was not clear to me whether the same cost of dispersal applies to both host and symbiont. In reality, it could be that global dispersal is costly for one but not the other. The same applies to mortality (m); why is it the same?

- Harada 1999 (J. theor. Biol. 201: 171-187) investigated the evolution of dispersal under a cost to global dispersal, the same as the present model assumes; this would be a relevant citation.

- what is seen in Figure 2 is not evolutionary branching; judging from the colours, the mutualistic branch starts out with a trait value rather different from that of the parasite. Perhaps a large mutation is needed to initiate the evolution of mutualism. "Evolutionary branching" is reserved for gradual divergence through only small steps.

- "Strong mutualistic hosts will benefit more from parasitic symbionts than weak mutualistic hosts. Indeed, a parasitic symbiont will benefit from a strong mutualistic host by increasing its number of offspring, which eventually reduces the host density and thus host competition." – this cannot select for host mutualism. The advantage of reduced host density is enjoyed by all hosts equally (non-mutualistic included) whereas the burden is on the mutualistic hosts. Therefore the latter is selected against.

- Figure 6 shows evolution of mutualism outside the region where the ancestral parasitic system is viable: Is this a case of evolutionary rescue? How fast does it happen? In what percentage of simulations is rescue successful (i.e., the simulation does not die out)?

- "However, this only occurs when competition between hosts is partly global (Figure 5b); if it is purely local, mutualistic clusters cannot influence the viability of parasitic regions. Although areas dominated by parasitic host/symbiont pairs become unsuitable..." – I do not understand why these areas would become unsuitable; it seems to contradict the first sentence cited here.

- "For this reason, the dispersal cost was introduced to speed up the transition (Figure 2a) without affecting the overall behaviour of the model. Dispersal cost induces a selection pressure at the individual level in favour of local dispersal, which increases the likelihood of the formation of mutualistic clusters." – I think the effect described in the second sentence is significant (see also above) and therefore the first sentence is incorrect in saying that the cost of dispersal has no important effect.

- "Mortality pushes the parasitic system towards its viability boundary and promotes the eco-evolutionary feedback loop involving host competition." – I think mortality does not promote the feedback through competition (and what does "promote" here mean?). As I argue before, mortality simply decreases density (akin to competition) and therefore decreases the threat of parasites invading mutualistic clusters.

- By taking the product in equation 4 in the Appendix, the authors assume that individuals who get more help from their partner (high f_I) pay more for their own mutualism in absolute terms. It is unclear why this would be the case. The additive formula f_h = f_I,h – c alpha_h seems more appropriate. I suppose it would be too much work to run the simulations with additive cost, but this assumption should be discussed.

Minor remarks:

- The address of Nous is incomplete.

- On the first reading, it was not clear to me that equation 1 gives global competition (rho_h could have been the proportion of neighbouring cells that are occupied; in a lattice model, a natural default assumption is that interactions are local).

- "we assume that transition occurs when the percentage of mutualistic symbionts rises above the threshold of 10%" – a percentage relative to what?

- In Figure 2, it would be good to include a panel to show the probability of transition as a histogram (rather than just numbers in panel (a)). For more visual readers, what sticks from this figure is the small difference between the transition times when comparing weak and strong competition; the huge difference in transition success is overlooked.

- "Finally, we showed that mutualism persists only because of strong competition" – this is not so, Figure 2 does show counterexamples.

- strong competition is sometimes referred to as "high" competition; this should be changed to "strong". (Even "strong" is somewhat a misnomer because it refers to the shape of the competition function rather than the magnitude.)

- the sentences pertaining to perturbation on page 8 are cryptic without consulting the Appendix

- at the end of the legend of Fig 6, the text should probably refer to Fig 2, not Fig 3.

- equation 2 in the Appendix is unnecessarily complicated: why do we divide with f_i,min if we also multiply with it? It was also not clear to me why the minima differ but the same maximum applies to host and symbiont.

- In the section Assortment index in the Appendix, "difference" and "similarity" appear to be mixed up. It was not clear to me how the randomization is done: randomize symbionts over all hosts or over symbiont-bearing hosts?

#### Reviewed by anonymous reviewer, 16 Sep 2021

The authors discuss in this manuscript an individual based model, investigating in a spatially explicit model how a symbiotic relationship between two species may have shifted from parasitism to mutualism. The presented questions are engaging, and well outlined in the introduction. The results are well structured and discussed (and I especially appreciate the clear and visually appealing figures). Below, I outline a number of comments, related to the presentation of the data and some of the model assumptions. However, I want to stress that overall, the manuscript was very well written, and I enjoyed reading it.

Main comments:

1. Introduction: At the top of page 3, you have a very nice outline of the research questions, and you refer back to these original questions during the discussion. I very much appreciate this clear outline, however I feel it would be even better to include along the questions your a priori hypotheses/expectations on what you expected related to these questions

2. Model description: In many systems, dispersal of the parasite will be linked to the dispersal ability of the host. This simply because hosts tend to be larger and more capable of dispersal (e.g. birds displacing parasitic flatworms, ticks carried on large vertebrates). Whereas it is of course fine to make the assumption here that dispersal is independent for both interacting species, I feel it would nonetheless be important to discuss the reasoning behind this choice, perhaps link to an example in the natural world, and include in the discussion speculation on how this assumption may affect the outcome of the model. Especially because in such a case where dispersal of host and symbiont are dependent, even global dispersal may maintain more stronger clusters, as mutualist host and symbionts are likely to end up close to each other, even when they disperse further, maintaining spatial structure.

3. Model description: Related to the cost/benefit of being associated with a host/symbiont with a changing interaction trait (i.e. the relation shown in Figure 1). Both species seem to gain quite strong rewards for being associated when the interaction trait of the interacting species increases, yet you still find that typically only a small proportion of symbionts (up to about 20 %; Figure 2C) becomes mutualistic. This made me wonder what would happen if you would alter the benefit function, would you still see a mutualistic strategy arising at all if the benefits are less strong? If such data exists on the simulation using a different benefit function, it may be useful to include in the appendix. If not, it may still be informative to discuss the expectations for changed benefits and how they may potentially change the outcome of the model, in more detail in the discussion.

Other comments:

1. Abstract: “Spatial structure might be the key to this transition”. This idea of spatial structure driving the transition is the core concept of the manuscript. It would be helpful to include in one sentence in the abstract the main argument why spatial structure may be so important.

2. Introduction: “For instance, aphids and their intracellular bacterial symbiont Buchnera aphidicola are irreversibly mutually dependent since the symbiont provides essential amino acids to its host [Akman Gündüz and Douglas, 2009, Bennett and Moran, 2015]”. This sentence only states why the host is dependent on the symbiont, not the other way around. Since one talks about irreversible mutual dependence, it would be important to state also the other direction of the dependence.

3. Results: “Without dispersal cost, the transition is more likely to occur under strong competition than weak competition (see the probability of transition in Figure 2a)).” I’d personally suggest including these probabilities also in the main text. Otherwise, if the reader needs to scroll down to look up the probabilities in the figure, it disturbs the flow of reading.

4. Results: Figure 2 panels B and C. What is the unit of host and symbiont density? Is this the proportion of cells filled with each species in the grid, or (for the symbiont) the proportion of hosts carrying a symbiont? It would be informative for the reader to include either in the axis label or in the figure caption a more descriptive explanation of what exactly the axes represent in the model.

5. Appendix A.1: Related to the mathematical implementation of dispersal in the model. For local dispersal, when n individuals would disperse, did you draw n times from a uniform distribution, so that potentially all n individuals could end up dispersing to the same of the 8 surrounding patches, or is there a form of kin avoidance, where all n individuals would move to a different patch (I assume the former). For global dispersal, is the target of dispersal chosen from a uniform distribution that includes the parental patch and local patches (i.e., can global dispersal end up being local), or are these 9 patches included the potential target patches? Perhaps it could be useful to include some more details (or equations) on the dispersal behaviour in the appendix, in case people are trying to understand or even recreate the model conditions.

6. Related to this last comment, dispersal was implemented in the model using two very distinct mechanisms, global versus local dispersal, rather than for example working with a dispersal kernel. I can see why such a choice was made, both because it is also a realistic biological model (for example in plants, where heavy fruits may fall locally to the plant, but also be displaced far by a frugivorous species), and because it allows for a more clear distinction between the two strategies than when working with a dispersal kernel. Perhaps it may be useful to however provide some biological example in the supplement (similarly as for competition, where the difference between local and global competition is presented through a very nice example)?