Spatial genetics analyses using

Similar documents
Multivariate analysis of genetic data: investigating spatial structures

Multivariate analysis of genetic data: investigating spatial structures

Multivariate analysis of genetic markers as a tool to explore the genetic diversity: some examples

Appendix A : rational of the spatial Principal Component Analysis

Multivariate analysis of genetic data an introduction

Multivariate analysis of genetic data: exploring group diversity

Multivariate analysis of genetic data: an introduction

A tutorial for Discriminant Analysis of Principal Components (DAPC) using adegenet 1.3-6

MEMGENE package for R: Tutorials

Fiche TD avec le logiciel. Coinertia Analysis. A.B. Dufour

Package CommunityCorrelogram

Multivariate analysis of genetic data: exploring groups diversity

Multivariate analysis of genetic data exploring group diversity

Package mpmcorrelogram

RESERVE DESIGN INTRODUCTION. Objectives. In collaboration with Wendy K. Gram. Set up a spreadsheet model of a nature reserve with two different

Introduction GeoXp : an R package for interactive exploratory spatial data analysis. Illustration with a data set of schools in Midi-Pyrénées.

MEMGENE: Spatial pattern detection in genetic distance data

Package HierDpart. February 13, 2019

An introduction to the picante package

Introduction to Machine Learning. PCA and Spectral Clustering. Introduction to Machine Learning, Slides: Eran Halperin

Chapter 2 Exploratory Data Analysis

Quantitative Genomics and Genetics BTRY 4830/6830; PBSB

Principal Component Analysis (PCA) Theory, Practice, and Examples

1.3. Principal coordinate analysis. Pierre Legendre Département de sciences biologiques Université de Montréal

Package covrna. R topics documented: September 7, Type Package

Visualizing Tests for Equality of Covariance Matrices Supplemental Appendix

Bootstrapping, Randomization, 2B-PLS

Multivariate Analysis of Ecological Data using CANOCO

Advanced Mantel Test

Principal component analysis (PCA) for clustering gene expression data

Introduction to Principal Component Analysis (PCA)

Clusters. Unsupervised Learning. Luc Anselin. Copyright 2017 by Luc Anselin, All Rights Reserved

Supplementary Material

Unconstrained Ordination

Microsatellite data analysis. Tomáš Fér & Filip Kolář

PCA Advanced Examples & Applications

Principal Component Analysis

2/19/2018. Dataset: 85,122 islands 19,392 > 1km 2 17,883 with data

Bootstrapping, Permutations, and Monte Carlo Testing

Moran s Autocorrelation Coefficient in Comparative Methods

LAB EXERCISE #3 Quantifying Point and Gradient Patterns

Dimensionality Reduction

2.5 Multivariate Curve Resolution (MCR)

Figure 43 - The three components of spatial variation

6. Spatial analysis of multivariate ecological data

G E INTERACTION USING JMP: AN OVERVIEW

Didacticiel - Études de cas

Creating and Managing a W Matrix

EDAMI DIMENSION REDUCTION BY PRINCIPAL COMPONENT ANALYSIS

Package LBLGXE. R topics documented: July 20, Type Package

Lecture Topic Projects 1 Intro, schedule, and logistics 2 Applications of visual analytics, data types 3 Data sources and preparation Project 1 out 4

Model Building: Selected Case Studies

Machine Learning (Spring 2012) Principal Component Analysis

Assignment 1 Math 5341 Linear Algebra Review. Give complete answers to each of the following questions. Show all of your work.

FINM 331: MULTIVARIATE DATA ANALYSIS FALL 2017 PROBLEM SET 3

DIMENSION REDUCTION AND CLUSTER ANALYSIS

Quantitative Genomics and Genetics BTRY 4830/6830; PBSB

Structure in Data. A major objective in data analysis is to identify interesting features or structure in the data.

Ordination & PCA. Ordination. Ordination

Geographic Patterns of Genetic Variation in Indigenous Eastern Adriatic Sheep Breeds

Spatial Analysis I. Spatial data analysis Spatial analysis and inference

