DOI: 10.5061/dryad.zw3r2288m
title: Preferential allocation of benefits and resource competition among recipients allows coexistence of symbionts within hosts

description: Functionally variable symbionts commonly co-occur including within the
 roots of individual plants, in spite of arguments from simple models of
 the stability of mutualism that predict competitive exclusion
 among symbionts. We explore this paradox by evaluating the
 dynamics generated by symbiont competition for plant resources,
 and the plant’s preferential allocation to the most beneficial symbiont,
 using a system of differential equations representing the
 densities of mutualistic and non-mutualistic symbionts and the
 level of preferentially allocated and non-preferentially
 allocated resources for which the symbionts compete. We find that
 host preferential allocation and costs of mutualism generate resource
 specialization that makes the coexistence of beneficial and
 non-beneficial symbionts possible. Furthermore, coexistence becomes
 likely due to negative physiological feedbacks in host
 preferential allocation. We find that biologically
 realistic models of plant physiology and symbiont competition
 predict that the coexistence of beneficial and non-beneficial symbionts
 should be common in root symbioses, and that the density and
 relative abundance of mutualists should increase in proportion to
 the needs of the host.
description: The zipped folder is the repository of analyses:
 Preferential allocation of benefits and resource competition among
 recipients allows coexistence of symbionts within
 hosts This theoretical study is carried out
 by solving a four-variable ordinary differential model that represents two
 carbon resources and two consumers (i.e. mutualist and non-mutualist
 symbionts on plant's root). No empirical dataset is used. Codes are
 written using open-source software (i.e. R, FORTRAN). Analytical
 derivations are given in the related manuscript with details in the
 appendix.
description: Introduction All analyses can be reproduced
 using the given codes. Dependencies
 R, R studio latex, any tex
 compiler FORTRAN 77, ifort compiler
 Origin pro/ any other data drawing tool, e.g., Adobe illustrator
 (if necessary) How to compile
 The main manuscript is written using standard Microsoft word and
 Endnotes (for citations), Appendix can be compiled using any tex compiler
 (SG used Texmaker) from Appendix.tex. First, all numerical simulations
 from the model analysis were carried out using FORTRAN 77 and ifort
 compiler (source code ARMN.f) and results were stored as .dat files in
 ARMN_Results/ARMN_dat/ folders. For convenience, we already provided the
 .dat files, so one can skip this step. Alternatively, for someone who is
 not used to FORTRAN, an alternative R-script is provided as
 "ARMN.R". The file ARMN.R will execute the same task and can
 generate the same data files as we stored as .dat files. The only
 difference is in the computation time, FORTRAN is much faster for
 long-term simulation. Next, one needs to run the Master.R script to get
 all the plots to be saved as pdfs in ARMN_Results/ folder.
 Short summary for each file 
 <strong>ARMN.R</strong>: R script solving 4 variable ODE,
 arguments are explained in that script. 
 <strong>ARMN.f</strong>: equivalent FORTRAN code doing the
 same things as the R script <strong>ARMN.R</strong> does but
 in a much faster way. 
 <strong>ARMN.in</strong>: input file
 for <strong>ARMN.f</strong>. 
 <strong>ARMN_plotter.R</strong>: plotter function related to
 output from <strong>ARMN.f</strong> and generates Figs (1 - 4)
 for the manuscript. 
 <strong>eigenval_analysis.R</strong>: R script with the
 function to compute eigenvalues at equilibrium. If the maximum of the real
 part of eigenvalues is negative, that means the equilibrium is
 stable. <strong>get_fmax.R</strong>: R
 script that generates data plotted in Fig 5, i.e., regime of co-existence
 for different combinations of
 parameters <em>s</em>, <em>aM</em>, <em>aN</em>. It makes some additional plots for the range of fidelity vs. <em>s</em> given other parameters. <strong>get_MNAR_eqm_analytical.R</strong>: R script with the function to get equilibrium of the ODE model used in <strong>ARMN.f</strong> using the analytical expression which is derived in the manuscript. <strong>LookAtStability_cleaned.r</strong>: R script to check stability within the fidelity range (<em>f_min,f_max</em>) given all possible combinations of other parameters used in the model. <strong>Appendix.tex</strong>: supplementary latex file used for the manuscript. <strong>ARMN_alternative.R</strong>: a solver for 4 variable ODE with the different functional form of <em>F(M, N)</em> used in the appendix. <strong>Master.R</strong>: R script to generate all figures for the main manuscript, a master file. <strong>NOTE</strong>: within the script, inputs for each function are well explained and commented out.