ainverse {asreml} | R Documentation |
Generates an inverse relationship matrix in sparse triplet form from a pedigree data frame.
ainverse(pedigree, fgen = list(character(0), 0.01), gender = character(0), groups = 0, groupOffset = 0, selfing = NA, inBreed = NA, mgs = FALSE, mv = c("NA", "0", "*"), psort = FALSE)
pedigree |
A data frame where the first three columns correspond to the identifiers for the individual, male parent and female parent, respectively. The row giving the pedigree of an individual must appear before any row where that individual appears as a parent. Founders use 0 (zero) or NA in the parental columns. |
fgen |
An optional list of length 2 where |
gender |
An optional character string naming the column of |
groups |
An integer scalar (g) indicating genetic groups in the pedigree. The first g lines of the pedigree identify the genetic groups (with zero in both the male and female parent columns). All other rows must specify one of the genetic groups as the male or female parent if the actual parent is unknown. The default is g=0. |
groupOffset |
A numeric scalar e > 0 added to the diagonal elements of
A^{-1} pertaining to |
selfing |
A numeric scalar (s) allowing for partial selfing when the
third field of |
inBreed |
A numeric scalar (default |
mgs |
If |
mv |
A character vector of missing value indicators; elements of
|
psort |
If |
Uses the method of Meuwissen and Luo, 1992 to compute the inverse relationship matrix directly from the pedigree.
A three-column matrix with class ginv
holding the lower
triangle of the inverse relationship matrix in sparse form. The
first 2 columns are the row and column indices,
respectively, and the third column holds the inverse matrix element
itself. Sort order is columns within rows, that is, the lower
triangle row-wise. This matrix has attributes:
rowNames
A character vector of identifiers for the rows of the matrix.
inbreeding
A numeric vector containing the
inbreeding coefficient for each individual, calculated as
diag(A-I)
.
geneticGroups
A numeric vector of length 2 containing
the groups
and groupOffset
arguments.
logdet
The log determinant.
Dutkowski GW, Gilmour AR (2001). “Modification of the Additive Relationship Matrix for Open Pollinated Trials.” In Developing the Eucalypt of the Future, 71. Instituto Forestal Chile, Valdivia. Fernando R, Grossman M (1990). “Genetic Evaluation with Autosomal and X-Chromosomal Inheritance.” Theoretical and Applied Genetics, 80, 75-80. Meuwissen THE, Luo Z (1992). “Computing Inbreeding Coefficients in Large Populations.” Genetics Selection Evolution, 24, 305-313.
## Not run: # Simple pedigree ped <- data.frame(me = c(1,2,3,4,5,6,7,8,9,10), dad = c(0,0,0,1,1,2,4,5,7,9), mum = c(0,0,0,1,1,2,6,6,8,9)) p.ai <- ainverse(ped) # Known filial generation pdfg <- data.frame(me = c(1,2,3,4,5,6,7), dad = c(0,0,1,1,1,1,1), mum = c(0,0,0,2,2,2,2), fgen = c(NA,0.8,0.0,2.0,0.0,2.0,3.0)) pdfg.ai <- ainverse(pdfg,fgen=list('fgen',0.4)) pdfg.mat <- sp2mat(pdfg.ai) zapsmall(solve(pdfg.mat)) zapsmall(cbind(pdfg.a$inbreeding,diag(pdfg.mat))) ## End(Not run)