Discrimination Among Groups. Discrimination Among Groups

EXAM PRACTICE. 12 questions * 4 categories: Statistics Background Multivariate Statistics Interpret True / False

The gpca Package for Identifying Batch Effects in High-Throughput Genomic Data

An Introduction to Ordination Connie Clark

I don t have much to say here: data are often sampled this way but we more typically model them in continuous space, or on a graph

Short Answer Questions: Answer on your separate blank paper. Points are given in parentheses.

Similarity and recommender systems

Polynomial Regression

Temporal eigenfunction methods for multiscale analysis of community composition and other multivariate data

Introduction to multivariate analysis Outline

Modularity for Mathematica User s Guide Version 2.0

1 A Review of Correlation and Regression

In this exercise we will learn how to use the analysis tools in ArcGIS with vector and raster data to further examine potential building sites.

Statistics Toolbox 6. Apply statistical algorithms and probability models

Principal Components Analysis using R Francis Huang / November 2, 2016

Multivariate Statistics 101. Ordination (PCA, NMDS, CA) Cluster Analysis (UPGMA, Ward s) Canonical Correspondence Analysis

Package plw. R topics documented: May 7, Type Package

Ratio of Polynomials Fit One Variable

Sparse Principal Component Analysis via Alternating Maximization and Efficient Parallel Implementations

CS Homework 3. October 15, 2009

Multivariate Fundamentals: Rotation. Exploratory Factor Analysis

Experimental Design and Data Analysis for Biologists

Should the Mantel test be used in spatial analysis?

EQUATION OF A CIRCLE (CENTRE A, B)

TOTAL INERTIA DECOMPOSITION IN TABLES WITH A FACTORIAL STRUCTURE

FACTOR ANALYSIS AND MULTIDIMENSIONAL SCALING

Statistics for Social and Behavioral Sciences

2.3. Clustering or vector quantization 57

PCA vignette Principal components analysis with snpstats

LAB 3 INSTRUCTIONS SIMPLE LINEAR REGRESSION

Measuring relationships among multiple responses

Data reduction for multivariate analysis

LEA: An R package for Landscape and Ecological Association Studies. Olivier Francois Ecole GENOMENV AgroParisTech, Paris, 2016

Diversity and composition of termites in Amazonia CSDambros 09 January, 2015

1 Interpretation. Contents. Biplots, revisited. Biplots, revisited 2. Biplots, revisited 1

Analysis of Multivariate Ecological Data

Overview of clustering analysis. Yuehua Cui

3. Shrink the vector you just created by removing the first element. One could also use the [] operators with a negative index to remove an element.

Using R in 200D Luke Sonnet

Transcription:

Practical course using the software Spatial genetics analyses using Thibaut Jombart Abstract This practical course illustrates some methodological aspects of spatial genetics. In the following we shall test and describe spatial genetic structures, and compare the results obtained by different methods. A nonexhaustive list of packages used includes: adegenet [8], ade4 [4, 6, 5], spdep, adehabitat [2, 1], and vegan [10]. 1

Contents 1 An overview of the data 4 2 Summarising the genetic diversity 6 3 Mapping and testing PCA results 12 4 Multivariate tests of spatial structure 17 5 spatial Principal Component Analysis 18 2

> library(ade4) > library(adegenet) > library(spdep) > library(adehabitat) 3

