Function reference

slim()
 Run a slendr model in SLiM

msprime()
 Run a slendr model in msprime

compile_model()
 Compile a slendr demographic model

read_model()
 Read a previously serialized model configuration

schedule_sampling()
 Define sampling events for a given set of populations

setup_env()
 Setup a dedicated Python virtual environment for slendr

init_env()
 Activate slendr's own dedicated Python environment

check_env()
 Check that the active Python environment is setup for slendr

clear_env()
 Remove the automatically created slendr Python environment

population()
 Define a population

world()
 Define a world map for all spatial operations

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

expand_range()
 Expand the population range

shrink_range()
 Shrink the population range

set_range()
 Update the population range

set_dispersal()
 Change dispersal parameters

gene_flow()
 Define a geneflow event between two populations

resize()
 Change the population size

region()
 Define a geographic region

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

plot_map()
 Plot
slendr
geographic features on a map

plot_model()
 Plot demographic history encoded in a slendr model

animate_model()
 Animate the simulated population dynamics

explore_model()
 Open an interactive browser of the spatial model

print(<slendr_pop>)
print(<slendr_region>)
print(<slendr_map>)
print(<slendr_model>)
print(<slendr_nodes>)
 Print a short summary of a
slendr
object

print(<slendr_ts>)
 Print tskit's summary table of the Python treesequence object

ts_load()
 Load a tree sequence file produced by a given model

ts_save()
 Save a tree sequence to a file

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

ts_samples()
 Extract names and times of individuals of interest in the current tree sequence (either all sampled individuals or those that the user simplified to)

ts_genotypes()
 Extract genotype table from the tree sequence

ts_eigenstrat()
 Convert genotypes to the EIGENSTRAT file format

ts_vcf()
 Save genotypes from the tree sequence as a VCF file

ts_nodes()
 Extract combined annotated table of individuals and nodes

ts_edges()
 Extract spatiotemporal edge annotation table from a given tree or tree sequence

ts_table()
 Get the table of individuals/nodes/edges/mutations from the tree sequence

ts_phylo()
 Convert a tree in the tree sequence to an object of the class
phylo

ts_tree()
 Get a tree from a given tree sequence

ts_draw()
 Plot a graphical representation of a single tree

ts_metadata()
 Extract list with tree sequence metadata saved by SLiM

ts_ancestors()
 Extract (spatio)temporal ancestral history for given nodes/individuals

ts_descendants()
 Extract all descendants of a given treesequence node

ts_f2()
ts_f3()
ts_f4()
ts_f4ratio()
 Calculate the f2, f3, f4, and f4ratio statistics

ts_afs()
 Compute the allele frequency spectrum (AFS)

ts_divergence()
 Calculate pairwise divergence between sets of individuals

ts_diversity()
 Calculate diversity in given sets of individuals

ts_fst()
 Calculate pairwise statistics between 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

ts_ibd()
 Collect IdentitybyDescent (IBD) segments