Model components 


Define a population and its original spatial range 

Define a world map for all spatial operations 

Define a geneflow event 

Define a geographic region 

Population dynamics 

Move the population to a new location in a given amount of time 

Expand the population range 

Shrink the population range 

Update the population range 

Resize the population size 

Change dispersal parameters 

Manipulation of spatial objects 

Merge two spatial 

Generate the overlap of two 

Generate the difference between two 

Reproject coordinates between coordinate systems 

Calculate the distance between a pair of spatial boundaries 

Calculate the area covered by the given slendr object 

Return the dimensions of the world map 

Model visualization and diagnostics 

Plot 

Plot geneflow graph based on given model configuration 

Plot simulated ancestry proportions 

Animate the simulated population dynamics 

Open an interactive browser of the spatial model 


Print a short summary of a 
Plot locations of ancestors of given individual or node on a map 

Compiling and running spatial models 

Compile the spatial demographic model 

Define sampling events at specified times for a given set of populations 

Run a slendr model as a SLiM script 

Read a previously serialized model configuration 

Substitute variables in a template SLiM script 

Tree sequence loading and processing 

Load a tree sequence file produced by a given model 

Recapitate the tree sequence 

Simplify the tree sequence down to a given set of individuals 

Add mutations to the given tree sequence 

Check that all trees in the tree sequence are fully coalesced 

Extracting genotypes from tree sequences 

Extract genotype table from the tree sequence 

Extract genotypes from the tree sequence in the EIGENSTRAT format 

Save genotypes from the tree sequenceas a VCF file 

Accessing tree sequence components 

Extract combined annotated table of individuals and nodes 

Infer spatiotemporal ancestral history for given nodes/individuals 

Get the table of individuals/nodes/edges from the tree sequence 

Extract names and times of individuals scheduled for sampling 

Get a tree from a given tree sequence 

Plot a graphical representation of a single tree 

Tree sequence statistics 

Calculate the f2, f3, f4, and f4ratio statistics 

Compute the allele frequency spectrum (AFS) 

Calculate pairwise statistics between sets of individuals 

Calculate diversity in given sets of individuals 

Calculate Tajima's D for given sets of individuals 

Calculate the density of segregating sites for the given sets of individuals 