The chamois (Rupicapra rupicapra) is a conserved species in France. The Bauges mountains is a protected area in which the species has been recently studied. One of the most important questions for conservation purposes relates to whether individuals from this area form a single reproductive unit, or whether they are structured into sub-groups, and if so, what causes are likely to induce this structuring. While field observations are very scarce and do not allow to answer this question, genetic data can be used to tackle the issue, as departure from panmixia should result in genetic structuring. The dataset rupica contains 335 georeferenced genotypes of Chamois from the Bauges mountains for 9 microsatellite markers, which we propose to analyse in this exercise. 1 An overview of the data We first load the data: > data(rupica) > rupica ##################### ### Genind object ### ##################### - genotypes of individuals - S4 class: genind @call: NULL @tab: 335 x 55 matrix of genotypes @ind.names: vector of 335 individual names @loc.names: vector of 9 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the 55 columns of @tab @all.names: list of 9 components yielding allele names for each locus @ploidy: 2 @type: codom Optionnal contents: @pop: - empty - @pop.names: - empty - @other: a list containing: xy mnt showbauges rupica is a typical genind object, which is the class of objects storing genotypes (as opposed to population data) in adegenet. rupica also contains topographic information about the sampled area, which can be displayed by calling rupica$other$showbauges. For instance, the spatial distribution of the sampling can be displayed as follows: > rupica$other$showbauges() > points(rupica$other$xy, col = "red", pch = 20) 4

This spatial distribution is clearly not random, but seems arranged into loose clusters. However, superimposed samples can bias our visual assessment of the spatial clustering. Use a two-dimensional kernel density estimation (function s.kde2d) to overcome this possible issue. > rupica$other$showbauges() > s.kde2d(rupica$other$xy, add.plot = TRUE) > points(rupica$other$xy, col = "red", pch = 20) 5

Is geographical clustering strong enough to assign safely each individual to a group? Accordingly, shall we analyse these data at individual or group level? 2 Summarising the genetic diversity As a prior clustering of genotypes is not known, we cannot employ usual F ST - based approaches to detect genetic structuring. However, genetic structure could still result in a deficit of heterozygosity. Use the summary of genind objects to compare expected and observed heterozygosity: > rupica.smry <- summary(rupica) # Total number of genotypes: 335 # Population sample sizes: 335 # Number of alleles per locus: L1 L2 L3 L4 L5 L6 L7 L8 L9 7 10 7 6 5 5 6 4 5 # Number of alleles per population: 1 55 6

# Percentage of missing data: [1] 0 # Observed heterozygosity: L1 L2 L3 L4 L5 L6 L7 L8 0.5880597 0.6208955 0.5253731 0.7582090 0.6597015 0.5283582 0.6298507 0.5552239 L9 0.4149254 # Expected heterozygosity: L1 L2 L3 L4 L5 L6 L7 L8 0.6076769 0.6532517 0.5314591 0.7259657 0.6601604 0.5706082 0.6412742 0.5473112 L9 0.4070709 > plot(rupica.smry$hexp, rupica.smry$hobs, main = "Observed vs expected heterozygosity") > abline(0, 1, col = "red") Observed vs expected heterozygosity rupica.smry$hobs 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.40 0.45 0.50 0.55 0.60 0.65 0.70 rupica.smry$hexp The red line indicate identity between both quantities. What can we say about heterozygosity in this population? How can this be tested? The result below can be reproduced using a standard testing procedure: > t.test(rupica.smry$hexp, rupica.smry$hobs, paired = TRUE, var.equal = TRUE) Paired t-test data: rupica.smry$hexp and rupica.smry$hobs t = 0.9461, df = 8, p-value = 0.3718 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -0.01025068 0.02451318 7

sample estimates: mean of the differences 0.00713125 We can seek a global picture of the genetic diversity among genotypes using a Principal Component Analysis (PCA, [11, 7], dudi.pca in ade4 package). The analysis is performed on a table of standardised alleles frequencies, obtained by scalegen (use the binomial scaling option). Remember to disable the scaling option when performing the PCA. The function dudi.pca displays a barplot of eigenvalues and asks for a number of retained principal components: > rupica.x <- scalegen(rupica, method = "binom") > rupica.pca1 <- dudi.pca(rupica.x, cent = FALSE, scale = FALSE, + scannf = FALSE, nf = 2) > barplot(rupica.pca1$eig) 0.0 0.5 1.0 1.5 The output produced by dudi.pca is a dudi object. A dudi object contains various information; in the case of PCA, principal axes (loadings), principal components (synthetic variable), and eigenvalues are respectively stored in $c1, $li, and $eig slots. Here is the content of the PCA: > rupica.pca1 Duality diagramm class: pca dudi $call: dudi.pca(df = rupica.x, center = FALSE, scale = FALSE, scannf = FALSE, nf = 2) 8

