2.6.1 Genetic analyses
To determine if the phenotypic differences in tolerance were associated with genetic differences we tested for genetic differentiation among populations of S. cataractae . Thus, we performed an analysis of molecular variance (AMOVA) with the function poppr.amova in the poppr R package 90, based on SNPs with no missing values (n=23,252 SNPs). This function takes a genind object (created with the function df2genind from adegenet91; ploidy= 1) as dependent variable and population (with 4 levels, n=7-8 samples per level) as predictor. The significance of the model was assessed using a randomization test with 9999 permutations on the output of the AMOVA (function randtest from the ade4 package 92). Additionally, we calculated the likelihood ratio G-statistic to test for significant genetic differentiation among populations (gstats.glob function from the hierfstat package 93 with 9999 permutations). We assessed its significance by comparing the observed statistic with the distribution of the G-statistic on a null dataset where samples were randomly shuffled among populations using the functionsamp.between from hierfstat (9999 repetitions).
Genetic data were visualized by means of principal component analysis (PCA) carried out with the function dudi.pca (ade4 package) on a scaled and centered allele frequency matrix obtained with the functionscaleGen (adegenet package).