## Introduction

Landscapes are being transformed at an unusual rate, so that populations become more and more fragmented. Metapopulation theory has described the risks of population decline and the possibility of extinction thresholds, namely values of habitat destruction at which metapopulations become extinct despite some habitat being still available (Lande 1987; Bascompte & Solé 1996; Hanski 1998). Similarly, the emerging field of landscape genetics has described how isolation by distance and other spatially related processes shape the genetic structure of wild populations across landscapes (Manel *et al*. 2003; McRae & Beier 2007; Storfer *et al*. 2007). Global change is expected to further alter the spatial distribution of genetic variability shown by populations inhabiting such fragmented landscapes. Assessing the rate and shape of this erosion of genetic variability is important in characterising the effects of global change on the raw material of adaptation.

In this study, we combine: (1) recent statistical methods describing how genetic variability is distributed among spatial sites, (2) network approaches to characterise the architecture of these genetic networks and (3) computer simulations addressing the effects of the sequential loss of sites.

The starting point in our perspective is the concept of population graphs (Dyer & Nason 2004). A population graph describes the network of genetic variation among spatial sites that contains the smallest link set that sufficiently describes the patterns of genetic covariance (Dyer & Nason 2004, see Box 1). This is different from traditional genetic approaches such as or AMOVAs that are based on a pairwise analysis of effects, thus precluding the characterisation of the simultaneous influence of all sites. Although population graphs are certainly related to previous approaches, there are subtle but important distinctions. For example, while traditional AMOVA assesses whether there is significant genetic variation, population graphs map how such a variation is distributed in space (Dyer 2007). More importantly, a network approach benefits from the tool kit of already developed analytical techniques (Urban & Keitt 2001; Dyer 2007; Rozenfeld *et al*. 2008; Bascompte 2009; Fortuna *et al*. 2009; Dale & Fortin 2010). Our second step is to use one of these new tools, modularity analysis, to characterise the architecture of the resulting networks of spatial genetic variation.

### Box 1. Population Graphs

Dyer & Nason (2004) developed a network approach to study the spatial distribution of genetic variation (the so-called population graphs). The rationale for their approach is the need to move beyond the usual averaging summary statistics – as is commonly done in landscape genetics – to embrace the simultaneous effects across all sites. The main steps for calculating the network of spatial genetic variation are: (1) calculating the genetic distance between sites by translating multilocus genotypes of individuals to multivariate codification vectors and (2) estimating the conditional independence structure of the genetic covariance.

The basis of the approach of population graphs is information on spatial genetic variability. This is measured as the tendency of individual genotypes in a site to vary from each other. Each node represents a spatial site with information on the genetic variance of the individuals at this site in relation to the total variance. The procedure starts with a fully connected network in which all sites are linked to each other by their genetic similarity, which determines link strength. Thus, the squared genetic distance between two sites *i* and *j* can be written as (Fortuna *et al*. 2009):

where is the element of the vector of the average genotype in site *i* containing the value of allele *k* (Smouse & Peakal 1999); *K* is the number of alleles; and are the allelic frequencies across sites.

The next step consists of the pruning of the above fully connected network by removing all links connecting sites whose genetic similarity is mediated by their genetic similarity with common sites. This procedure leads to a network of genetic variation containing the smallest link set that sufficiently explains the genetic covariance structure among sites. In that context, two sites will be linked if they have a significant genetic covariance after removing the covariation that each of them has with the remaining sites. To decide whether a link between sites *i* and *j* should be removed, one uses the following statistic (Whittaker 2004):

where *N* is the number of individuals in the entire data set, and is the partial correlation coefficient between sites *i* and *j*. This statistic asymptotically follows a chi-square distribution. See Dyer & Nason (2004) for details, and Fortuna *et al*. (2009) for a working example through all the steps.

The concept of modularity has a long tradition in the analysis of complex networks, both in physics and sociology (Newman & Girvan 2004; Guimerà & Amaral 2005; Danon *et al*. 2006; Fortunato 2010). Modularity measures the tendency of a network to be organised in modules or compartments, where nodes within a module interact frequently among themselves, but show little interaction with nodes from other modules (see Box 2).

### Box 2. Modularity

A network is said to be modular if it tends to be arranged in groups of nodes that interact frequently among themselves, but show few interactions with nodes from other modules.

The analysis of modularity has constituted a bourgeoning field of research in the study of complex networks, with important contributions from physics and sociology. There are different methods to detect modules in complex networks, and the interested reader should refer to the thoughtful reviews by Danon *et al*. (2006) and Fortunato (2010).

Modularity is defined as follows (Newman & Girvan 2004):

For the specific case of one-mode, undirected networks as the spatial networks here described, the previous expression can be written as (Newman & Girvan 2004):

where is the number of edges within module *i*, () is the degree of node *m* (*n*) and is the sum of the degrees of all nodes in module *i*.

