This function will execute a built-in msprime script and run a compiled slendr demographic model.

msprime(
  model,
  sequence_length,
  recombination_rate,
  output = file.path(model$path, "output_msprime.trees"),
  sampling = NULL,
  verbose = FALSE,
  random_seed = NULL,
  save_sampling = TRUE
)

Arguments

model

Model object created by the compile function

sequence_length

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

recombination_rate

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

output

Path to the output tree sequence

sampling

A data frame of times at which a given number of individuals should be remembered in the tree-sequence (see sampling for a function that can generate the sampling schedule in the correct format). If missing, only individuals present at the end of the simulation will be recorded in the tree-sequence output file.

verbose

Write the SLiM output log to the console (default FALSE)?

random_seed

Random seed (if missing, SLiM's own seed will be used)

save_sampling

Save the sampling schedule table together with other output files? If FALSE (default), the sampling table will be saved to a temporary directory.

Examples

if (FALSE)  # run a simulation using the msprime back end from a compiled slendr model object
msprime(model, sequence_length = 100e6, recombination_rate = 1e-8, method = "batch", verbose = TRUE)