Build Pedigree-Based Additive Relationship Matrix

Build Pedigree-Based Additive Relationship Matrix

Description

Constructs the numerator relationship matrix (A) from pedigree data following Henderson (1976). The A matrix captures additive genetic relationships based on known ancestry, and can be used in masreml() for pedigree-based BLUP (PBLUP) or combined with genomic relationship matrices.

Usage

build_A_ped(pedigree)

Arguments

pedigree

data.frame with columns id, sire, and dam. Rows must be ordered such that parents appear before offspring. IDs must be integers or convertible to integer (1-based). Use 0 for unknown parents. Example format:

  id sire dam
   1    0   0
   2    0   0
   3    1   2
   4    1   2
   5    3   4
  

Value

numeric matrix (n x n) of additive relationships. Diagonal elements equal 1 + inbreeding coefficient. Off-diagonal elements equal twice the coefficient of kinship between pairs.

References

Henderson (1976) A simple method for computing the inverse of a numerator relationship matrix. Biometrics 32:69-83.

See Also

build_G_snp, masreml

Examples

Code
library("masreml")

# build_A_ped() expects integer indices: id = 1..n, sire/dam = integers
# into id (0 = unknown founder). The bundled pedigree uses character IDs
# with NA for founder parents, so we convert before calling.
d      <- load_data("small")
ped    <- d$pedigree
id_map <- setNames(seq_along(ped$id), ped$id)
ped_int <- data.frame(
  id   = id_map[ped$id],
  sire = ifelse(is.na(ped$sire), 0L, id_map[ped$sire]),
  dam  = ifelse(is.na(ped$dam),  0L, id_map[ped$dam])
)
A <- build_A_ped(ped_int)
dim(A)
# Diagonal ~ 1 + inbreeding coefficient
round(summary(diag(A)), 3)