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

gl.test.heterozygosity

Tests the difference in heterozyosity between populations taken pairwise.


Description

Calculates the expected heterozygosities for each population in a genlight object, and uses re-randomization to test the statistical significance of differences in heterozyosity between populations taken pairwise.

Usage

gl.test.heterozygosity(
  x,
  nreps = 10000,
  alpha1 = 0.05,
  alpha2 = 0.01,
  plot = FALSE,
  plot.out = FALSE,
  verbose = NULL
)

Arguments

x

– a genlight object containing the SNP genotypes [Required]

nreps

– number of replications of the re-randomization [10,000]

alpha1

– significance level for comparison with diff=0 on plot [0.05]

alpha2

– second significance level for comparison with diff=0 on plot [0.01]

plot

– if TRUE, plots a sampling distribution of the differences for each comparison [FALSE]

plot.out

– if TRUE, outputs the plots as jpeg [FALSE]

verbose

– verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]

Details

Optionally plots the sampling distribution for the difference between each pair of heterozygosities, marked with the critical limits alpha1 and alpha2, the observed heterozygosity, and the zero value (if in range). Can output the plots to jpeg.

Value

returns a dataframe containing population labels, heterozygosities and sample sizes

Author(s)

Arthur Georges (Post to https://groups.google.com/d/forum/dartr)

Examples

gl.report.heterozygosity(possums.gl[1:120,])
out <- gl.test.heterozygosity(possums.gl[1:120,], nreps=10, verbose=3, plot=TRUE)

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.