Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gl.ibd

Isolation by distance


Description

This functions performs an isolation by distance analysis based on a mantel test and also produces an isolation by distance plot. If a genlight object with coordinates is provided) then a Euclidean and genetic distance matrix are calculated (currently. Currently only pairwise Fst between population is implemented. Coordinates are expected as lat long and converted to Google Earth Mercator projection. If coordinates are already projected, set projected=TRUE. If such an object is provided an isolation by distance analysis and plot is performed on log(Euclidean distance) against population based pairwise Fst/1-Fst (see Rousseau's distance measure. Genetics April 1, 1997 vol. 145 no. 4 1219-1228) You can provide also your own genetic and Euclidean distance matrix. The function is based on the code provided by the adegenet tutorial (http://adegenet.r-forge.r-project.org/files/tutorial-basics.pdf), using the functions mantel (package vegan), stamppFst (package StAMPP) and Mercator in package dismo.

Usage

gl.ibd(
  x,
  Dgen = NULL,
  Dgeo = NULL,
  projected = FALSE,
  permutations = 999,
  plot = TRUE
)

Arguments

x

genlight object. If provided a standard analysis on Fst/1-Fst and log(distance) is performed

Dgen

genetic distance matrix if no genlight object with coordinates is provided

Dgeo

Euclidean distance matrix if no genlight object is provided

projected

Switch to indicate that coordinates are already projected (not in lat long) and therefore no projection is carried out. Default is FALSE, so it is assumed coordinates are in lat/longs.

permutations

number of permutations in the mantel test

plot

should an isolation by distance plot be returned. Default is plot=TRUE

Value

returns a list of the following components: Dgen (the genetic distance matrix), Dgeo (the Euclidean distance matrix), mantel (the statistics of the mantel test)

Author(s)

Bernd Gruber (bugs? Post to https://groups.google.com/d/forum/dartr)

References

Rousset (1997) Genetic Differentiation and Estimation of Gene Flow from F-Statistics Under Isolation by Distancenetics 145(4), 1219-1228.

See Also

Examples

ibd <- gl.ibd(bandicoot.gl)
ibd <- gl.ibd(bandicoot.gl,plot = FALSE)

dartR

Importing and Analysing SNP and Silicodart Data Generated by Genome-Wide Restriction Fragment Analysis

v1.9.6
GPL-2
Authors
Bernd Gruber [aut, cre], Arthur Georges [aut], Jose L. Mijangos [aut], Peter J. Unmack [ctb], Oliver Berry [ctb], Lindsay V. Clark [ctb], Floriaan Devloo-Delva [ctb]
Initial release
2021-04-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.