Compiling the GSL Library for OSX

Compiling the GSL Library for OSX

I’ve been working on integrating the Swift language into my analysis workflow but much of what I do involves the GNU Scientific Libraries for matrix analysis and other tools.  Here is a quick tutorial on how to install the GSL library on a clean OSX platform.

  1. It is easiest if you have XCode installed.  You can get this from the App Store for free.  Go download it and install it.
  2. Download the latest version of the GSL libraries.  You can grab them by:
    1. Looking for your nearest mirror site listed at http://www.gnu.org/prep/ftp.html and connecting to it.
    2. Open the directory gsl/ where all the versions will be listed.  Scroll down and grab gsl-latest.tar.gz.
  3. Open the terminal (Utilities -> Terminal.app) and type:  cd ~/Downloads
  4. Unpack the archive by:  tar zxvf gsl-latest.tar.gz then cd gsl-1.16/ (or whatever the version actually was, it will probably be some number larger than 1.16).
  5. Inside that folder will be a README file (which you probably won’t read) and an INSTALL file (which you should read).  In that folder it will tell you to:  ./configure then  make then sudo make install. This last command will require you to type in your password as it is going to install something into the base system.
  6. All the libraries and header files will be installed into the /usr/local/ directory.
Dyer RJ. 2015  Is there such a thing as landscape genetics?  Molecular Ecology.

Dyer RJ. 2015 Is there such a thing as landscape genetics? Molecular Ecology.

For a scientific discipline to be interdisciplinary it must satisfy two conditions; it must consist of contributions from at least two existing disciplines and it must be able to provide insights, through this interaction, that neither progenitor discipline could address. In this paper, I examine the complete body of peer-reviewed literature self-identified as landscape genetics using the statistical approaches of text mining and natural language processing. The goal here is to quantify the kinds of questions being addressed in landscape genetic studies, the ways in which questions are evaluated mechanistically, and how they are differentiated from the progenitor disciplines of landscape ecology and population genetics. I then circumscribe the main factions within published landscape genetic papers examining the extent to which emergent questions are being addressed and highlighting a deep bifurcation between existing individual- and population-based approaches. I close by providing some suggestions on where theoretical and analytical work is needed if landscape genetics is to serve as a real bridge connecting evolution and ecology sensu lato.

DOI http://dx.doi.org/10.1111/mec.13249

GStudio: An R Package for Spatial Analysis of Marker Data

This is the main package that provides data types and routines for spatial analysis of genetic marker data. The previous version is currently available on CRAN and you can install it rom within your R environtment by invoking the command

install.packages("gstudio")

If you want to keep up with the latest developments of this package, you can use the version found on GitHub.  Install it from within R as:

require(devtools)
install_github("dyerlab/gstudio")

and that should get you up-to-date.  You’ll need to have a fully working LaTeX install and some other stuff to build it if you fork.

The Users Manual for the package with several examples can be found here

I have started a github account for this package, you can get access to the whole codebase read about it on the wiki, and contribute to the project from its repo at https://github.com/dyerlab.

Baker SA, Dyer RJ. 2011. Invasion genetics of Microstegium vimineum (Poaceae) within the James River Basin of Virginia, USA. Conservation Genetics, 12 793-803.

Baker SA, Dyer RJ. 2011. Invasion genetics of Microstegium vimineum (Poaceae) within the James River Basin of Virginia, USA. Conservation Genetics, 12 793-803.

Patterns of spatial genetic structure produced following the expansion of an invasive species into novel habitats reflect demographic processes that have shaped the genetic structure we see today. We examined 359 individuals from 23 populations over 370 km within the James River Basin of Virginia, USA as well as four populations outside of the basin. Population diversity levels and genetic structure was quantified using several analyses. Within the James River Basin there was evidence for three separate introductions and a zone of secondary contact between two distinct lineages suggesting a relatively recent expansion within the basin. Microstegium vimineum possesses a mixed-mating system advantageous to invasion and populations with low diversity were found suggesting a recent founder event and self-fertilization. However, surprisingly high levels of diversity were found in some populations suggesting that out-crossing does occur. Understanding how invasive species spread and the genetic consequences following expansion may provide insights into the cause of invasiveness and can ultimately lead to better management strategies for control and eradication.