$nf: 2 axis-components saved $rank: 45 eigen values: 1.561 1.34 1.168 1.097 1.071... vector length mode content 1 $cw 55 numeric column weights 2 $lw 335 numeric row weights 3 $eig 45 numeric eigen values data.frame nrow ncol content 1 $tab 335 55 modified array 2 $li 335 2 row coordinates 3 $l1 335 2 row normed scores 4 $co 55 2 column coordinates 5 $c1 55 2 column normed scores other elements: cent norm In general, eigenvalues represent the amount of genetic diversity as measured by the multivariate method being used represented by each principal component (PC). Verify that here, each eigenvalue is the variance of the corresponding PC. An abrupt decrease in eigenvalues is likely to indicate the boundary between true patterns and non-interpretable structures. In this case, how many PCs would you interprete? Use s.label to display to two first components of the analysis. Then, use a kernel density (s.kde2d) for a better assessment of the distribution of the genotypes onto the principal axes: > s.label(rupica.pca1$li) > s.kde2d(rupica.pca1$li, add.p = TRUE, cpoint = 0) > add.scatter.eig(rupica.pca1$eig, 2, 1, 2) 9

d = 5 2638 5576 2057 5899 70 6036 2183 6222 6223 7526 7668 2469 5904 83 2503 2672 6004 6021 5997 7178 2317 2053 2344 7207 7110 5919 2373 6165 170 164 169 1170 2372 5938 669 2347 2379 2320 2333 2698 5969 6087 6148 2577 6024 2628 6013 6216 7128 7222 7101 7516 7239 7566 6160b 2459 7173 5855 2626 2401 5915 2321 2355 2412 2374 2546 5948 6008 7077 6220 7141 5966 6142 5868 863 2340 2498 5896 2443 1474 1429 2000 545 599 734 2319 2514 2408 2542 2564 2569 2604 5980 6027 5995 5954 2682 6016 5994 6111 7188 6146 6150 6159 7090 6162 7189 7114 5856 5862 2332 2721 82 600 2695 2454 5924 6033 5922 664 2350 6023 5911 6037 6156 7104 7191 6168 6157 6153 2680 2360 5575 6184 6219 7161 7203 7474 7652 7438 7639 7197 7476 7456 7563 7641b 7666 7224 7477 7630 7636 7480 7101b 7484 7641 7206 2158 633 2562 2418 5853 2002 2051 162 556 2485 2615 2323 2198 2357 2596 2645 5579 5852 5583 5963 6001 6133 6014 6019 5866 5983 5895 6007 6031 6035 6147 6152 7230 7091 7179 7209 7143 6163 7094 6154 6155 7199 7244 7501 7380 7473 7500 7496 7514 7535 7643 7634 6000b 7642 7562 7503 7505 7567 7435 7480b 6161b 7570 6218 69 85 76 636 2309 2588 5988 6102 6149 7237 6166 6045 6100 7112 5961 6020 5991 2689 5912 5572 2406 2632 665 735 2353 2402 2581 2609 2590 5578 5972 5580 6113 7102 7100 7120 7174 6029 6224 7192 7241 7502 7483 7648 7659 7524 7644 7523 7193 7647 7379 7478 7443 7185 7234 7402 7469 5869 2614 5956 5951 7194 6217 6214 7175 7497 6132 7072 5971 2307 5864 2358 2329 2643 6034 6151 6030 7635 6161 7136 6071 7485 7561 2004 5584 5939 7382 7466 78 2508 6043 7176 7186 77 165 616 1171 7451 7477b 7667 5996 7137 86 7385 8 Eigenvalues What can we say about the genetic diversity among these genotypes as inferred by PCA? The function loadingplot allows to visualize the contribution of each allele, expressed as squared loadings, for a given principal component. Using this function, reproduce this figure: > loadingplot(rupica.pca1$c1^2) 10

