This function computes pairwise Fst. The following methods are implemented:

  • 'Hudson': Hudson's formulation, as derived in Bhatia et al (2013) for diploids.

  • 'Nei86' : Gst according to Nei (1986), as derived in Bhatia et al (2013) for diploids.

  • 'Nei87' : Fst according to Nei (1987) - this is equivalent to hierfstat::pairwise.neifst(), and includes the correction for heterozygosity when computing Ht

  • 'WC84' : Weir and Cockerham (1984), as derived in Bhatia et al (2013) for diploids.

pairwise_pop_fst(
  .x,
  by_locus = FALSE,
  method = c("Hudson", "Nei87", "Nei86", "WC84"),
  n_cores = bigstatsr::nb_cores()
)

Arguments

.x

a grouped gen_tibble (as obtained by using dplyr::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', 'Nei86', '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. Estimating and Interpreting FST: The Impact of Rare Variants. Genome Research. 2013;23(9):1514–1521.

Nei, M. (1987) Molecular Evolutionary Genetics. Columbia University Press