SLiM can be installed at https://messerlab.org/slim/. See the SLiM manual and workshop material for more details on using SLiM.
oneD-diffusion-model.slim (for underdominance alleles & homing underdominance gene drives):
-
Leave the following parameters at their defaults:
CAPACITY= 100000SIMULATION_AREA= 1AVG_NUM_OFFSPRING= 15FORAGE_FRACTION= 0.0004NODES_PER_FORAGING_AREA= 1AVG_NUM_IN_MATING_RADIUS= 100 (max distance between mates is AVG_NUM_IN_MATING_RADIUS/CAPACITY)
-
Specify these parameters:
DIFFUSION_CONSTANTRELEASE_WIDTHRELEASE_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 theRELEASE_WIDTH; ifRELEASE_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)
- 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.
- 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 setparam_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 nameparamset2-critical-bubble.csv
- Then, in SLiM, set the following parameters:
RELEASE_AT_BUBBLE=1PARAM_NO(set this to whatever yourparam_nowas in thecreate_bubble_csvfunction)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_CONSTANTas theDin thecreate_bubble_csvcall andphat,s, withMODIFICATION_DRIVE=0if simulating an underdominance allele ors_gd,h_gd,c_gd, withMODIFICATION_DRIVE=1if 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= 100000SIMULATION_AREA= 1AVG_NUM_OFFSPRING= 15FORAGE_FRACTION= 0.0004NODES_PER_FORAGING_AREA= 1AVG_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_CONSTANTRELEASE_WIDTHRELEASE_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 theRELEASE_WIDTH; ifRELEASE_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)
twoD-diffusion-model.slim (for underdominance allele & homing underdominance gene drives):
- The only parameter that differs between
twoD-diffusion-model.slimandoneD-diffusion-model.slimisRELEASE_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=1and specify the globalINTRODUCTION_FREQUENCY
twoD-diffusion-model-tade.slim (for TADE modification and suppression):
- The only parameter that differs between
twoD-diffusion-model-tade.slimandoneD-diffusion-model-tade.slimisRELEASE_DIAMETER- We release the drive in a central circle with this diameter
- OR you can do a global release: set
RELEASE_EVERYWHERE=1and specify the globalINTRODUCTION_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)
- Note that this is the drive carrier frequency, not necessarily the drive allele frequency (if
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.