Geographic landscapes and coordinate systems are no longer tied to a geographic location on Earth and can be fully abstract (including completely arbitrary shapes of the “continents”, geographic barriers etc.).
It is now possible to define models in forward or backwards direction, depending on what is more convenient for the user and the scenario that is being modeled. The direction of time is automatically detected and translated to SLiM’s units of generations in the forward direction.
Spatial interaction distances (translated to
maxDistance on the SLiM side) as well as offspring distances from parents (i.e. the standard deviations of their normal distributions) can now be specified for each population individually. The users can still provide default values for all populations (or just those which did not have their own dedicated parameter values) in the main
compile() call. These parameters can also change dynamically over time by calling the
Sampling (“remembering”) of individuals for tree-sequence recording can now be scheduled with the
A basic interface to tskit has been implemented: loading, recapitating, and simplifying tree-sequence data, conversion to genotype file formats such as EIGENSTRAT (
ts_eigenstrat()) and VCF (
ts_vcf()), a couple of population genetics statistical functions (all with the
ts_* prefix) such as
ts_f3(), etc. have also been implemented. More is to come, but the goal here is to focus only on loading tree-sequences and calculating population genetics statistics on simulated tree-sequence data, nothing more. Only the things desirable (and sensible) to do within R and its limitations will be implemented. All of the tskit/pyslim functionality is accessed via the reticulate package. See a dedicated vignette for an example of the tree-sequence functionality in slendr.
New shiny-based interactive exploration “app”:
explore(). The functions accepts a compiled
slendr_model object (i.e. a formal configuration of spatial population dynamics and gene flow events) and the package will spawn a browser app with a time slider. This can be used to inspect the model spatial dynamics interactively before they are sent over to the SLiM side.
distance() (for computing distances between geographic objects),
dimension() (which calculates the dimension of the world map in the “real” projected units), and
area() (for calculating the geographic area covered by any spatial object) have been added.
Simulations of marine species are now possible. This required adding a single argument
aquatic = TRUE to the
population() call which instructs the population range rendering procedure during compilation to "invert’ intersection with landscape features (subtracting land instead of water, which is done for terrestrial species).
resize() for scheduling changes in population size (in a single step, or as an exponential growth/shrinking) is implemented.
Five new vignettes have been added (available under “Articles” at the project website.
map = FALSEin the
population()“constructor” function call. All populations descending from that population will then be nonspatial, and the whole compiled model will be run in the nonspatial model on the SLiM side. A short example vignette demonstrating this feature has been added.
The number of intermediate “spatial snapshots” generated by
expand()/shrink() is now determined iteratively instead of forcing the user to specify this by themselves (which is something they would have to do manually anyway and was very annoying to deal with). If the user specifies the integer parameter
snapshots, the search is not performed and the specified value is used to generate intermediate spatial maps.