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 flow. To overcome these difficulties, 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.

The method was further developed by Torsten Günther and myself, as described in this Genetics article. The newest version of the method is called Bayenv 2, and it maintains the full functionality of the original Bayenv.

The code is maintained by Torsten here. The tarballs/zips of the executable, example datasets, and a manual are given there.

When using bayenv please make sure that you have recently downloaded the program, to avoid old bugs. Please email Torsten ( for the code, or for versions compiled for other types of machine.

From the original paper:
The matrices for the HGDP data
The Bayes factors for the European and Western Eurasia Bayes Factors used in the paper, stored as R objects.

2 Responses to Bayenv

  1. Pingback: Bayenv - Identify Loci Underlying Local Adaptation

  2. Pingback: Homo sapiens: the unsung model species of molecular ecology | The Molecular Ecologist

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s