coeffTable: Table of pairwise relatedness coefficients

View source: R/coeffTable.R

coeffTableR Documentation

Table of pairwise relatedness coefficients

Description

Creates a data frame containing various relatedness coefficients between all pairs of individuals in a given pedigree.

Usage

coeffTable(
  x,
  ids = labels(x),
  coeff = c("f", "phi", "deg", "kappa", "identity", "detailed"),
  self = FALSE,
  Xchrom = FALSE
)

Arguments

x

A pedigree in the form of a pedtools::ped object.

ids

A character (or coercible to character) containing ID labels of two or more pedigree members.

coeff

A character vector containing one or more of the keywords "f", "phi", "deg", "kappa", "identity", "detailed".

self

A logical indicating if self-relationships should be included. Default: FALSE.

Xchrom

A logical indicating if the coefficients should be autosomal (default) or X-chromosomal. If Xchrom = NA, both sets are included.

Details

Available coefficients (indicated in coeff) include:

  • f: The inbreeding coefficient of each pair member. Columns: f1 and f2.

  • phi: The kinship coefficient. Column: phi.

  • deg: The degree of relationship, as computed by kin2deg. Column: deg

  • kappa: The IBD coefficients computed by kappaIBD. (These are NA for pairs involving inbred individuals.) Columns: k0, k1, k2.

  • identity: The 9 condensed identity coefficients of Jacquard, computed by identityCoefs(). Columns: D1, ..., D9.

  • detailed: The detailed identity coefficients of Jacquard, computed by identityCoefs(..., detailed = TRUE). Columns: d1, ..., d15.

Value

A data frame with one row for each pair of individuals. The first two columns are characters named id1 and id2, while remaining columns are numeric. Columns containing X-chromosomal coefficients are suffixed with ".X".

If "f" (inbreeding) is the only coefficient, the data frame has one row per individual, and the first column is named id.

Note: If x has members with unknown sex, all X-chromosomal coefficients are NA.

Examples

# Uncle-nephew pedigree
x = avuncularPed()

# Complete table
coeffTable(x)

# Only selected coefficients
coeffTable(x, coeff = c("phi", "deg", "kappa"))

# Only the uncle-nephew pair
coeffTable(x, ids = c(3, 6), coeff = c("phi", "deg", "kappa"))

# X-chromosomal coefficients
coeffTable(x, Xchrom = TRUE, coeff = "kappa")

# Both autosomal and X
coeffTable(x, Xchrom = NA, coeff = "phi")


ribd documentation built on May 29, 2024, 8:43 a.m.