Larval and adult traits coevolve in response to asymmetric coastal currents to shape marine dispersal kernels
Data files
Sep 25, 2023 version files 2.93 MB
Abstract
Dispersal emerges as an outcome of organismal traits and external forcings. However, it remains unclear how the emergent dispersal kernel evolves as a by-product of selection on the underlying traits. This question is particularly compelling in coastal marine systems where dispersal is tied to development and reproduction, and where directional currents bias larval dispersal downstream causing selection for retention. We modelled the dynamics of a metapopulation along a finite coastline using an integral projection model and adaptive dynamics to understand how asymmetric coastal currents influence the evolution of larval (pelagic larval duration) and adult (spawning frequency) life history traits, which indirectly shape the evolution of marine dispersal kernels. Selection induced by alongshore currents favors the release of larvae over multiple time periods, allowing long pelagic larval durations and long-distance dispersal to be maintained in marine life cycles in situations where they were previously predicted to be selected against. Two evolutionary stable strategies emerged: one with a long pelagic larval duration and many spawning events resulting in a dispersal kernel with a larger mean and variance, and another with a short pelagic larval duration and few spawning events resulting in a dispersal kernel with a smaller mean and variance. Our theory shows how coastal ocean flows are important agents of selection that can generate multiple, often co-occurring, evolutionary outcomes for marine life history traits that affect dispersal.
============================================================================2. FILES:
README
============================================================================
Larval and adult traits coevolve in response to asymmetric coastal currents to shape marine dispersal kernels
By: Jimmy H. Peniston and Scott C. Burgess
June 2023
This is the README file for the code and data associated with manuscript "Larval and adult traits coevolve in response to coastal oceanography to shape marine dispersal kernels". A full description of the models can be found in the manuscript.
This ReadMe file explains what files are included here and how to run the code.
============================================================================
============================================================================
- GENERAL INFORMATION: ============================================================================
A. Disclaimer
This program is free software: you can redistribute it and/or modify
it in any way you wish.
============================================================================
B. Contact Information:
This code was primarily written by James (Jimmy) Peniston, please feel free to contact them with any questions regarding the workings of this model or adapting the code for a different use.
Contact information:
jimmpen@gmail.com
============================================================================
C. Summary of study:
The goal of this study was to explore the effects of ocean currents on the evolution of larval (pelagic larval duration) and adult traits (number of spawning events) in coastal marine organisms. In the study, we develop an integral projection model structured by both space and time and investigate trait evolution using an adaptive dynamics framework. Most of our conclusions rely on deterministic simulations, but we also tested some of our assumption using stochastic simulations.
Analyses were run using R version 3.6.3 (Holding the Windsock)
A. Deterministic simulation code
The results and conclusions of our manuscript come primarily come from the code presented in the file "dispersal_in_flow_code.R". This file provides code for running adaptive dynamics simulations of our integral projection model and givens instructions for how to generate the data to make the figures presented in the manuscript. It all provides the code used to create the figures themselves.
============================================================================
B. RCPP functions
The file "Rcpp_functions_dispersal_in_flow.cpp" is a C++ file that contains C++ code for a calculating the dispersal kernel. This function can then be used in R implement using the package "RCPP".
Using this code requires that you have a C++ compiler installed on your computer. Which C++ compiler you need will depend on your operating system. We use the g++ compiler which is available for free.
Instructions for installing the g++ compiler on a mac can be found on the webpage:
http://www-scf.usc.edu/~csci104/20142/installation/gccmac.html
And instructions for installing on a Windows systems can be found on the webpage:
http://www.codebind.com/cprogramming/install-mingw-windows-10-gcc/
If you do not wish to install a C++ compiler on your computer, you can still run the code using the code provided. It will just run much slower.
============================================================================
D. Stochastic simulation code
Code for the stochastic simulations is found in "stochastic_simulation_code.R". A description of this model can be found in the appendix of the manuscript.
============================================================================
D. Data files
The csv files are contain the data used to produce the figures presented in the paper. Code for generating these C++ files can be found in "dispersal_in_flow_code.R".
TPLD = Pelagic Larval Duration
File name: "flow_tpld_data_1000.csv"
Description: evolutionarily stable TPLD values when s=1000
U = Flow rate
U8 = Output of "calcESSup" function when Nspawn = 8
D8 = Output of "calcESSdown" function when Nspawn = 8
S8 = Output of "calcESSsep" function when Nspawn = 8
U4 = Output of "calcESSup" function when Nspawn = 4
D4 = Output of "calcESSdown" function when Nspawn = 4
S4 = Output of "calcESSsep" function when Nspawn = 4
U2 = Output of "calcESSup" function when Nspawn = 2
D2 = Output of "calcESSdown" function when Nspawn = 2
S2 = Output of "calcESSsep" function when Nspawn = 2
U1 = Output of "calcESSup" function when Nspawn = 1
D1 = Output of "calcESSdown" function when Nspawn = 1
S1 = Output of "calcESSsep" function when Nspawn = 1
NA = Not Applicable. There is no unstable equilibrium given by "calcESSsep" if "calcESSup" and "calcESSdown" output same value
File name: "flow_tpld_data_3000.csv"
Description: evolutionarily stable TPLD values when s=3000
U = Flow rate
U8 = Output of "calcESSup" function when Nspawn = 8
D8 = Output of "calcESSdown" function when Nspawn = 8
S8 = Output of "calcESSsep" function when Nspawn = 8
U4 = Output of "calcESSup" function when Nspawn = 4
D4 = Output of "calcESSdown" function when Nspawn = 4
S4 = Output of "calcESSsep" function when Nspawn = 4
U2 = Output of "calcESSup" function when Nspawn = 2
D2 = Output of "calcESSdown" function when Nspawn = 2
S2 = Output of "calcESSsep" function when Nspawn = 2
U1 = Output of "calcESSup" function when Nspawn = 1
D1 = Output of "calcESSdown" function when Nspawn = 1
S1 = Output of "calcESSsep" function when Nspawn = 1
NA = Not Applicable. There is no unstable equilibrium given by "calcESSsep" if "calcESSup" and "calcESSdown" output same value
File name: "flow_Nspawn_data.csv"
Description: evolutionary stable Nspawn values when Am=0.1
U = Flow rate
Tpld_10_1000 = Output of "NsESSup" when PLD = 10 and SiA = 1000
Tpld_20_1000 = Output of "NsESSup" when PLD = 20 and SiA = 1000
Tpld_30_1000 = Output of "NsESSup" when PLD = 30 and SiA = 1000
Tpld_40_1000 = Output of "NsESSup" when PLD = 40 and SiA = 1000
Tpld_10_3000 = Output of "NsESSup" when PLD = 10 and SiA = 3000
Tpld_20_3000 = Output of "NsESSup" when PLD = 20 and SiA = 3000
Tpld_30_3000 = Output of "NsESSup" when PLD = 30 and SiA = 3000
Tpld_40_3000 = Output of "NsESSup" when PLD = 40 and SiA = 3000
File name: "flow_Nspawn_data_Am0.csv"
Description: evolutionary stable Nspawn values when Am=0
U = Flow rate
Tpld_4_1000 = Output of "NsESSup" when PLD = 4 and SiA = 1000
Tpld_10_1000 = Output of "NsESSup" when PLD = 10 and SiA = 1000
Tpld_40_1000 = Output of "NsESSup" when PLD = 40 and SiA = 1000
Tpld_4_3000 = Output of "NsESSup" when PLD = 4 and SiA = 3000
Tpld_10_3000 = Output of "NsESSup" when PLD = 10 and SiA = 3000
Tpld_40_3000 = Output of "NsESSup" when PLD = 40 and SiA = 3000
File name: "flow_Nspawn_SiA_data.csv"
Description: evolutionarily stable Nspawn for different values of interannual variation
U = Flow rate
SiA_0_T10 = Output of "NsESSup" when PLD = 10 and SiA = 0
SiA_3000_T10 = Output of "NsESSup" when PLD = 10 and SiA = 3000
SiA_6000_T10 = Output of "NsESSup" when PLD = 10 and SiA = 6000
SiA_0_T40 = Output of "NsESSup" when PLD = 40 and SiA = 0
SiA_1000_T40 = Output of "NsESSup" when PLD = 40 and SiA = 1000
SiA_3000_T40 = Output of "NsESSup" when PLD = 40 and SiA = 3000
SiA_6000_T40 = Output of "NsESSup" when PLD = 40 and SiA = 6000
File name: "fig3_.2_data.csv"
Description: Pairwise invasion data used in figure 3A. This is the output of the for loop of the Figure 3 section of the code
File name: "fig3_1.2_data.csv"
Description: Pairwise invasion data used in figure 3B. This is the output of the for loop of the Figure 3 section of the code
File name: "coevolution_data_1000.csv"
Description: evolutionarily stable TPLD and Nspawn values when s=1000
U = Flow rate
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "coevolution_data_3000.csv"
Description: evolutionarily stable TPLD and Nspawn values when s=3000
U = Flow rate
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "Am_.1_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when Am = 0.1
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "Am_.25_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when Am = 0.25
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "Am_.4_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when Am = 0.4
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "g_.10_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when g = 0.10
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "g_.14_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when g = 0.14
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "g_.18_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when g = 0.18
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "m_6_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when m = 5 x 10^-6
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "m_7_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when m = 5 x 10^-7
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "m_8_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when m = 5 x 10^-8
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "cL_10_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when coastline length = 10km
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "cL_100_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when coastline length = 100km
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
File name: "cL_1000_coevolve.csv"
Description: evolutionarily stable TPLD and Nspawn values when coastline length = 1000km
TPLD_low = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
TPLD_high = TPLD output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
N_low = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 4 and Nspawn value is 1
N_high = Nspawn output of "calcCoevolveESS_TF" when initial TPLD value is 40 and Nspawn value is 10
Methods
Data sets were generated using provided code for simulations in the R language. Full details are available in associated manuscript.
Usage notes
Program can be run using R. A C++ file is included that can be implemented in R using the package "RCPP". Using this function requires having a C++ compiler on your computer, however the code can still be run (although at a slower speed) in the absence of the C++ function.