Loci involved in local adaptation can potentially be identified by an unusual correlation between allele frequencies and important ecological variables, or by extreme allele frequency differences between geographic regions. However, such comparisons are complicated by differences in sample sizes and the neutral correlation of allele frequencies across populations due to shared history and gene ow. To overcome these diffculties, we have developed a Bayesian method that estimates the empirical pattern of covariance in allele frequencies between populations from a set of markers, and then uses this as a null model for a test at individual SNPs. I developed this method in collaboration with David Witonsky, Anna Di Rienzo and Jonathan Pritchard. The method is described in a paper in Genetics.

If you download the program please send an email to bayenv at for updates about bug fixes etc. When using bayenv please make sure that you have recently downloaded the program, to avoid old bugs.

A short manual.
The Bayes factors for the European and Western Eurasia Bayes Factors used in the paper, stored as R objects.
Tar ball of the program and example files:
Linux 64 bit
Please email me (gmcoop at if you need the code, or want to the program compiled on other machines.