1. ABOUT THE DATASET -------------------- Title: Dataset for 'Coupled environmental and demographic fluctuations shape the evolution of cooperative antimicrobial resistance' Creator(s): Hernández-Navarro, Lluís; Asker, Matthew; and Mobilia, Mauro Organisation(s): Department of Applied Mathematics, School of Mathematics, University of Leeds, Leeds LS2 9JT, U.K. Rights-holder(s): Copyright 2023 University of Leeds Publication Year: 2023 Description: Dataset for 'Coupled environmental and demographic fluctuations shape the evolution of cooperative antimicrobial resistance'. A full description of the data, methods, and interpretation may be found in the related publication. Computational data: raw results from stochastic simulations of our full model and of the effective Moran model at fixed total population. Scripts: codes to run the simulations (in Python), as well as codes to generate each of the 4+1 main and supplementary figures (in Matlab) from the computational data. Cite as: Hernández-Navarro, Lluís; Asker, Matthew; and Mobilia, Mauro (2023) Dataset for 'Coupled environmental and demographic fluctuations shape the evolution of cooperative antimicrobial resistance'. University of Leeds. [Dataset] https://doi.org/10.5518/1360 Related publication: Hernández-Navarro, Lluís; Asker, Matthew; and Mobilia, Mauro (2023) Coupled environmental and demographic fluctuations shape the evolution of cooperative antimicrobial resistance. To be submitted. Contact: L.Hernandez-Navarro@leeds.ac.uk, M.Mobilia@leeds.ac.uk 2. TERMS OF USE --------------- Copyright 2023 University of Leeds. This dataset is licensed under a Creative Commons Attribution 4.0 International Licence: https://creativecommons.org/licenses/by/4.0/ 3. PROJECT AND FUNDING INFORMATION ---------------------------------- Title: DMS-EPSRC Eco-Evolutionary Dynamics of Fluctuating Populations Dates: 2022-2025 Funding organisation: EPSRC Grant no.: EP/V014439/1 L.H.N., A.M.R and M.M. gratefully acknowledge funding from the EPSRC via the grant No. EP/V014439/1 for the project ’DMS-EPSRC Eco-Evolutionary Dynamics of Fluctuating Populations’. The support of the EPSRC Ph.D. scholarship EP/T517860/1 to M.A. is also thankfully acknowledged. 4. CONTENTS ----------- File listing Each of the scripts titled "FinalFigure*.m" (where *=1,2,3,4, or S1) provides the Matlab R2019a code used to generate the corresponding figure in the original manuscript. To run the codes: -Copy the codes "FinalFigure*.m", the data file "Fig1Data.mat", and the data subfolder "SimulationData" to a folder in your computer. -Change the variable "figfolder" to the path of the folder where you copied the corresponding files and subfolders (see previous point). -In all "FinalFigure*.m" scripts (but for the case *=1), change the variable "loadfigdatafolder" to the path of the "SimulationData" subfolder in your computer. -Run the "FinalFigure*.m" scripts to get the matlab plots of any figures, saved as FinalFig* in ".png", ".pdf", and Matlab's ".fig" format in your computer folder (see previous first point). The simulation data of "Fig1Data.mat" provides the data for figure 1b-c. The data provided in the subfolder "SimulationData" is subdivided in the sub-subfolders: -"Distributions", data for figure 4a-c. -"FixAndCoexProbData", data for figures 2a-c and 4d-f. -"FluctNcttK", theory data for figures 3 and S1, and simulation data for S1. -"Trajectories", data for figure 2d-f. All data files are provided in ".csv" or in Matlab's ".mat" formats. The Python codes to run the stochastic simulations of our full model are: -"next_reaction_method.py", the function that is called by the other Python scripts to run the Next Reaction Method of [Anderson; J. of Chem. Phys., 2007] (see reference in the supplementary information). Conditions to end the simulation (e.g., maximum simulation time, or until fixation of any species) are directly set in the next_reaction_method file (see comments within). -"distribution.py", the script to run the simulations of the full model and get the numerical data for figure 4a-c. -"heatmap.py", the script to run simulations of the full model and get the numerical data for figures 2a-c and 4d-f. -"fixation properties.py", the script to run simulations at constant K and get the numerical data for figure S1. -"trajectories.py", the script to run simulations of the full model and get the numerical data for figure 2d-f. 5. METHODS ---------- Full details of methods provided in Hernández-Navarro et al. (2023) Coupled environmental and demographic fluctuations shape the evolution of cooperative antimicrobial resistance (to be submitted).