G.tuneup {ASRgenomics} | R Documentation |
Generates a new matrix that can be blended, bended or aligned
in order to make it stable for future use or matrix inversion. The input matrix should
be of the full form (n \times n
) with individual names assigned to
rownames
and colnames
.
This routine provides three options of tune-up:
Blend. The \boldsymbol{G}
matrix is blended (or averaged) with another matrix.
\boldsymbol{G}^\ast=(1-p) \boldsymbol{G} + p \boldsymbol{A}
, where
\boldsymbol{G}^\ast
is the blended matrix, \boldsymbol{G}
is the original matrix, p
is the
proportion of the identity matrix or pedigree-based relationship matrix to consider,
and \boldsymbol{A}
is the matrix to blend.
Ideally, the pedigree-based relationship matrix should be used, but if this is not available (or it is
of poor quality), then it is replaced by an identity matrix \boldsymbol{I}
.
Bend. It consists on adjusting the original \boldsymbol{G}
matrix to obtain a
near positive definite matrix, which is done by making all negative or very small eigenvalues
slightly positive.
Align. The original \boldsymbol{G}
matrix is aligned to the
matching pedigree relationship
matrix \boldsymbol{A}
where an \alpha
and \beta
parameters are obtained.
More information can be found in the manual or in Christensen et al. (2012).
The user should provide the matrices \boldsymbol{G}
and
\boldsymbol{A}
in full form (n \times n
)
and matching individual names should be
assigned to the rownames
and colnames
of the matrices.
Based on procedures published by Nazarian and Gezan et al. (2016).
G.tuneup(
G = NULL,
A = NULL,
blend = FALSE,
pblend = 0.02,
bend = FALSE,
eig.tol = 1e-06,
align = FALSE,
rcn = TRUE,
digits = 8,
sparseform = FALSE,
determinant = TRUE,
message = TRUE
)
G |
Input of the genomic matrix |
A |
Input of the matching pedigree relationship matrix |
blend |
If |
pblend |
If blending is requested this is the proportion of the identity matrix |
bend |
If |
eig.tol |
Defines relative positiveness (i.e., non-zero) of eigenvalues compared to the largest one.
It determines which threshold of eigenvalues will be treated as zero (default = |
align |
If |
rcn |
If |
digits |
Set up the number of digits used to round the output matrix (default = |
sparseform |
If |
determinant |
If |
message |
If |
A list with six of the following elements:
Gb
: the inverse of \boldsymbol{G}
matrix in full form
(only if sparseform = FALSE
).
Gb.sparse
: if requested, the inverse of \boldsymbol{G}
matrix in
sparse form (only if sparseform = TRUE
).
rcn0
: the reciprocal conditional number of the original matrix.
Values near zero are associated with an ill-conditioned matrix.
rcnb
: the reciprocal conditional number of the blended, bended or aligned
matrix. Values near zero are associated with an ill-conditioned matrix.
det0
: if requested, the determinant of the original matrix.
blend
: if the matrix was blended.
bend
: if the matrix was bended.
align
: if the matrix was aligned.
Christensen, O.F., Madsen, P., Nielsen, B., Ostersen, T. and Su, G. 2012. Single-step methods for genomic evaluation in pigs. Animal 6:1565-1571. doi:10.1017/S1751731112000742.
Nazarian A., Gezan S.A. 2016. GenoMatrix: A software package for pedigree-based and genomic prediction analyses on complex traits. Journal of Heredity 107:372-379.
# Example: Apple dataset.
# Get G matrix.
G <- G.matrix(M = geno.apple, method = "VanRaden")$G
G[1:5, 1:5]
# Blend G matrix.
G_blended <- G.tuneup(G = G, blend = TRUE, pblend = 0.05)
G_blended$Gb[1:5, 1:5]
# Bend G matrix.
G_bended <- G.tuneup(G = G, bend = TRUE, eig.tol = 1e-03)
G_bended$Gb[1:5, 1:5]
# Example: Loblolly Pine dataset with pedigree - Aligned G matrix.
A <- AGHmatrix::Amatrix(ped.pine)
dim(A)
# Read and filter genotypic data.
M.clean <- qc.filtering(
M = geno.pine655,
maf = 0.05,
marker.callrate = 0.2, ind.callrate = 0.20,
na.string = "-9")$M.clean
# Get G matrix.
G <- G.matrix(M = M.clean, method = "VanRaden", na.string = "-9")$G
G[1:5, 1:5]
dim(G)
# Match G and A.
Aclean <- match.G2A(A = A, G = G, clean = TRUE, ord = TRUE, mism = TRUE)$Aclean
# Align G with A.
G_align <- G.tuneup(G = G, A = Aclean, align = TRUE)
G_align$Gb[1:5, 1:5]