
Compute pairwise population Fst
pairwise_pop_fst.Rd
This function computes pairwise Fst. The following methods are implemented:
'Hudson': Hudson's formulation, as derived in Bhatia et al (2013) for diploids.
'Nei87' : Fst according to Nei (1987) - includes the correction for heterozygosity when computing Ht, and is equivalent to
hierfstat::pairwise.neifst()
,'WC84' : Weir and Cockerham (1984), correcting for missing data and is equivalent to
hierfstat::pairwise.WCfst()
.
Arguments
- .x
a grouped
gen_tibble
(as obtained by usingdplyr::group_by()
)- 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).
- method
one of 'Hudson', 'Nei87', and 'WC84'
- n_cores
number of cores to be used, it defaults to
bigstatsr::nb_cores()
Value
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.
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.