DOI: 10.1007/s10592-011-0186-0

Dyer RJ, Nason JD, Garrick RC. 2010. Landscape modeling of gene flow: improved power using conditional genetic distance derived from the topology of population networks. Molecular Ecology, 19 3746-3759.

Dyer RJ, Nason JD, Garrick RC. 2010. Landscape modeling of gene flow: improved power using conditional genetic distance derived from the topology of population networks. Molecular Ecology, 19 3746-3759.

Landscape genetics is a burgeoning field of interest that focuses on how site-specific factors influence the distribution of genetic variation and the genetic connectivity of individuals and populations. In this manuscript, we focus on two methodological extensions for landscape genetic analyses: the use of conditional genetic distance (cGD) derived from population networks and the utility of extracting potentially confounding effects caused by correlations between phylogeographic history and contemporary ecological factors. Individual-based simulations show that when describing the spatial distribution of genetic variation, cGD consistently outperforms the traditional genetic distance measure of linearized FST under both 1- and 2-dimensional stepping stone models and Cavalli-Sforza and Edward’s chord distance Dc in 1-dimensional landscapes. To show how to identify and extract the effects of phylogeographic history prior to embarking on landscape genetic analyses, we use nuclear genotypic data from the Sonoran desert succulent Euphorbia lomelii (Euphrobiaceae), for which a detailed phylogeographic history has previously been determined. For E. lomelii, removing the effect of phylogeographic history significantly influences our ability to infer both the identity and the relative importance of spatial and bio-climatic variables in subsequent landscape genetic analyses. We close by discussing the utility of cGD in landscape genetic analyses.

DOI: 10.1111/j.1365-294X.2010.04748.x

Garrick RC, Nason JD, Meadows CA, Dyer RJ. 2009. Not just vicariance: phylogeography of a Sonoran Desert euphorb indicates a major role of range expansion along the Baja peninsula. Molecular Ecology, 18 1916-1931.

Garrick RC, Nason JD, Meadows CA, Dyer RJ. 2009. Not just vicariance: phylogeography of a Sonoran Desert euphorb indicates a major role of range expansion along the Baja peninsula. Molecular Ecology, 18 1916-1931.

To examine the generality of population-level impacts of ancient vicariance identified for numerous arid-adapted animal taxa along the Baja peninsula, we tested phylogeographical hypotheses in a similarly distributed desert plant, Euphorbia lomelii (Euphorbiaceae). In light of fossil data indicating marked changes in the distributions of Baja floristic assemblages throughout the Holocene and earlier, we also examined evidence for range expansion over more recent temporal scales. Two classes of complementary analytical approaches — hypothesis-testing and hypothesis-generating — were used to exploit phylogeographical signal from chloroplast DNA sequence data and genotypic data from six codominant nuclear intron markers. Sequence data are consistent with a scenario of mid-peninsular vicariance originating c. 1 million years ago (Ma). Alternative vicariance scenarios representing earlier splitting events inferred for some animals (e.g. Isthmus of La Paz inundation, c. 3 Ma; Sea of Cortez formation, c. 5 Ma) were rejected. Nested clade phylo- geographical analysis corroborated coalescent simulation-based inferences. Nuclear markers broadened the temporal spectrum over which phylogeographical scenarios could be addressed, and provided strong evidence for recent range expansions along the north– south axis of the Baja peninsula. In contrast to previous plant studies in this region, however, the expansions do not appear to have been in a strictly northward direction. These findings contribute to a growing appreciation of the complexity of organismal responses to past climatic and geological changes — even when taxa have evolved in the same landscape context.

DOI: 10.1111/j.1365-294X.2009.04148.x

