Note: This repository is a companion to a paper that is currently in progress. This is a “beta” release of these scripts: although we believe everything is correct, they have not undergone final review, and some aspects will probably change before the final release.
code: github.com/kr-colab/spatial_sims_standard
This is a repository of examples scripts to run SLiM simulations on (continuous) spatial landscapes. The goal of these examples is to make it easy to explore various ways of setting up such simulations, to choose parameters to roughly model a given system, and to run computational experiments.
The SLiM Manual is an excellent resource that covers many aspects of spatial simulations. (To start off: sections 1.1-1.6, 15.1-15.2, and chapter 16.) However, the manual tends to cover the mechanics of the tool; to build a successful spatial simulation of a given system requries a fair amount of craft as well. Questions that many people encounter very quickly are: (1) How do I get my simulation to equilibrate at a given population size? and (2) How do I vary (some aspect of the simulation) across a map? Here, we aim to provide scripts that:
Getting started:
To try something out, install SLiM, open the GUI,
change into this directory, open minimal.slim
, and run it.
That’s it! Then, change into some of the subdirectories and try those scripts:
they should all just run.
(For spatial models, the GUI is essential in developing and debugging;
computational experiments will run the scripts on the command line, of course.)
In the main directory, we have a minimal example (minimal.slim
) of hermaphrodites without age-structure, adult movements, or a map.
The scripts in each folder follow the same format but have some elements that a more realistic simulation requires.
minimal.slim
: a minimal example, that explains the general structure of the scripts.maps/
: use a simple map of a mountain to model heterogenous carrying capacity distribution in spaceadult_movement/
(Individuals continue to move around throughout its lifetime. Appropriate for animals, rather than plants)mate_choice/
(Dioecious population, offspring dispersed from female parents)selection/
(Selective sweep in space)case_studies/
pikas/
(pikas on a mountain with temperature rising)toads/
(Austrailian cane toads’ range expansion)mosquito/
(mosquitos with a larval stage that lives only in water and seasonal fluctuations)monarchs/
(monarch butterflies whose populations are regulated by a discrete set of host plants, that feeds caterpillars)You need SLiM version at least 4.2 (and the GUI is highly recommended). Python is used for set-up of some additional examples.