Skip to content

Latest commit

 

History

History

README.md

SLiM model README

SLiM can be installed at https://messerlab.org/slim/. See the SLiM manual and workshop material for more details on using SLiM.

1D models

oneD-diffusion-model.slim (for underdominance alleles & homing underdominance gene drives):

  • Leave the following parameters at their defaults:

    • CAPACITY = 100000
    • SIMULATION_AREA = 1
    • AVG_NUM_OFFSPRING = 15
    • FORAGE_FRACTION = 0.0004
    • NODES_PER_FORAGING_AREA = 1
    • AVG_NUM_IN_MATING_RADIUS = 100 (max distance between mates is AVG_NUM_IN_MATING_RADIUS/CAPACITY)
  • Specify these parameters:

    • DIFFUSION_CONSTANT
    • RELEASE_WIDTH
    • RELEASE_EVERYWHERE (for local release, set to 1; for global release, set to 0)
    • INTRODUCTION_FREQUENCY (if !RELEASE_EVERYWHERE, this is the drive introduction frequency inside the RELEASE_WIDTH; if RELEASE_EVERYWHERE= 1, this is the global introduction frequency)
  • To simulate an underdominance allele, set the following parameters:

    • MODIFICATION_DRIVE = 0 (indicates this is NOT a homing underdominance gene drive)
    • phat (invasion threshold)
    • s (underdominance selection coefficient)
  • To simulate a homing underdominance gene drive, set the following parameters:

    • MODIFICATION_DRIVE = 1 (indicates this IS a homing underdominance gene drive)
    • s_gd (drive fitness cost)
    • h_gd (drive dominance coefficient)
    • c_gd (drive cleavage rate; equivalent to drive conversion rate; 1.0 default)
Releasing at the critical bubble:
  • Since the critical bubble takes the form x(p) (see paper supplement), we must create a data set of frequencies, from 0 to p_c, and their corresponding x positions. Then, in SLiM, we can loop through everyone in the population, match their x-position to the closest x in this data set, and get the critical bubble frequency. An individual's probability of being converted to a drive homozygote is equal to their closest critical bubble frequency, multiplied by whatever multiplicative factor we want to apply to the critical bubble.
  1. First, use the R script, critical-bubble-frequencies.R to create a csv file with critical bubble positions (x) and frequencies (p).
  • Create an integer identifier for this parameter set. This is the param_no. For example, I'll call an underdominance allele with s = 0.2, phat = 0.2, and D = 1e-5 "paramset2" and set param_no = 2.
  • Decide on the length of the frequency vector. 999 is the default.
  • Load the script and call the function. For my example, the function call would look like create_bubble_csv(param_no = 2, s = 0.2, phat = 0.2, D = 1e-5, underdominance_allele = T, num_slices = 999). This creates a csv file (in the same directory as the SLiM model by default) with the name paramset2-critical-bubble.csv
  1. Then, in SLiM, set the following parameters:
  • RELEASE_AT_BUBBLE=1
  • PARAM_NO (set this to whatever your param_no was in the create_bubble_csv function)
  • BUBBLE_FACTOR (set to 1.0 to release at critical bubble, >1.0 to release above the bubble, and <1.0 to release below the bubble)
  • PATH_TO_BUBBLE (specify the path to bubble if not in the same directory as the SLiM model)
  • Also make sure to set the same DIFFUSION_CONSTANT as the D in the create_bubble_csv call and phat, s, with MODIFICATION_DRIVE=0 if simulating an underdominance allele or s_gd, h_gd, c_gd, with MODIFICATION_DRIVE=1 if simulating a homing underdominance gene drive (see sections above)

oneD-diffusion-model-tade.slim (for TADE modification and suppression):

Leave the following parameters at their defaults:

  • CAPACITY = 100000
  • SIMULATION_AREA = 1
  • AVG_NUM_OFFSPRING = 15
  • FORAGE_FRACTION = 0.0004
  • NODES_PER_FORAGING_AREA = 1
  • AVG_NUM_IN_MATING_RADIUS = 100 (max distance between mates is AVG_NUM_IN_MATING_RADIUS/CAPACITY)
  • HETEROZYGOUS_DROP = 1 (can set to 0 for a ddAA release)

Specify the following parameters:

  • DIFFUSION_CONSTANT
  • RELEASE_WIDTH
  • RELEASE_EVERYWHERE (for local release, set to 1; for global release, set to 0)
  • INTRODUCTION_FREQUENCY (if !RELEASE_EVERYWHERE, this is the drive carrier introduction frequency inside the RELEASE_WIDTH; if RELEASE_EVERYWHERE= 1, this is the global drive carrier introduction frequency)
  • SUPPRESSION (set to 0 for modification drives or 1 for suppression drives)
  • BOTH_SEX = 0 (set to 0 for standard TADE suppression; set to 1 if you want to simulate a TADE suppression drive where both female and male homozygotes are sterile)
  • s_gd (drive fitness cost)
  • h_gd (drive dominance coefficient; 0.5 default)
  • c_gd (drive cleavage rate; equivalent to target disruption rate; 1.0 default)

2D models

twoD-diffusion-model.slim (for underdominance allele & homing underdominance gene drives):

  • The only parameter that differs between twoD-diffusion-model.slim and oneD-diffusion-model.slim is RELEASE_DIAMETER:
    • We now release the drive in a central circle with this diameter.
    • You can also still do a global release instead: set RELEASE_EVERYWHERE=1 and specify the global INTRODUCTION_FREQUENCY

twoD-diffusion-model-tade.slim (for TADE modification and suppression):

  • The only parameter that differs between twoD-diffusion-model-tade.slim and oneD-diffusion-model-tade.slim is RELEASE_DIAMETER
    • We release the drive in a central circle with this diameter
    • OR you can do a global release: set RELEASE_EVERYWHERE=1 and specify the global INTRODUCTION_FREQUENCY
      • Note that this is the drive carrier frequency, not necessarily the drive allele frequency (if HETEROZYGOUS_DROP=T, the drive allele frequency will be half of this)

Running SLiM at the command line

I typically run SLiM from the SLiMgui so I can see possibly-interesting spatial dynamics, but SLiM can also be run from the command line. For example, the following command will simulate an underdominance allele with phat = 0.2, s = 0.2, and D = 1e-5 released in a width of 0.03 in the 1D model:

slim -d phat=0.2 -d s=0.2 -d DIFFUSION_CONSTANT=0.00001 -d RELEASE_WIDTH=0.03 -d INTRODUCTION_FREQUENCY=1.0 -d RELEASE_EVERYWHERE=0 -d MODIFICATION_DRIVE=0 -d RELEASE_AT_BUBBLE=0 oneD-diffusion-model.slim

Note: replace oneD-diffusion-model.slim with the path to this file if not in your current working directory.