Dyer RJ. 2007. Powers of discerning: challenges to understanding dispersal processes in natural populations. Molecular Ecology,16, 4881-4882.

Dyer RJ. 2007. Powers of discerning: challenges to understanding dispersal processes in natural populations. Molecular Ecology,16, 4881-4882.

In this issue of Molecular Ecology, authors Robledo-Arnuncio & Garcia present a compelling approach for quantifying seed dispersal in plant populations. Building upon methods previously used for quantification of pollen dispersal, the authors not only examine the behavior of the model with respect to sample sizes, dispersal distance, and the kurtosis of the dispersal function but also provide an empirical example using Prunus mahaleb.

DOI: 10.1111/j.1365-294X.2007.03581.x

Dyer RJ. 2007. The evolution of genetic topologies. Theoretical Population Biology, 71 71-79.

Dyer RJ. 2007. The evolution of genetic topologies. Theoretical Population Biology, 71 71-79.

This manuscript explores the simultaneous evolution of population genetic parameters and topological features within a population graph through a series of Monte Carlo simulations. I show that node centrality and graph breadth are significantly correlated to population genetic parameters FST and M (ρ = -0.95; ρ -0.98, respectively), which are commonly used in quantifying among population genetic structure and isolation by distance. Next, the topological consequences of migration patterns are examined by contrasting N-island and stepping stone models of gene movement. Finally, I show how variation in migration rate influences the rate of formation of specific topological features with particular emphasis to the phase transition that occurs when populations begin to become fixed due to restricted movement of genes among populations. I close by discussing the utility of this method for the analysis of intra-specific genetic variation.

DOI: 10.1016/j.tpb.2006.07.001

Gonzales E, Hamrick JL, Smouse PE, Dyer RJ. 2006. Pollen-mediated gene dispersal within continuous and fragmented populations of a forest understory species, Trillium cuneatum. Molecular Ecology, 15 2047-2058.

Pollen movement plays a critical role in the distribution of genetic variation within and among plant populations. Direct measures of pollen movement in the large, continuous populations that characterize many herbaceous plant species are often technically difficult and biologically unreliable. Here, we studied contemporary pollen movement in four large populations of Trillium cuneatum. Three populations, located in the Georgia Piedmont, are exposed to strong anthropogenic disturbances, while the fourth population, located in the Southern Appalachian Mountains, is relatively undisturbed. Using the recently developed TwoGener analysis, we extracted estimates of the effective number of pollen donors (Nep), effective mating neighbourhood size (Aep) and the average distance of pollen movement (δ) for each population. We extended the TwoGener method by developing inference on the paternal gametic contribution to the embryo in situations where offspring genotypes are inferred from seeds and elaiosomes of species with bisporic megagametogenesis. Our estimates indicate that maternal plants do not sample pollen randomly from a global pool; rather, pollen movement in all four populations is highly restricted. Although the effective number of pollen donors per maternal plant is low (Nep = 1.22–1.66) and pollen movement is highly localized in all populations, Nep in the disturbed Piedmont populations is higher and there is more pollen movement than in the mountains. The distance pollen moves is greater in disturbed sites and fragmented populations, possibly due to edge effects in Trillium habitats.

DOI: 10.1111/j.1365-294X.2006.02913.x

Sork VL, Smouse PE, Apsit VJ, Dyer RJ, Westfall RD. 2005. A two-generation analysis of pollen pool genetic structure in flowering dogwood, Cornus florida (Cornaceae), in the Missouri Ozarks. American Journal of Botany, 92 262-271.

