This function computes the AFS with respect to the given set of individuals
ts_afs(
ts,
sample_sets = NULL,
mode = c("site", "branch", "node"),
windows = NULL,
span_normalise = FALSE,
polarised = FALSE
)
Tree sequence object of the class slendr_ts
A list (optionally a named list) of character vectors with individual names (one vector per set). If NULL, allele frequency spectrum for all individuals in the tree sequence will be computed.
The mode for the calculation ("sites" or "branch")
Coordinates of breakpoints between windows. The first
coordinate (0) and the last coordinate (equal to ts$sequence_length
)
are added automatically)
Argument passed to tskit's allele_frequency_spectrum
method
When FALSE (the default) the allele frequency spectrum will be folded (i.e. the counts will not depend on knowing which allele is ancestral)
Either a single Fst value or a vector of Fst values (one for each window)
For more information on the format of the result and dimensions, in particular the interpretation of the first and the last element of the AFS, please see the tskit manual at https://tskit.dev/tskit/docs/stable/python-api.html#tskit.TreeSequence.allele_frequency_spectrum