A Simulation Framework for Spatiotemporal Population Genetics
Animate the simulated population dynamics
Calculate the area covered by the given slendr object
Convert an annotated slendr_phylo object to a phylo object
Check that the required dependencies are available for slendr to work
Check that the active Python environment is setup for slendr
Remove the automatically created slendr Python environment
Compile a slendr demographic model
Calculate the distance between a pair of spatial boundaries
Expand the population range
Open an interactive browser of the spatial model
Extract information from a compiled model or a simulated tree sequence
Define a gene-flow event between two populations
Get a path to internal Python interpreter of slendr
Activate slendr's own dedicated Python environment
Merge two spatial slendr objects into one
Move the population to a new location in a given amount of time
Run a slendr model in msprime
Generate the overlap of two slendr objects
Pipe operator
Plot slendr geographic features on a map
Plot demographic history encoded in a slendr model
Define a population
Print a short summary of a slendr object
Print tskit's summary table of the Python tree-sequence object
Read a previously serialized model configuration
Define a geographic region
Reproject coordinates between coordinate systems
Change the population size
Define sampling events for a given set of populations
Change dispersal parameters
Update the population range
Setup a dedicated Python virtual environment for slendr
Shrink the population range
A Simulation Framework for Spatiotemporal Population Genetics
Run a slendr model in SLiM
Substitute values of parameters in a SLiM extension template
Generate the difference between two slendr objects
Summarise the contents of a ts_nodes result
Compute the allele frequency spectrum (AFS)
Extract (spatio-)temporal ancestral history for given nodes/individual...
Check that all trees in the tree sequence are fully coalesced
Extract all descendants of a given tree-sequence node
Calculate pairwise divergence between sets of individuals
Calculate diversity in given sets of individuals
Plot a graphical representation of a single tree
Extract spatio-temporal edge annotation table from a given tree or tre...
Convert genotypes to the EIGENSTRAT file format
Calculate the f2, f3, f4, and f4-ratio statistics
Calculate pairwise statistics between sets of individuals
Extract genotype table from the tree sequence
Collect Identity-by-Descent (IBD) segments (EXPERIMENTAL)
Read a tree sequence from a file
Extract list with tree sequence metadata saved by SLiM
Add mutations to the given tree sequence
Extract names of individuals in a tree sequence
Extract combined annotated table of individuals and nodes
Convert a tree in the tree sequence to an object of the class phylo
Read a tree sequence from a file
Recapitate the tree sequence
Extract names and times of individuals of interest in the current tree...
Write a tree sequence to a file
Calculate the density of segregating sites for the given sets of indiv...
Simplify the tree sequence down to a given set of individuals
Get the table of individuals/nodes/edges/mutations/sites from the tree...
Calculate Tajima's D for given sets of individuals
Extract ancestry tracts from a tree sequence (EXPERIMENTAL)
Get a tree from a given tree sequence
Save genotypes from the tree sequence as a VCF file
Save a tree sequence to a file
Define a world map for all spatial operations
A framework for simulating spatially explicit genomic data which leverages real cartographic information for programmatic and visual encoding of spatiotemporal population dynamics on real geographic landscapes. Population genetic models are then automatically executed by the 'SLiM' software by Haller et al. (2019) <doi:10.1093/molbev/msy228> behind the scenes, using a custom built-in simulation 'SLiM' script. Additionally, fully abstract spatial models not tied to a specific geographic location are supported, and users can also simulate data from standard, non-spatial, random-mating models. These can be simulated either with the 'SLiM' built-in back-end script, or using an efficient coalescent population genetics simulator 'msprime' by Baumdicker et al. (2022) <doi:10.1093/genetics/iyab229> with a custom-built 'Python' script bundled with the R package. Simulated genomic data is saved in a tree-sequence format and can be loaded, manipulated, and summarised using tree-sequence functionality via an R interface to the 'Python' module 'tskit' by Kelleher et al. (2019) <doi:10.1038/s41588-019-0483-y>. Complete model configuration, simulation and analysis pipelines can be therefore constructed without a need to leave the R environment, eliminating friction between disparate tools for population genetic simulations and data analysis.