A short R script to calculate the Reich-Patterson FST estimator (Reich et al. 2009, https://doi.org/10.1038/nature08365) and bootstraps from a genlight object. All pairwise FST estimates will be calculated between populations in the genlight object.
Update September 2025: I have included a second function that will calculate locus-specific FST estimates from a genlight object with only two populations (or by specifying which two populations from the genlight object to use). Please also note that this function was written to work with the original dartR package, and not the newer dartRverse-- preliminary tests have shown that it does work the same, but YMMV. Please open a GitHub issue if you have problems with running the functions.
Update 2, September 2025: I have added a third function, which will calculate windowed FST estimates from a genlight object with only two populations. Windows can be specified as win.type="snp" or win.type="bp", enabling the use of windows of either a given number of SNPs or a given number of bp. The chrom=TRUE option makes sure that windows don't span different chromosomes, but the option is present to turn this functionality off in case that makes sense for your specific data. As a caution, this function and the locus-specific FST function were written somewhat quickly to get the job done, and therefore are likely not the most efficient implementation of these calculations. Further refinement may come in the future (and suggestions are always welcome!).
This script was first used in Junker et al. 2020, Molecular Ecology (https://doi.org/10.1111/mec.15559) and depends on the dartR package(https://cran.r-project.org/web/packages/dartR/index.html). If you use this script in a publication, please cite the Junker et al. 2020 paper!