Skip to contents
Compiling and running population genetic models
Installation and configuration of external dependencies
-
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
-
get_env()
- Get the name of the current slendr Python environment
-
check_dependencies()
- Check that the required dependencies are available for slendr to work
Spatial population dynamics
Non-spatial population dynamics
-
gene_flow()
- Define a gene-flow event between two populations
-
resize()
- Change the population size
Manipulation of spatial objects
-
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
Model visualization and diagnostics
Processing tree sequences
-
ts_read()
- Read a tree sequence from a file
-
ts_write()
- 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_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_names()
- Extract names of individuals in a tree sequence
-
ts_coalesced()
- Check that all trees in the tree sequence are fully coalesced
-
ts_save()
- Write a tree sequence to a file
-
ts_load()
- Read a tree sequence from a file
-
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
Accessing tree sequence components
-
ts_nodes()
- Extract combined annotated table of individuals and nodes
-
ts_edges()
- Extract spatio-temporal edge annotation table from a given tree or tree
sequence
-
ts_table()
- Get the table of individuals/nodes/edges/mutations/sites 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 tree-sequence node
-
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_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 Identity-by-Descent (IBD) segments (EXPERIMENTAL)
-
ts_tracts()
- Extract ancestry tracts from a tree sequence (EXPERIMENTAL)