Once the expression of modularity has been defined, a second challenge is to implement it in a complex network. Unfortunately, there is no exact way to do so, and one has to use some heuristic numerical approach. The idea is to try different partitions of the network in modules, to measure its modularity, and to compare it with other partitions so one ends up with the partition that maximises the previous equation. As the size of the network increases, the number of combinations become impractical to be analysed systematically. Therefore, one needs a shortcut provided by an algorithmic approach. One very successful example is simulated annealing (Guimerà & Amaral 2005). This algorithm finds a modular structure by maximising the number of links between sites within the same module and minimising the links between sites located in different modules. This procedure is time consuming, but can handle well networks of the size of the standard ecological systems (Danon *et al*. 2006).

Once a significant partition of the network into modules has been found, modularity analysis also classifies each node in terms of its role in the overall topology (Guimerà & Amaral 2005). Specifically, the importance of a node can be defined in terms of two quantities: within-module degree and participation coefficient. The former indicates how important a node is within its module in terms of its number of interactions with other nodes in that same module. The latter indicates how homogeneously distributed are a node's links are across nodes from multiple modules. The nodes with the highest participation coefficient are assumed to be very important in attaching the different modules. All this information provides from a static view, a single snapshot of the network without temporal information.

The search for modularity in food webs has been an active area in ecology because of the potential implications for network persistence (May 1972; Pimm & Lawton 1980). There have been two main research directions. On one hand, ecologists have tried to find evidence for modularity in real ecological networks (Pimm & Lawton 1980; Raffaelli & Hall 1992; Melián & Bascompte 2004; Olesen *et al*. 2007; Guimerà *et al*. 2010). On the other hand, researchers have explored the dynamical implications of modularity. Stouffer & Bascompte (2011) have found that modularity increases the persistence of realistic models of food webs because it buffers the propagation of perturbations such as the extinction of a species.

More recently, modularity analysis has been applied to genetic networks both at local as well as regional scales (Fortuna *et al*. 2008, 2009). The rationale for focusing on modularity is twofold. First, as stated above, modularity is clearly linked with the persistence of the network. Second, the resulting modules can be interpreted as a bottom-up classification of populations and therefore determine the relevant spatial scale. Indeed, nodes within a module are genetically much more similar than they are with nodes belonging to other modules and can therefore constitute elements of the same genetic class.

In this study, we advocate the approach of networks of spatial genetic variation in the context of global change. One preliminary step is quantifying the robustness of these networks by comparing changes in their modular structure across a gradient of habitat alteration. Here, we do so as follows. First, we perform node-removal experiments, an approach previously used to assess robustness of food webs (Solé & Montoya 2001; Dunne *et al*. 2002), mutualistic networks (Memmott *et al*. 2004; Burgos *et al*. 2007; Rezende *et al*. 2007) and dispersal networks (Urban & Keitt 2001). Second, we apply a recently developed method to quantify the changes in modularity through consecutive node removals (Methods). This combined approach can inform us on the rate and shape of network collapse. In the particular context of the networks of spatial genetic variation, it can provide insight, for example, on how the number of populations – and the underlying mapping of the genetic variation – will change as some local sites are being lost. Also, these simulations can be used to rank spatial sites in terms of the magnitude of the changes to the overall network following their disappearance.

We apply the above framework to genetic data of the Betic Midwife toad *Alytes dickhilleni* in the Sierra de Cazorla, Segura y las Villas, a mountain region in south-eastern Spain (Fig. 1). Amphibians are a good case study of spatial genetic networks. First, they are among the most endangered vertebrates on Earth (Stuart *et al*. 2004), showing a high sensitivity to global change (Pounds *et al*. 2006). Second, their patchy habitats are very amenable to be described as a network of ponds (Fortuna *et al*. 2006; Campbell Grant *et al*. 2010). As a consequence, the number of articles on landscape genetics using amphibians has steadily increased in the last few years (Arens *et al*. 2007; Giordano *et al*. 2007; Purrenhage *et al*. 2009; Steele *et al*. 2009; Murphy *et al*. 2010).

We illustrate the range of potential gradients of habitat alteration of the above spatial network following two contrasting scenarios. The first scenario would reflect the prevailing idea that extinction probability increases as one moves from lowlands to mountain tops – although the real pattern can be more complex than that (Pounds *et al*. 2006). This would be a surrogate of the expected extinction gradient due to the impact of the pathogenetic chytrid fungus (*Batrachochytrium dendrobatidis*), which has been reported to be most virulent at high elevations (Pounds *et al*. 2006) or because of negative effects of ultraviolet radiation (Lizana & Pedraza 1998). The second scenario would be the inverse, reflecting a situation where the probability of extinction would increase from mountain tops to lowlands, as for example in the case of drought.