For a discussion on the difference between "site", "branch", and "node"
options of the
mode argument, please see the tskit documentation at
Tree sequence object of the class
A list (optionally a named list) of character vectors with individual names (one vector per set)
The mode for the calculation ("sites" or "branch")
Coordinates of breakpoints between windows. The first
coordinate (0) and the last coordinate (equal to
do not have to be specified as they are added automatically.
Divide the result by the span of the window? Default TRUE, see the tskit documentation for more detail.
For each pairwise calculation, either a single Fst value or a vector of Fst values (one for each window) For each pairwise calculation, either a single divergence value or a vector of divergence values (one for each window)
if (FALSE) # compute F_st between two sets of individuals in a given tree sequence ts ts_fst(ts, sample_sets = list(afr = c("AFR_1", "AFR_2", "AFR_3"), eur = c("EUR_1", "EUR_2"))) if (FALSE) #' # collect sampled individuals from all populations in a list sample_sets <- ts_samples(ts) %>% split(., .$pop) %>% lapply(function(pop) pop$name) # compute the divergence between individuals from each sample set (list of # individual names generated in the previous step) ts_divergence(ts, sample_sets) %>% dplyr::arrange(divergence)