Anthropogenic landscape change can disrupt gene flow. As part of the Missouri Ozark Forest Ecosystem Project, this study examined whether silvicultural practices influence pollen-mediated gene movement in the insect-pollinated species, Cornus florida L., by comparing pollen pool structure (Φst) among clear-cutting, selective cutting, and uncut regimes with the expectation that pollen movement should be least in the uncut regime. Using a sample of 1500 seedlings—10 each from 150 seed parents (43 in clear-cut, 74 in selective, and 33 in control sites) from six sites (each ranging from 266 to 527 ha), eight allozyme loci were analyzed with a pollen pool structure approach known as TWOGENER (Smouse et al., 2001; Evolution 55: 260–271). This analysis revealed that pollen pool structure was less in clear-cut (&PhiC = 0.090, P < 0.001) than in uncut areas (ΦU = 0.174, P < 0.001), with selective-cut intermediate (ΦS = 0.125, P < 0.001). These estimates translate into more effective pollen donors (Nep) in clear-cut (Nep = 5.56) and selective-cut (Nep = 4.00) areas than in uncut areas (Nep = 2.87). We demonstrate that &PhiC ≤ ΦS ≤ ΦU, with ΦC significantly smaller than ΦU (P < 0.034). The findings imply that, as long as a sufficiently large number of seed parents remain to provide adequate reproduction and to avoid a genetic bottleneck in the effective number of mothers, silvicultural management may not negatively affect the effective number of pollen parents, and hence subsequent genetic diversity in Cornus florida.

DOI: 10.3732/ajb.92.2.262.

Dyer RJ, Nason JD. 2004. Population Graphs: the graph theoretic shape of genetic structure. Molecular Ecology, 13 1713-1727.

Dyer RJ, Nason JD. 2004. Population Graphs: the graph theoretic shape of genetic structure. Molecular Ecology, 13 1713-1727.

Patterns of intraspecific genetic variation result from interactions among both historical and contemporary evolutionary processes. Traditionally, population geneticists have used methods such as F-statistics, pairwise isolation by distance models, spatial autocorrelation and coalescent models to analyses this variation and to gain insight about causal evolutionary processes. Here we introduce a novel approach (Population Graphs) that focuses on the analysis of marker-based population genetic data within a graph theoretic framework. This method can be used to estimate traditional population genetic summary statistics, but its primary focus is on characterizing the complex topology resulting from historical and con- temporary genetic interactions among populations. We introduce the application of Population Graphs by examining the range-wide population genetic structure of a Sonoran Desert cactus (Lophocereus schottii). With this data set, we evaluate hypotheses regarding historical vicariance, isolation by distance, population-level assignment and the importance of specific populations to species-wide genetic connectivity. We close by discussing the applicability of Population Graphs for addressing a wide range of population genetic and phylogeographical problems.

DOI:  10.1111/j.1365-294X.2004.02177.x

Dyer RJ, Westfall RD, Sork VL, Smouse PE. 2004. Two-generation analysis of pollen flow across a landscape V: a stepwise approach for extracting factors contributing to pollen structure. Heredity, 92 204-211.

Dyer RJ, Westfall RD, Sork VL, Smouse PE. 2004. Two-generation analysis of pollen flow across a landscape V: a stepwise approach for extracting factors contributing to pollen structure. Heredity, 92 204-211.

Patterns of pollen dispersal are central to both the ecology and evolution of plant populations. However, the mechan- isms controlling either the dispersal process itself or our estimation of that process may be influenced by site-specific factors such as local forest structure and nonuniform adult genetic structure. Here, we present an extension of the AMOVA model applied to the recently developed TWOGENER analysis of pollen pool structure. This model, dubbed the Stepwise AMOVA (StAMOVA), focuses on determining to what extent ecological, demographic, and/or environmental factors influence the observed genetic variation in spatially separated pollen pools. The analysis is verified for efficacy, using an extensive battery of simulations, illustrating: (1) how nonuniform adult genetic structure influences the differentiation of spatially separated pollen pools, and (2) how effectively the Stepwise analysis performs in carrying out the appropriate corrections. Finally, the model is applied to a Quercus alba data set, from which we have prior evidence that the adult genetic structure is nonuniformly distributed across the sampling landscape. From this data set, we show how the Stepwise model can be applied to remove the effects of spatial adult genetic structure on pollen pool differentiation and contrast these results with those derived from the original TWOGENER analysis.