Loading plot Loadings 0.00 0.05 0.10 0.15 0.20 0.25 Bm203.221 Eth225.136 Eth225.142 Eth225.146 Eth225.148 Bm4505.260 Eth225.151 Hel1.120 Bm4505.266 Bmc1009.230 Ilst030.161 Maf70.134 Ilst030.173 Maf70.139 Variables What do we observe? We can get back to the genotypes for the concerned markers (e.g., Bm203) to check whether the highlighted genotypes are uncommon. truenames extracts the table of allele frequencies from a genind object (restoring original labels for markers, alleles, and individuals): > X <- truenames(rupica) > class(x) [1] "matrix" > dim(x) [1] 335 55 > bm203.221 <- X[, "Bm203.221"] > table(bm203.221) bm203.221 0 0.00597014925373134 0.5 330 1 4 Only 4 genotypes possess one copy of the allele 221 of marker bm203 (the second result corresponds to a replaced missing data). Which individuals are they? 11

> rownames(x)[bm203.221 == 0.5] 001 019 029 276 "8" "86" "600" "7385" Conclusion? 3 Mapping and testing PCA results A frequent practice in spatial genetics is mapping the first principal components (PCs) onto the geographic space. The function s.value is well-suited to do so, using black and white squares of variable size for positive and negative values. To give a legend for this type of representation: > s.value(cbind(1:11, rep(1, 11)), -5:5, cleg = 0) > text(1:11, rep(1, 11), -5:5, col = "red", cex = 1.5) d = 2 5 4 3 2 1 0 1 2 3 4 5 Apply this graphical representation to the first two PCs of the PCA: > showbauges <- rupica$other$showbauges > showbauges() > s.value(rupica$other$xy, rupica.pca1$li[, 1], add.p = TRUE, cleg = 0.5) > title("pca - first PC", col.main = "yellow", line = -2, cex.main = 2) 12

> showbauges() > s.value(rupica$other$xy, rupica.pca1$li[, 2], add.p = TRUE, csize = 0.7) > title("pca - second PC", col.main = "yellow", line = -2, cex.main = 2) 13

What can we say about spatial genetic structure as inferred by PCA? This visual assessment can be complemented by testing the spatial autocorrelation in the first PCs of PCA. This can be achieved using Moran s I test. Use the function moran.mc in the package spdep to perform these tests. You will need first to define the spatial connectivity between the sampled individuals. For these data, spatial connectivity is best defined as the overlap between home ranges of individuals. Home ranges will be modelled as disks with a radius of 1150m. Use choosecn to create a connection network based on distance range ( neighbourhood by distance ). What threshold distance do you choose for individuals to be considered as neighbours? > rupica.graph <- choosecn(rupica$other$xy, type = 5, d1 = 0, d2 = 2300, + plot = FALSE, res = "listw") The connection network should ressemble this: > rupica.graph Characteristics of weights list object: Neighbour list object: Number of regions: 335 Number of nonzero links: 18018 Percentage nonzero weights: 16.05525 Average number of links: 53.78507 Weights style: W Weights constants summary: 14

n nn S0 S1 S2 W 335 112225 335 15.04311 1352.07 > plot(rupica.graph, rupica$other$xy) > title("rupica.graph") Perform Moran s test for the first two PCs, and plot the results. The first test should be significant: > pc1.mctest <- moran.mc(rupica.pca1$li[, 1], rupica.graph, 999) > plot(pc1.mctest) 15

Density plot of permutation outcomes Density 0 10 20 30 40 50 0.02 0.00 0.02 0.04 0.06 rupica.pca1$li[, 1] Monte Carlo simulation of Moran's I Compare this result to the mapping of the first PC of PCA. What is wrong? When a test gives unexpected results, it is worth looking into the data in more details. Moran s plot (moran.plot) plots the tested variable against its lagged vector. Use it on the first PC: > moran.plot(rupica.pca1$li[, 1], rupica.graph) 21 23 225 20 spatially lagged rupica.pca1$li[, 1] 0.0 0.5 1.0 1.5 24 43 3 151617 12 5 6 9 4 274 275 7 10 2732 11 29 19 276 1 0 5 10 15 rupica.pca1$li[, 1] 16

