Learn R Programming

dartR.base (version 1.0.5)

gl.report.excess.het: Report loci with excess of heterozygosity

Description

Calculates excess of heterozygosity in a genlight object

Usage

gl.report.excess.het(
  x,
  Yates = FALSE,
  plot.display = TRUE,
  plot.theme = theme_dartR(),
  plot.colors = NULL,
  plot.file = NULL,
  plot.dir = NULL,
  verbose = NULL
)

Value

1. Table with information of excessively-heterozygous loci

2. Two plots of heterozygosity of the loci before and after filtering (i.e. without excessively heterozygous loci).

3. A vector with the names of loci to be remove by gl.filter.excess.het

Arguments

x

Name of the genlight object containing the SNP data [required].

Yates

Boolean for Yates's continuity correction. [default FALSE]

plot.display

Specify if plot is to be produced [default TRUE].

plot.theme

Theme for the plot. See Details for options [default theme_dartR()].

plot.colors

Vector with two color names for the borders and fill [default c("#2171B5", "#6BAED6")].

plot.file

Name for the RDS binary file to save (base name only, exclude extension) [default NULL].

plot.dir

Directory to save the plot RDS files [default as specified by the global working directory or tempdir()].

verbose

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

Author

Jesús Castrejón-Figueroa, Diana A Robledo-Ruiz (Custodian: Ching Ching Lau) -- Post to https://groups.google.com/d/forum/dartr

Details

Loci with observed heterozygosity larger than 0.5 and expected heterozygosity would be indicated as excess (p-value <= 0.05). You can remove the loci with excess of heterozygosity from genlight object using gl.filter.excess.het

Function's output

If a plot.file is given, the ggplot arising from this function is saved as an "RDS" binary file using saveRDS(); can be reloaded with readRDS(). A file name must be specified for the plot to be saved.

If a plot directory (plot.dir) is specified, the ggplot binary is saved to that directory; otherwise to the tempdir().

Examples of other themes that can be used can be consulted in:

A color vector can be obtained with gl.select.colors() and then passed to the function with the plot.colors parameter.

References

  • https://github.com/drobledoruiz/conservation_genomics/tree/main/filter.excess.het

  • Robledo‐Ruiz, D. A., Austin, L., Amos, J. N., Castrejón‐Figueroa, J., Harley, D. K., Magrath, M. J., Sunnucks, P. & Pavlova, A. (2023). Easy‐to‐use R functions to separate reduced‐representation genomic datasets into sex‐linked and autosomal loci, and conduct sex assignment. Molecular Ecology Resources.

See Also

gl.filter.excess.het

Other unmatched report: gl.allele.freq(), gl.report.basics(), gl.report.diversity(), gl.report.heterozygosity(), gl.report.polyploid_heterozygosity()

Examples

Run this code
filtered.table <- gl.report.excess.het(x = LBP, Yates = TRUE)

Run the code above in your browser using DataLab