Skip to content

Latest commit

 

History

History
executable file
·
36 lines (26 loc) · 1.18 KB

example2.md

File metadata and controls

executable file
·
36 lines (26 loc) · 1.18 KB

Example 2: Computing inbreeding, additive genetic relationship matrix A and its inverse.

Following the last example, we create a valid pediree object from a data.frame representation of the example pedigree:

library(pedigreeTools)

pedFrame <-data.frame(sire=as.character(c(NA,NA,NA,NA,NA,1,3,5,6,4,8,1,10,8)),
dam= as.character(c(NA,NA,NA,NA,NA,2,2,NA,7,7,NA,9,9,13)),
label=as.character(1:14))

ped <- with(pedFrame, pedigree(label=label, sire=sire, dam=dam))

Section A : Obtaining A, Ainv and inbreeding coefficients

It must be noted here that it is computationally cheaper to set up the inverse of the A matrix than to set up A and then invert it. Hence we compute A or Ainv from the functions getA or getAInv as needed.

Compute the inbreeding coefficients of the pedigree

inb <- inbreeding(ped)

Get the additive genetic relationship matrix

 A <- getA(ped)

Get the inverse of A

Ainv <- getAInv(ped)

Below we show a visualization for the Ainv matrix for the example pedigree:

Home