This function computes pairwise Fst. The following methods are implemented:
'Hudson': Hudson's formulation, as derived in Bhatia et al (2013) for diploids. This is the only method that can also be used with pseudohaploid data.
'Nei87' : Fst according to Nei (1987) - includes the correction for heterozygosity when computing Ht (it uses the same formulation as in
hierfstat::pairwise.neifst()
),'WC84' : Weir and Cockerham (1984), correcting for missing data (it uses the same formulation as in
hierfstat::pairwise.WCfst()
).
Arguments
- .x
a grouped
gen_tibble
(as obtained by usingdplyr::group_by()
)- type
type of object to return One of "tidy" or "pairwise" for a pairwise matrix of populations. Default is "tidy".
- by_locus
boolean, determining whether Fst should be returned by locus(TRUE), or as a single genome wide value obtained by taking the ratio of the mean numerator and denominator (FALSE, the default).
- by_locus_type
type of object to return. One of "tidy", "matrix" or "list". Default is "tidy".
- method
one of 'Hudson', 'Nei87', and 'WC84'
- return_num_dem
returns a list of numerators and denominators for each locus. This is useful for creating windowed estimates of Fst (as we need to compute the mean numerator and denominator within each window). Default is FALSE.
- n_cores
number of cores to be used, it defaults to
bigstatsr::nb_cores()
Value
if type=tidy
, a tibble of genome-wide pairwise Fst values with
each pairwise combination as a row if "by_locus=FALSE", else a list
including the tibble of genome-wide values as well as a matrix with
pairwise Fst by locus with loci as rows and and pairwise combinations as
columns. If type=pairwise
, a matrix of genome-wide pairwise Fst values is
returned.
Details
For all formulae, the genome wide estimate is obtained by taking the ratio of the mean numerators and denominators over all relevant SNPs.
References
Bhatia G, Patterson N, Sankararaman S, Price AL. (2013) Estimating and Interpreting FST: The Impact of Rare Variants. Genome Research, 23(9):1514–1521.
Nei, M. (1987) Molecular Evolutionary Genetics. Columbia University Press
Weir, B. S., & Cockerham, C. C. (1984). Estimating F-statistics for the analysis of population structure. Evolution, 38(6): 1358–1370.