Genomic relationships

Pedigrees describe expected sharing from known ancestry, whereas markers show realised sharing at the variants that were measured. A genomic relationship matrix summarises that realised marker similarity for a specified coding and base population.

Expected pedigree relationships and realised marker similarity

The pedigree relationship matrix \(\mathbf A\) records expected additive relationships implied by a pedigree. Full siblings have the same expected relationship, although meiosis gives each pair a different realised mosaic of parental chromosome segments. A genomic relationship matrix \(\mathbf G\) uses observed markers to estimate that realised sharing. Neither matrix directly reveals every causal variant; both depend on the available information and their population assumptions. See the pedigree input guide for pedigree records and the SNP input guide for marker data.

VanRaden’s centred-marker matrix

For \(n\) individuals and \(p\) biallelic markers, let \(\mathbf W\) be the \(n\times p\) centred dosage matrix from the previous page. VanRaden method 1 uses

\[ \mathbf G=\frac{\mathbf W\mathbf W^\mathsf T} {2\sum_{j=1}^{p}f_j(1-f_j)}. \]

The denominator is the expected marker heterozygosity under this allele- frequency convention. This page uses sample frequencies from its six-animal teaching view, so the matrix is illustrative rather than a production GRM. Other scaling, weighting, allele-frequency, and base-population choices give other legitimate genomic relationship definitions.

Code
d <- readRDS("../../demo-data/main/demo_data.rds")
M <- d$snp[1:6, c("SNP007", "SNP008", "SNP017"), drop = FALSE]
allele_frequency <- colMeans(M) / 2
W <- sweep(M, 2, 2 * allele_frequency, FUN = "-")
denominator <- 2 * sum(allele_frequency * (1 - allele_frequency))
G <- tcrossprod(W) / denominator
round(G, 3)
       IND001 IND002 IND003 IND004 IND005 IND006
IND001  0.227  0.227 -0.763 -0.144  0.103  0.351
IND002  0.227  0.227 -0.763 -0.144  0.103  0.351
IND003 -0.763 -0.763  2.701  0.351 -0.144 -1.381
IND004 -0.144 -0.144  0.351  1.711 -1.010 -0.763
IND005  0.103  0.103 -0.144 -1.010  0.722  0.227
IND006  0.351  0.351 -1.381 -0.763  0.227  1.216
Code
eigen(G, symmetric = TRUE)$values
[1] 4.241159e+00 2.152278e+00 4.106869e-01 3.572953e-16 1.485009e-16
[6] 1.396934e-17

Diagonal entries describe self-similarity relative to the chosen base and can vary among animals. Off-diagonal entries compare pairs after centring; a negative value means the pair shares fewer counted-marker alleles than the reference expectation, not negative kinship or a biological impossibility. With only three markers, this example has rank at most three, so several eigenvalues are numerically zero. Practical GRMs use many markers and still need quality control and a population-appropriate frequency reference.

A microhaplotype relationship matrix

For microhaplotypes, construct the additive matrix \(\mathbf W_{\alpha h}\) by concatenating the Da-coded non-baseline allele columns across blocks. If it has \(n\) rows, define its scale as

\[ k_{\alpha h}=\frac{1}{n}\operatorname{tr} \left(\mathbf W_{\alpha h}\mathbf W_{\alpha h}^{\mathsf T}\right), \qquad \mathbf G_{\mathrm{MH}}= \frac{\mathbf W_{\alpha h}\mathbf W_{\alpha h}^{\mathsf T}} {k_{\alpha h}}. \]

This diagonal-mean scaling makes the average diagonal of the displayed relationship matrix one. It is distinct from the SNP VanRaden denominator above. The following one-block teaching calculation uses the same categorical labels and baseline rule as the encoding page; a production matrix must use all eligible blocks and frequencies from the chosen reference population.

Code
d <- readRDS("../../demo-data/main/demo_data.rds")
mh <- d$mh[1:6, 5:6, drop = FALSE]
alleles <- sort(unique(as.vector(mh)))
counts <- sapply(alleles, function(a) rowSums(mh == a))
colnames(counts) <- as.character(alleles)
frequency <- colMeans(counts) / 2
baseline <- names(which.max(frequency))
non_baseline <- setdiff(colnames(counts), baseline)
stopifnot(length(non_baseline) > 0L)
W_alpha_h <- sweep(
  counts[, non_baseline, drop = FALSE],
  2,
  2 * frequency[non_baseline],
  FUN = function(count, expected) expected - count
)
k_alpha_h <- mean(diag(tcrossprod(W_alpha_h)))
stopifnot(is.finite(k_alpha_h), k_alpha_h > 0, all(is.finite(W_alpha_h)))
G_mh <- tcrossprod(W_alpha_h) / k_alpha_h
stopifnot(all(is.finite(G_mh)))
round(G_mh, 3)
       IND001 IND002 IND003 IND004 IND005 IND006
IND001    0.2    0.2     -1    0.2    0.2    0.2
IND002    0.2    0.2     -1    0.2    0.2    0.2
IND003   -1.0   -1.0      5   -1.0   -1.0   -1.0
IND004    0.2    0.2     -1    0.2    0.2    0.2
IND005    0.2    0.2     -1    0.2    0.2    0.2
IND006    0.2    0.2     -1    0.2    0.2    0.2

For this six-animal teaching subset, allele 4 is the baseline and \(k_{\alpha h}=0.278\). The mean diagonal of the displayed matrix is one by construction, so its off-diagonal values describe similarity relative to this scaled one-block representation.

This construction respects the categorical nature of haplotype identifiers. It does not establish that equal microhaplotype states are IBD, that the block captures a causal variant, or that \(\mathbf G_{\mathrm{MH}}\) will predict better than an SNP GRM. Those outcomes depend on phasing, marker density, LD, allele frequencies, genetic architecture, and the target population.

Covariance is an assumption for prediction

In a mixed model, a relationship template can enter as

\[\operatorname{Var}(\mathbf u)=\mathbf G\sigma_u^2,\]

where \(\mathbf u\) is a vector of animal effects and \(\sigma_u^2\) is an additive variance component. This says genetically similar animals are modelled as having correlated effects. It enables information to be shared between phenotyped animals and genotyped candidates, but it does not convert a similarity score into a causal explanation or a guaranteed prediction.

The next page develops GBLUP, where this covariance assumption, residual variation, and shrinkage produce genomic estimated breeding values.

Exercises

  1. Why can two full siblings have the same expected pedigree relationship but different genomic relationships?

They inherit different realised chromosome segments through meiosis. The pedigree gives an expectation, while marker data sample the realised sharing.

  1. What does a negative off-diagonal element of a centred GRM not mean?

It does not mean negative biological kinship. It means lower marker similarity than the chosen centred reference expectation.

  1. Why are several eigenvalues zero in the three-marker, six-animal example?

\(\mathbf W\) has only three columns, so \(\mathbf W\mathbf W^\mathsf T\) can have rank no greater than three even though it has six rows and columns.