plotDeFinetti {diemr}R Documentation

Plot the De Finetti Diagram for Polarized Genotypes

Description

This function calculates genotype frequencies from polarized genotypes, ideally imported using the importPolarized function. It plots individuals onto a ternary De Finetti diagram and includes a curve indicating Hardy-Weinberg equilibrium if specified.

Usage

plotDeFinetti(
  genotypes,
  cols,
  HWE = TRUE,
  tipLabels = c("Homozygous 0", "Heterozygous 1", "Homozygous 2"),
  verbose = FALSE,
  ...
)

Arguments

genotypes

character matrix comprising of _012 encodings.

cols

character, vector of colors with a length equal to the number of individuals (rows) in genotypes.

HWE

logical indicating whether to plot the curve for Hardy-Weinberg Equilibrium.

tipLabels

character vector of length 3 with names for the ternary plot vertices.

verbose

logical whether to show messages on import progress.

...

additional graphical parameters (see plot.default).

Details

To import and polarize genotypes, use the importPolarized function.

Value

No return value; the function is called for its side effects.

Examples

gen <- importPolarized(
  file = system.file("extdata", "data7x10.txt", package = "diemr"),
  changePolarity = c(TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE),
  ChosenInds = 1:7
)

plotDeFinetti(genotypes = gen, cols = palette.colors(nrow(gen), "Accent"), pch = 19)

[Package diemr version 1.4 Index]