Learn R Programming

dartR (version 1.1.11)

gl.diversity: Calculate diversity indices for SNPs

Description

!!Just an intro placeholder!! This script takes a genlight object and calculates alpha and beta diversity for q=0:2. Formulas are taken from Sherwin et al. 2017. The paper describes nicely the relationship between the different q levels and how they relate to population genetic processes such as dispersal and selection. For all indices the entropies (H) and corrosponding effective numbers Hill numbers (D), which reflect the amount of entities that are needed to get the observed valuea are calculated. In a nutshell the alpha indices between the different q-values should be similar if there are no deviation from expected allele frequencies and occurrences (e.g. all loci in HWE & equilibrium). If there is a deviation of an index this links to a process causing it such as dispersal, selection or strong drift. For a detailed explanation of all the indices, we recommend to resort to the literature provided below.

Usage

gl.diversity(gl, spectrumplot = TRUE, confiplot = FALSE,
  probar = TRUE, table = "DH")

Arguments

gl

genlight object containing the SNP genotypes [required]

spectrumplot

switch to provide a plot [TRUE]

confiplot

switch if confidence intervals (1 sd) should be drawn [default: FALSE]

probar

report on progress. Silent if set to FALSE. [Default is TRUE]

table

prints a tabular output to the console either 'D'=D values, or 'H'=H values or 'DH','HD'=both or 'N'=no table.

Value

a list of entropy indices for each level of q and equivalent numbers for alpha and beta diversity.

References

Sherwin, W.B., Chao, A., Johst, L., Smouse, P.E. (2017). Information Theory Broadens the Spectrum of Molecular Ecology and Evolution. TREE 32(12) 948-963. doi:10.1016/j.tree.2017.09.12

Chao et al. 2014