Actual positive autocorrelation corresponds to a positive correlation between a variable and its lag vector. Is it the case here? How can we explain that Moran s test was significant? Repeat these analyses for the second PC. What are your conclusions? > pc2.mctest <- moran.mc(rupica.pca1$li[, 2], rupica.graph, 999) > plot(pc2.mctest) Density plot of permutation outcomes Density 0 10 20 30 0.02 0.00 0.02 0.04 rupica.pca1$li[, 2] Monte Carlo simulation of Moran's I 4 Multivariate tests of spatial structure So far, we have only tested the existence of spatial structures in the first two principal components of a PCA of the data. Therefore, these tests only describe one fragment of the data, and do not encompass the whole diversity in the data. As a complement, we can use Mantel test (mantel.randtest) to test spatial structures in the whole data, by assessing the correlation between genetic distances and geographic distances. Pairwise Euclidean distances are computed using dist. Perform Mantel test, using the scaled genetic data you used before in PCA, and the geographic coordinates. > mtest <- mantel.randtest(dist(rupica.x), dist(rupica$other$xy)) > plot(mtest, nclass = 30) 17

Histogram of sim Frequency 0 10 20 30 40 50 60 70 0.10 0.05 0.00 0.05 0.10 sim What is your conclusion? Shall we be looking for spatial structures? If so, how can we explain that PCA did not reveal them? Does the Mantel correlogram (mantel.correlog in vegan package) bring any help solving the problem? 5 spatial Principal Component Analysis The spatial Principal Component Analysis (spca, function spca [9]) has been especially developed to investigate hidden or non-obvious spatial genetic patterns. Like Moran s I test, spca first requires the spatial proximities between genotypes to be modeled. You will reuse the connection network defined previously using choosecn, and pass it as the cn argument of the function spca. Read the documentation of spca, and apply the function to the dataset rupica. The function will display a barplot of eigenvalues: > rupica.spca1 <- spca(rupica, cn = rupica.graph, scannf = FALSE, + nfposi = 2, nfnega = 0) > barplot(rupica.spca1$eig, col = rep(c("red", "grey"), c(2, 1000))) 18

0.005 0.005 0.015 0.025 This figure illustrates the fundamental difference between PCA and spca. Like dudi.pca, spca displays a barplot of eigenvalues, but unlike in PCA, eigenvalues of spca can also be negative. This is because the criterion optimized by the analysis can have positive and negative values, corresponding respectively to positive and negative autocorrelation. Positive spatial autocorrelation correspond to greater genetic similarity between geographically closer individuals. Conversely, negative spatial autocorrelation corresponds to greater dissimilarity between neighbours. The spatial autocorrelation of a variable is measured by Moran s I, and interpreted as follows: I 0 = 1/(n 1): no spatial autocorrelation (x is randomly distributed across space) I > I 0 : positive spatial autocorrelation I < I 0 : negative spatial autocorrelation Principal components of PCA ensure that (φ referring to one PC) var(φ) is maximum. By contrast, spca provides PC which decompose the quantity var(φ)i(φ). In other words, PCA focuses on variability only, while spca is a compromise between variability (var(φ)) and spatial structure (I(φ)). In this case, only the principal components associated with the two first positive eigenvalues (in red) shall be retained. The printing of spca objects is more explicit than dudi objects, but named with the same conventions: > rupica.spca1 19

