To run simulations, we resort to a single function with a wide variety of parameters.
Patches.repeat_params
— FunctionMANDATORY ARGUMENTS
- n_repeats::Int64: Number of repetitions for the simulation.
- basepath::String: Path to the directory where the results will be saved.
OPTIONAL ARGUMENTS Resource parameters:
n_complex
::Int64: Number of complex resources. Default is3
.n_simple
::Int64: Number of simple resources. Default is10
.n_monomer
::Int64: Number of monomer resources. Default is5
.gapsize
::Int64: Size of the gap between complex and simple resources. Default is15
.
Resource supply parameters:
influx_amount
::Float64: Amount of resource influx. Default is0.0
.influx_time
::Float64: Time between resource influxes. Default is1.0
.alpha_high
::Float64: Controls constant resource supply ifmucus=false
. Each local community receives a continuous supply 100 units of complex resource, of whichalpha_high
amount is dedicated to a single complex resource. The remainder is split evenly between other complex resources. Default is100.0
.
Species parameters:
n_invaders
::Int64: Number of invading species. Default is100
.t_inv
::Float64: Time between the introduction of invading species. Default is1.0
.n_species
::Int64: Number of species initially in the habitat. Default is1
.pool_size
::Int64: Size of the species pool. Default is500
.tradeoff_strength
__number_consumed::Float64: Trade-off strength for the number of resources consumed. Default is0.1
.tradeoff_strength
__numberofsplits::Float64: Trade-off strength for the "complexity" of a species' reaction repertoire, based on the number of enzymatic cuts they perform. Default is0.1
.h
::Float64: Reaction rate allocation tradeoff. The h-th power of reaction rates in a species always sums to one. Default is1.0
.gen_n_consumed
::Int64: Number of resources consumed by generalist species. Default is4
.spec_n_consumed
::Int64: Number of resources consumed by specialist species. Default is1
.consume_all_monomers
::Bool: Whether every species is able to consume all monomers. Default isfalse
.
Mucus parameters:
mucus
::Bool: Whether to include mucus in the simulation, where resource supply is constant. Default istrue
.mucus_disjunct
::Bool: Whether the mucus resource is disjunct from the rest of the primary resources (there is no overlap in their byproducts). Default istrue
.mucus_simple
::Int64: Only used ifmucus_disjunt=true
Number of simple resources in the mucus resource breakdown pathways. Default is5
.mucus_mono
::Int64: Only used ifmucus_disjunt=true
Number of monomer resources in the mucus resource breakdown pathways. Default is4
.mucus_gap
::Int64: Only used ifmucus_disjunt=true
Size of the gap between mucus and simple mucus-specific resources. Default is10
.
Simulation parameters:
ncomms
::Int64: Number of communities in the simulation. Default is3
.t_span
::Tuple{Float64, Float64}: Time span of the simulation. Default is(0, 150)
.cutoff
::Float64: Species under cutoff are considered extinct. Default is0.0001
.symmetrical
::Bool: Whether diffusion is symmetrical or directional across communities. Default istrue
.limited_pathways
::Bool: Whether to limit the underlying metabolic reaction system by excluding ~half of the energetically possible byproducts of resources. Default istrue
.
Stochasticity parameters:
set_seeds
::Union{Nothing, Vector{Int64}}: If provided, seeds for each repeat. Default isnothing
.fix_metab
::Bool: Whether to use the same metabolism for all repeats. Default isfalse
.fix_pool
::Bool: Whether to use the same species pool for all repeats. Default isfalse
.fix_sample
::Bool: Whether to use the same sample for all repeats. Default isfalse
.fix_callbacks
::Bool: Whether to use the same callbacks for all repeats. Default isfalse
.fix_order
::Bool: Whether to fix the order of invading species. Default isfalse
.
Each simulation will have its own subfolder in the specified output folder, where the following things are saved:
params
: Parameters of the simulationbeta_diversity plot
: A measure of how different the composition of local communities are
shannon_diversity plot
: A measure of the diversity of all populations of the simulation pooled together
MCI plot
: Metabolic Capacity Index of the of the system. Tracks the total number of different reactions by taking all of the species stoichiometric matrices and adding 1 for each position where at least 1 species has a non-zero entry
consumer_types plot
: Tracks the total number of primary consumer (generalist) and secondary consumer (specialist) species across the system
species_counts plot
: Tracks the total number of different species across the system
comm_totals plot
: Tracks the total abundance of members for each local community
community graph plots
: A separate graph for each local community, depicting the active pathways. Species nodes are blue, resource nodes are green. Red arrows indicate consumption, green arrows indicate production. Arrow widths are weighted according to the pathway fluxes.
Outside of the individual run folders, we will find the following outputs:
Aggregated versions
of the Beta diversity, Shannon diversity, Species counts, MCI, Consumer types and Community totals figures. Standard deviation is shown in all but the last two figures of the above list.Tr_rel_something plots
correspond to the same measures, but they take an average of these measures around the end of the transient (tr) and at the end of the relaxation (rel) period for each simulation. The mean and standard deviation are shown.JLD2 format files
are used to store the data needed for generating all of the above plots.