Standardized population genetic diversity in R

biodiversityDS.
2 min readDec 5, 2019

Genetic diversity estimation per site or group of sites can be biased due to unbalanced sampling designs. There is an expected relationship between the number of sampled individuals in a single population and genetic diversity (e.g., as allelic richness; the total number of alleles).

To overcome the issue, standardized allelic richness and standardized number of private alleles can be determined to the smallest number of individuals within sites or group of sites under multiple randomizations.

The sites or groups of sites with higher standardized genetic diversity than the global mean can be also assessed by testing the proportion of randomizations retrieving higher values than observed.

R code: Standardized population genetic diversity

# Source main functionsource("https://raw.githubusercontent.com/jorgeassis/rambo/master/Script.R")# Get example data file at: github.com/jorgeassis/rambomain.data.file <- "sampleData.gtx"missing.data <- 0
replace <- FALSE
ncode <- 3
resample.number.auto <- FALSE
resample.number <- 20
discard.pops <- NULL
number.iteractions <- 999
alfa.test <- 0.05
savefile <- FALSE
save.filename <- "richness"
# Define a vector to cluster populationsclustering.vector <- c(1,1,2,2)
# Run functionRambo(main.data.file, missing.data, ncode, replace, resample.number.auto, resample.number, discard.pops, number.iteractions, alfa.test, clustering.vector, savefile, save.filename)

Main citation

Assis, J., Coelho, N. C., Lamy, T., Valero, M., Alberto, F., & Serrão, E. A. (2016). Deep reefs are climatic refugia for genetic diversity of marine forests. Journal of Biogeography, (43), 833–844. https://doi.org/10.1111/jbi.12677

--

--

biodiversityDS.

Hi!! I’m Jorge Assis, a Data Scientist, Marine Ecologist, Climate Change Analyst, R and Python Developer based in Portugal [biodiversitydatascience.com]