This function loads a tree sequence file simulated from a given slendr model. Optionally, the tree sequence can be recapitated and simplified.
ts_load( model, output_dir = model$path, output_prefix = "output", recapitate = FALSE, simplify = FALSE, spatial = TRUE, recomb_rate = NULL, Ne = NULL, random_seed = NULL, simplify_to = NULL )
A directory where to look for simulation outputs (by default, all output files are in a model directory)
A common prefix of output files (by default, all files
will share a prefix
Should the tree sequence be recapitated?
Should the tree sequence be simplified down to only remembered (i.e. "sampled", in slendr parlance) individuals?
Should spatial information encoded in the tree sequence data be converted to spatial R datastructures? If FALSE, pixel-based raster-dimensions will not be converted to the coordinate reference system implied by the model. If TRUE (default), reprojection of coordinates will be performed. If the model was non-spatial, the value of this parameter is disregarded.
Arguments passed to
Random seed passed to pyslim's
A character vector of individual names. If NULL, all
remembered individuals will be retained. Only used when
pyslim.SlimTreeSequence object of the class
The loading, recapitation and simplification is performed using the Python module pyslim which serves as a link between tree sequences generated by SLiM and the tskit module for manipulation of tree sequence data. All of these steps have been modelled after the official pyslim tutorial and documentation available at: https://pyslim.readthedocs.io/en/latest/tutorial.html.
ts_data for extracting useful information about
individuals, nodes, coalescent times and geospatial locations of nodes on a