DOI: 10.1038/sj.hdy.6800397

Sork VL, Davis FW, Smouse PE, Apsit VJ, Dyer RJ, Fernandez-M JF, Kuhn B. 2002. Pollen movement in declining populations of California Valley oak, Quercus lobata: where have all the fathers gone? Molecular Ecology, 11 1657-1668.

Sork VL, Davis FW, Smouse PE, Apsit VJ, Dyer RJ, Fernandez-M JF, Kuhn B. 2002. Pollen movement in declining populations of California Valley oak, Quercus lobata: where have all the fathers gone? Molecular Ecology, 11 1657-1668.

The fragmented populations and reduced population densities that result from human disturbance are issues of growing importance in evolutionary and conservation biology. A key issue is whether remnant individuals become reproductively isolated. California Valley oak (Quercus lobata) is a widely distributed, endemic species in California, increasingly jeopardized by anthropogenic changes in biota and land use. We studied pollen movement in a savannah population of Valley oak at Sedgwick Reserve, Santa Barbara County, to estimate effective number of pollen donors (Nep) and average distance of effective pollen movement (δ). Using TWOGENER, our recently developed hybrid model of paternity and genetic structure treatments that analyses maternal and progeny multilocus genotypes, we found that current Nep = 3.68 individuals. Based on an average adult density of d = 1.19 stems/ha, we assumed a bivariate normal distribution to model current average pollen dispersal distance (δ) and estimated δ = 64.8 m. We then deployed our parameter estimates in spatially explicit models of the Sedgwick population to evaluate the extent to which Nep may have changed, as a consequence of progressive stand thinning between 1944 and 1999. Assuming that pollen dispersal distance has not changed, we estimate Nep was 4.57 individuals in 1944, when stand density was 1.48. Both estimates indicate fewer effective fathers than one might expect for wind-pollinated species and fewer than observed elsewhere. The results presented here provide a basis for further refinements on modelling pollen movement. If the trends continue, then ongoing demographic attrition could further reduce neighbourhood size in Valley oak resulting in increased risk of reproductive failure and genetic isolation.

DOI: 10.1046/j.1365-294X.2002.01574.x

Sork VL, Davis FW, Dyer RJ, Smouse PE. 2002. Mating patterns in a savanna population of Valley Oak (Quercus lobata Nee). USDA Forest SErvice Gen. Tech. Rep, PSW-GTR-184 427-439.

Sork VL, Davis FW, Dyer RJ, Smouse PE. 2002. Mating patterns in a savanna population of Valley Oak (Quercus lobata Nee). USDA Forest SErvice Gen. Tech. Rep, PSW-GTR-184 427-439.

California valley oak is threatened by landscape alteration and failing recruitment in remnant stands. Its reproductive ecology is a key element of the seedling recruitment process. We first examine the mating system, to determine the extent of inbreeding in a population at Sedgwick Reserve, in Santa Barbara County. We then quantify variation in germination success and acorn size, evaluating their spatial patterns across the site. We collected acorns from 21 mapped focal trees in fall 1999, measured their average seed weight and germination success, and identified their multilocus genotypes. Using a mixed mating model, we observed significant, but modest selfing (outcrossing rate: tm = 0.96) and no mating among relatives (tm – ts) = 0.0. The effective pollen donor number was estimated to be between 5 and 7 individuals, depending on the inbreeding coefficient of the adults. These mating results indicate relatively little inbreeding but low numbers of pollen donors. Mothers differed significantly in seed weight (range: ~ 4 – 10 g) and germination percentage (range: 0 – 90 percent), and a bivariate analysis showed a gradient across the study site. Such a pattern suggests that environment conditions influence acorn size and germination success. Future work will address whether isolated individuals are at risk of selfing, for the expression of inbreeding depression on seed traits, or a reduction in the effective pollen donor number.

USDA Forest Service Gen. Tech. Rep. PSW-GTR-184.

