Model components

population()

Define a population and its original spatial range

world()

Define a world map for all spatial operations

geneflow()

Define a geneflow event

region()

Define a geographic region

Population dynamics

move()

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

expand()

Expand the population range

shrink()

Shrink the population range

boundary()

Update the population range

resize()

Resize the population size

dispersal()

Change dispersal parameters

Manipulation of spatial objects

join()

Merge two spatial slendr objects into one

overlap()

Generate the overlap of two slendr objects

subtract()

Generate the difference between two slendr objects

reproject()

Reproject coordinates between coordinate systems

distance()

Calculate the distance between a pair of spatial boundaries

area()

Calculate the area covered by the given slendr object

dimensions()

Return the dimensions of the world map

Model visualization and diagnostics

plot(<slendr>)

Plot slendr geographic features on a map

plot_graph()

Plot geneflow graph based on given model configuration

plot_ancestry()

Plot simulated ancestry proportions

animate()

Animate the simulated population dynamics

explore()

Open an interactive browser of the spatial model

print(<slendr_pop>) print(<slendr_region>) print(<slendr_map>) print(<slendr_model>) print(<slendr_tsdata>)

Print a short summary of a slendr object

plot_ancestors()

Plot locations of ancestors of given individual or node on a map

Compiling and running spatial models

compile()

Compile the spatial demographic model

sampling()

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

slim()

Run a slendr model as a SLiM script

read()

Read a previously serialized model configuration

script()

Substitute variables in a template SLiM script

ts_load()

Load a tree sequence file produced by a given model

ts_recapitate()

Recapitate the tree sequence

ts_simplify()

Simplify the tree sequence down to a given set of individuals

ts_mutate()

Add mutations to the given tree sequence

ts_coalesced()

Check that all trees in the tree sequence are fully coalesced

Extracting genotypes from tree sequences

ts_genotypes()

Extract genotype table from the tree sequence

ts_eigenstrat()

Extract genotypes from the tree sequence in the EIGENSTRAT format

ts_vcf()

Save genotypes from the tree sequenceas a VCF file

Accessing tree sequence components

ts_data()

Extract combined annotated table of individuals and nodes

ts_ancestors()

Infer spatio-temporal ancestral history for given nodes/individuals

ts_individuals() ts_edges() ts_nodes()

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

ts_samples()

Extract names and times of individuals scheduled for sampling

ts_tree()

Get a tree from a given tree sequence

ts_draw()

Plot a graphical representation of a single tree

Tree sequence statistics

ts_f2() ts_f3() ts_f4() ts_f4ratio()

Calculate the f2, f3, f4, and f4-ratio statistics

ts_afs()

Compute the allele frequency spectrum (AFS)

ts_fst() ts_divergence()

Calculate pairwise statistics between sets of individuals

ts_diversity()

Calculate diversity in given sets of individuals

ts_tajima()

Calculate Tajima's D for given sets of individuals

ts_segregating()

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