To enable comparisons with other models, we simulated genotypic data from spatial coalescent models with the computer program
ms (Hudson 2002 (
link)). Ten data sets were generated according to a linear stepping-stone model with 40 demes, setting the effective migration rate between pairs of adjacent demes to the value . Sampling five individuals in each deme, each data set included a total of
n = 200 haploid individuals genotyped at unlinked SNP loci. We ran the LFMM during 100 sweeps for burn-in, and we used the next 900 sweeps to compute point estimates, variances, and -scores. An environmental variable
, x, was defined for each population as the geographic identifier of the population in the linear stepping-stone model.
We created an environmental gradient for the artificial variable
x using a logistic function,
s(
x), of
x as follows
For each of the 10 previously generated neutral stepping-stone simulations, we simulated binary alleles at 50 unlinked loci for each deme
x with frequency
s(
x), and with the slope of the gradient . We then obtained 10 data sets with unlinked loci including 50 loci correlated with the environmental gradient,
s(
x). Using Tracy–Widom tests implemented in SmartPCA, we found that the number of principal components with
P values smaller than 0.01 was around . Using the Bayesian clustering programs
STRUCTURE and
TESS, we found that components could better describe our simulated data. A value corresponds to a strong intensity of selection through geographic space, whereas corresponds to a weak intensity of selection. We used the value when comparing tests based on linear and PC regression models. When comparing LFMMs with
BAYENV, we used the value to better fit the objectives of both models. As
BAYENV returns Bayes factors instead of
P values, we considered ranked lists recording the
M loci corresponding to the strongest associations (
M between 1 and ). For each
M, we computed the number of TPs and the number of FPs. Locus ranking was performed on the basis of -scores in LFMM and on the basis of Bayes factors in
BAYENV. The LFMM tests used values of
K equal to and 20, and we used of the
BAYENV algorithm to compute Bayes factors. Experiments were assessed by counting the number of FP and FN associations, and by measuring the AUC averaged over 10 replicates.