Skip to contents

The G of VanRaden (2008), first method: genotypes centered by twice the allele frequency, G = Z Z' / (2 sum p q), frequencies from the genotyped animals themselves. This is the RAW G of the book's worked examples (Mrode & Pocrnic, 4th ed., Example 13.3, p.233), no blending with A22 and no affine adjustment, which are the single-step steps that model(genotypes = ) performs internally. With few animals G is singular; add a small ridge before declaring it, G + diag(0.01, n), as the book does in its examples.

Usage

g_matrix(genotypes)

Arguments

genotypes

list with ids and m (animals x markers, 0/1/2 coded); NA is imputed with the marker mean, and monomorphic markers are left out. A repeated id, rownames that contradict ids and an animal below a 0.90 call rate are refused, as in model()

Value

genomic relationship matrix, rows and columns named by ids

Examples

geno <- list(ids = c("a", "b"), m = rbind(c(0, 1, 2), c(2, 1, 0)))
g_matrix(geno)
#>           a         b
#> a  1.333333 -1.333333
#> b -1.333333  1.333333