######################################## # spatial Principal Component Analysis # ######################################## class: spca $call: spca(obj = rupica, cn = rupica.graph, scannf = FALSE, nfposi = 2, nfnega = 0) $nfposi: 2 axis-components saved $nfnega: 0 axis-components saved Positive eigenvalues: 0.03018 0.01408 0.009211 0.006835 0.004529... Negative eigenvalues: -0.008611-0.006414-0.004451-0.003963-0.003329... vector length mode content 1 $eig 45 numeric eigenvalues data.frame nrow ncol content 1 $c1 55 2 principal axes: scaled vectors of alleles loadings 2 $li 335 2 principal components: coordinates of entities ('scores') 3 $ls 335 2 lag vector of principal components 4 $as 2 2 pca axes onto spca axes $xy: matrix of spatial coordinates $lw: a list of spatial weights (class 'listw') other elements: NULL Unlike usual multivariate analyses, eigenvalues of spca are composite: they measure both the genetic diversity (variance) and the spatial structure (spatial autocorrelation measured by Moran s I). This decomposition can also be used to choose which principal component to interprete. The function screeplot allows to display this information graphically: > screeplot(rupica.spca1) 20

Spatial and variance components of the eigenvalues 1 Spatial autocorrelation (I) 0.7 0.3 0 λ 1 λ 2 λ λ 4 λ λ 3 8λ λ 6 5 9 7 λ 12 11 20 10 21 23 22 24 25 26 λ 27 28 λ λ 30 29 34 32 31 33 λ 36 39 λ 38 35 λ 37 λ 40 41 λ 42 λ 43 λ 44 λ 45 λ 16 17 14 15 19 18 13 0.4 0.00 0.05 0.10 0.15 0.20 0.25 Variance While λ 1 indicates with no doubt a structure, the second eigenvalue, λ 2 is less clearly distinct from the successive values. Thus, we shall keep in mind this uncertainty when interpreting the second principal component of the analysis. Try visualising the spca results as you did before with the PCA results. To clarify the possible spatial patterns, you can map the lagged PC ($ls) instead of the PC ($li), which are a denoisified version of the PCs. First, map the first principal component of spca. How would you interprete this result? How does it compare to the first PC of PCA? What inferrence can we make about the way the landscape influences gene flow in this population of Chamois? Do the same with the second PC of spca. Some field observations suggest that this pattern is not artefactual. How would you interprete this second structure? To finish, you can try representing both structures at the same time using the color coding introduced by [3] (?colorplot). The final figure should ressemble this (although colors may change from one computer to another): > showbauges() > colorplot(rupica$other$xy, rupica.spca1$ls, axes = 1:2, transp = TRUE, + add = TRUE, cex = 2) 21

> title("spca - colorplot of PC 1 and 2\n(lagged scores)", col.main = "yellow", + line = -2, cex = 2) 22

References [1] C. Calenge. Exploring habitat selection by wildlife with adehabitat. Journal of statistical software, 22(6):1 19, 2007. [2] C. Callenge. The package adehabitat for the r software: a tool for the analysis of space and habitat use by animals. Ecological Modelling, 197:516 519, 2006. [3] L. L. Cavalli-Sforza, P. Menozzi, and A. Piazza. Demic expansions and human evolution. Science, 259:639 646, 1993. [4] D. Chessel, A-B. Dufour, and J. Thioulouse. The ade4 package-i- onetable methods. R News, 4:5 10, 2004. [5] S. Dray and A.-B. Dufour. The ade4 package: implementing the duality diagram for ecologists. Journal of Statistical Software, 22(4):1 20, 2007. [6] S. Dray, A.-B. Dufour, and D. Chessel. The ade4 package - II: Twotable and K-table methods. R News, 7:47 54, 2007. [7] I. T. Joliffe. Principal Component Analysis. Springer Series in Statistics. Springer, second edition, 2004. [8] T. Jombart. adegenet: a R package for the multivariate analysis of genetic markers. Bioinformatics, 24:1403 1405, 2008. [9] T. Jombart, S. Devillard, A.-B. Dufour, and D. Pontier. Revealing cryptic spatial patterns in genetic variability by a new multivariate method. Heredity, 101:92 103, 2008. [10] Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, R. B. O Hara, Gavin L. Simpson, Peter Solymos, M. Henry H. Stevens, and Helene Wagner. vegan: Community Ecology Package, 2010. R package version 1.17-4. [11] K. Pearson. On lines and planes of closest fit to systems of points in space. Philosophical Magazine, 2:559 572, 1901. 23