Smouse PE, Dyer RJ, Westfall RD, Sork VL. 2001. Two-generation analysis of pollen flow across a landscape I. Male gamete heterogeneity among females. Evolution, 55 260-271.

Smouse PE, Dyer RJ, Westfall RD, Sork VL. 2001. Two-generation analysis of pollen flow across a landscape I. Male gamete heterogeneity among females. Evolution, 55 260-271.

Gene flow is a key factor in the spatial genetic structure in spatially distributed species. Evolutionary biologists interested in microevolutionary processes and conservation biologists interested in the impact of landscape change require a method that measures the real time process of gene movement. We present a novel two-generation (parent-offspring) approach to the study of genetic structure (TwoGener) that allows us to quantify heterogeneity among the male gamete pools sampled by maternal trees scattered across the landscape and to estimate mean pollination distance and effective neighborhood size. First, we describe the model’s elements: genetic distance matrices to estimate intergametic distances, molecular analysis of variance to determine whether pollen profiles differ among mothers, and optimal sampling considerations. Second, we evaluate the model’s effectiveness by simulating spatially distributed populations. Spatial heterogeneity in male gametes can be estimated by ΦFT, a male gametic analogue of Wright’s FST and an inverse function of mean pollination distance. We illustrate TwoGener in cases where the male gamete can be categorically or ambiguously determined. This approach does not require the high level of genetic resolution needed by parentage analysis, but the ambiguous case is vulnerable to bias in the absence of adequate genetic resolution. Finally, we apply TwoGener to an empirical study of Quercus alba in Missouri Ozark forests. We find that ΦFT = 0.06, translating into about eight effective pollen donors per female and an effective pollination neighborhood as a circle of radius about 17 m. Effective pollen movement in Q. alba is more restricted than previously realized, even though pollen is capable of moving large distances. This case study illustrates that, with a modest investment in field survey and laboratory analysis, the TwoGener approach permits inferences about landscape-level gene movements.

DOI: 10.1111/j.0014-3820.2001.tb01291.x

Smouse PE, Dyer RJ, Westfall RD, Sork VL. 2001. Two-generation analysis of pollen flow across a landscape I. Male gamete heterogeneity among females. Evolution, 55 260-271.

Smouse PE, Dyer RJ, Westfall RD, Sork VL. 2001. Two-generation analysis of pollen flow across a landscape I. Male gamete heterogeneity among females. Evolution, 55 260-271.

Gene flow is a key factor in the spatial genetic structure in spatially distributed species. Evolutionary biologists interested in microevolutionary processes and conservation biologists interested in the impact of landscape change require a method that measures the real time process of gene movement. We present a novel two-generation (parent-offspring) approach to the study of genetic structure (TwoGener) that allows us to quantify heterogeneity among the male gamete pools sampled by maternal trees scattered across the landscape and to estimate mean pollination distance and effective neighborhood size. First, we describe the model’s elements: genetic distance matrices to estimate intergametic distances, molecular analysis of variance to determine whether pollen profiles differ among mothers, and optimal sampling considerations. Second, we evaluate the model’s effectiveness by simulating spatially distributed populations. Spatial heterogeneity in male gametes can be estimated by ΦFT, a male gametic analogue of Wright’s FST and an inverse function of mean pollination distance. We illustrate TwoGener in cases where the male gamete can be categorically or ambiguously determined. This approach does not require the high level of genetic resolution needed by parentage analysis, but the ambiguous case is vulnerable to bias in the absence of adequate genetic resolution. Finally, we apply TwoGener to an empirical study of Quercus alba in Missouri Ozark forests. We find that ΦFT = 0.06, translating into about eight effective pollen donors per female and an effective pollination neighborhood as a circle of radius about 17 m. Effective pollen movement in Q. alba is more restricted than previously realized, even though pollen is capable of moving large distances. This case study illustrates that, with a modest investment in field survey and laboratory analysis, the TwoGener approach permits inferences about landscape-level gene movements.

DOI: 10.1111/j.0014-3820.2001.tb01291.x