IBDtriangle: IBD triangle plot

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/IBDtriangle.R

Description

The IBD triangle is typically used to visualize the pairwise relatedness of non-inbred individuals. Various annotations are available, including points marking the most common relationships, contour lines for the kinship coefficients, and shading of the unattainable region.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
IBDtriangle(
  relationships = c("UN", "PO", "MZ", "S", "H,U,G", "FC"),
  kinshipLines = numeric(),
  shading = "lightgray",
  pch = 16,
  cex_points = 1.2,
  cex_text = 1.2,
  axes = FALSE,
  xlim = c(0, 1),
  ylim = c(0, 1),
  xlab = expression(kappa[0]),
  ylab = expression(kappa[2]),
  cex_lab = cex_text,
  mar = c(3.1, 3.1, 1, 1),
  xpd = TRUE,
  keep.par = TRUE
)

Arguments

relationships

A character vector indicating relationships points to be included in the plot. See Details for a list of valid entries.

kinshipLines

A numeric vector (see Details).

shading

The shading colour for the unattainable region.

pch

Symbol used for the relationship points (see par()).

cex_points

A number controlling the symbol size for the relationship points.

cex_text

A number controlling the font size for the relationship labels.

axes

A logical: Draw surrounding axis box?

xlim, ylim, mar, xpd

Graphical parameters; see par().

xlab, ylab

Axis labels

cex_lab

A number controlling the font size for the axis labels.

keep.par

A logical. If TRUE, the graphical parameters are not reset after plotting, which may be useful for adding additional annotation.

Details

For any pair of non-inbred individuals A and B, their genetic relationship can be summarized by the IBD coefficients (κ0, κ1, κ2), where κ_i = P(A and B share i alleles IBD at random autosomal locus). Since κ0 + κ1 + κ2 = 1, any relationship corresponds to a point in the triangle in the (κ0, κ2)-plane defined by κ0 ≥ 0, κ2 ≥ 0, κ0 + κ2 ≤ 1. The choice of κ0 and κ2 as the axis variables is done for reasons of symmetry and is not significant (other authors have used different views of the triangle).

As shown by Thompson (1976), points in the subset of the triangle defined by 4*κ0*κ2 > κ1^2 are unattainable for pairwise relationships. By default this region is shaded in light grey colour, but this can be modified with the shading argument.

The IBD coefficients are linearly related to the kinship coefficient φ by the formula

φ = 0.25*κ1 + 0.5*κ2.

By indicating values for φ in the kinshipLines argument, the corresponding contour lines are shown as dashed lines in the triangle plot.

The following abbreviations are valid entries in the relationships argument:

Value

None

Author(s)

Magnus Dehli Vigeland

References

See Also

ibdEstimate()

Examples

1
2
3
4
5
6
opar = par(no.readonly = TRUE) # store graphical parameters

IBDtriangle()
IBDtriangle(kinshipLines = c(0.25, 0.125), shading = NULL, cex_text = 0.8)

par(opar) # reset graphical parameters

forrel documentation built on March 14, 2021, 1:06 a.m.