Migration Corridors and Genetic Range Shifts from Landscape Genetic Data

Models genetic connectivity along migration corridors and forecasts how it shifts under climate change, following Maier et al. (2022) . Least cost corridors are built from accumulated cost surfaces and used as weights to summarize raw environmental layers between sites; each group of environmental features can choose its own corridor bandwidth; and pairwise predictions of differentiation and directional migration are mapped back onto the landscape as magnitude and net-direction surfaces. Includes readers for common genotype formats (STRUCTURE, GENEPOP, VCF, GenAlEx, FSTAT and PLINK files, and 'adegenet' objects), pairwise fixation indices, and the directional differentiation of Sundqvist et al. (2016) .


corridoR

R-CMD-check

Migration corridors and genetic range shifts from landscape genetic data.

corridoR models genetic connectivity along migration corridors and forecasts how it shifts under climate change. It implements the workflow of Maier et al. (2022, Heredity), which predicted upslope range shifts in the Yosemite toad:

  1. Genetic distances. Read genotypes from STRUCTURE, GENEPOP, VCF, GenAlEx, FSTAT or PLINK files (or adegenet and vcfR objects), then compute pairwise FST and directional differentiation (δM, the net direction of migration).
  2. Least cost corridors. Widen least cost paths into corridors whose cells are weighted by how likely a route through them is.
  3. Raw environmental features. Summarize any raster inside each corridor, plus the contrast between source and destination sites.
  4. A bandwidth for each feature group. Let climate act over a broad corridor and soil over a narrow one, chosen by cross-validation.
  5. Cubist models of FST and δM, which extrapolate to future climate better than random forests.
  6. Maps of projected change, with arrows showing the net direction of migration.

The simulated example: 80 meadows in four lineages on a range that rises from west to east

Projected shift in net migration: low meadows are pushed upslope, the crest is a refuge

Installation

Install the development version from GitHub:

# install.packages("pak")
pak::pak("paulmaier/corridoR")

A quick look

library(corridoR)
ex <- corridor_example(acc = TRUE)          # a simulated mountain range, 80 meadows

pc  <- read_genotypes(ex$files$structure)   # or GENEPOP, VCF, ...
fst <- pairwise_fst(pc)
dM  <- directional_gst(pc)$dM

# corridor weights between two meadows, and climate summarized inside them
w <- lcc_weights(ex$acc, "M20", "M60", q = 0.05)
corridor_extract(ex$env, data.frame(from = "M20", to = "M60"), acc = ex$acc, q = 0.05)

The full tutorial runs all six steps on the simulated range, from genotype files to the maps above, and the getting-started vignette is a short version. The same analysis on real data is in the Yosemite toad tutorial.

Genotype formats

Format Read with Notes
STRUCTURE (.str) read_genotypes() one or two rows per individual; optional label, POPDATA, POPFLAG, LOCDATA, PHENOTYPE and extra columns; marker-name row detected
GENEPOP (.gen) read_genotypes() 2- or 3-digit alleles, haploid or diploid
VCF (.vcf, .vcf.gz) read_genotypes(pop = ) any ploidy, phased or unphased, multiallelic
GenAlEx (.csv) read_genotypes() codominant layout
FSTAT (.dat) read_genotypes()
PLINK (.ped/.map, .raw) read_genotypes() convert .bed with plink --recode A
genind, genpop, genlight, vcfR as_popcounts() from adegenet or vcfR

Precomputed matrices of FST or δM from any other software work too.

Citation

If you use corridoR, please cite both papers:

Maier PA, Vandergast AG, Ostoja SM, Aguilar A, Bohonak AJ (2022) Landscape genetics of a sub-alpine toad: climate change predicted to induce upward range shifts via asymmetrical migration corridors. Heredity 129:257-272. https://doi.org/10.1038/s41437-022-00561-x

Maier PA (2027) corridoR: An R package for forecasting genetic range shifts along migration corridors. Methods in Ecology and Evolution, in review.

The first introduced the method; the second describes the package. citation("corridoR") prints both.

License

MIT

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("corridoR")

0.2.0 by Paul A. Maier, 7 hours ago


https://github.com/paulmaier/corridoR, https://paulmaier.github.io/corridoR/


Report a bug at https://github.com/paulmaier/corridoR/issues


Browse source code at https://github.com/cran/corridoR


Authors: Paul A. Maier [aut, cre, cph] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports gdistance, graphics, grDevices, raster, sf, stats, terra, utils

Suggests adegenet, caret, Cubist, exactextractr, ggplot2, knitr, lme4, ranger, rmarkdown, testthat, vcfR


See at CRAN