Generates a SLiM script from a built-in spannr template, substituting all required parameters by values specified by the user. The user has an option to either run the script in batch mode, open it in SLiMgui, or simply save the generated SLiM script to a given location for later use.

run(
  model,
  sim_length,
  seq_length,
  recomb_rate,
  max_interaction,
  spread,
  save_locations = FALSE,
  track_ancestry = FALSE,
  keep_pedigrees = FALSE,
  ts_recording = FALSE,
  how = "gui",
  verbose = FALSE,
  include = NULL,
  burnin = NULL,
  script_path = file.path(model$config$directory, "script.slim"),
  output_prefix = file.path(model$config$directory, "output")
)

Arguments

model

Model object created by the compile function

sim_length

Total length of the simulation (in model time units, i.e. years)

seq_length

Total length of the simulated sequence (in base-pairs)

recomb_rate

Recombination rate of the simulated sequence (in recombinations per basepair per generation)

max_interaction

Maximum spatial interaction and mating choice distance

spread

Standard deviation of the normal distribution for a distance from of an offspring from one of its parents (randomly determined by SLiM)

save_locations

Save location of each individual throughout the simulation?

track_ancestry

Track ancestry proportion dynamics in all populations throughout the simulations (default FALSE)? If a non-zero integer is provided, ancestry will be tracked using the number number of neutral ancestry markers equal to this number.

keep_pedigrees

Turn on keepPedigrees during SLiM initialization?

ts_recording

Turn on tree sequence recording during SLiM initialization?

how

How to run the script? ("gui" - open in SLiMgui, "batch"

  • run on the command-line, "dry-run" - simply return the script)

include

Vector of paths to custom SLiM scripts which should be combined with the backend SLiM code

burnin

Length of the burnin (in model's time units, i.e. years)

script_path

Name of the compiled output script

output_prefix

Common prefix (including path) for all output files

generation_time

Generation time (in model's time units, i.e. years)