Giter Site home page Giter Site logo

spatial_sims_standard's Introduction

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.

Standardizing spatial simulations on SLiM

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:

  1. have adjustable parameters that correspond naturally to biologically important and observable quantities;
  2. are simple, easy to understand, and easy to use for reproducible research; and
  3. share as much structure as possible, so that parts from one script can be used in another script with minimal hassle.

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.

The examples:

  • 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 space
  • adult_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)

Requirements

You need SLiM version at least 4.2 (and the GUI is highly recommended). Python is used for set-up of some additional examples.

spatial_sims_standard's People

Contributors

jiseonmin avatar petrelharp avatar chriscrsmith avatar samchamper avatar lclclclclclclc avatar silastittes avatar bhaller avatar clararehmann avatar vcaudill avatar

Stargazers

lkirk avatar

Watchers

 avatar Andrew Kern avatar  avatar  avatar  avatar

spatial_sims_standard's Issues

Runtime error in pikas example

Hi Ben,

I think all of our scripts are ready for your final review, except for this one bug I found in pikas script.
I am getting "ERROR (Eidos_ExecuteFunction_max): function max() requires all arguments to be the same type.

This error has invalidated the simulation; it cannot be run further. Once the script is fixed, you can recycle the simulation and try again." at tick 107 in line 128.

max_f = max(0.01, max(p1.individuals.tagF));

The tagF is defined by localPopulationDensity (line 108), which is by definition Float... So I feel like arguments in line 128 should be guaranteed to be floats? Am I missing anything?

Asking for code review

Hey @bhaller, I was hoping to get your feedback on minimal.slim if it looks reasonable as a "template" for various spatial simulation recipes. I am writing what each code block does and how it can be modified in details in Readme. When you get a chance to look at the script, please let me know if I can improve any part of it. Readme is still in progress, but minimal.slim is ready. Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.