Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

A.mat

Additive relationship matrix


Description

Calculates the realized additive relationship matrix. Currently is the C++ implementation of Endelman and Jannink (2012) and van Raden (2008).

Usage

A.mat(X,endelman=TRUE,min.MAF=0,return.imputed=FALSE)

Arguments

X

Matrix (n \times m) of unphased genotypes for n lines and m biallelic markers, coded as {-1,0,1}. Fractional (imputed) and missing values (NA) are allowed.

endelman

Set endelman=TRUE to use the method from Endelman and Jannink (2012) (without the shrinkage, for that method look at the rrBLUP package). If FALSE, regular vanRaden is used.

min.MAF

Minimum minor allele frequency. The A matrix is not sensitive to rare alleles, so by default only monomorphic markers are removed.

return.imputed

When TRUE, the imputed marker matrix is returned.

Details

For endelman method: At high marker density, the relationship matrix is estimated as A=W W'/c, where W_{ik} = X_{ik} + 1 - 2 p_k and p_k is the frequency of the 1 allele at marker k. By using a normalization constant of c = 2 ∑_k {p_k (1-p_k)}, the mean of the diagonal elements is 1 + f (Endelman and Jannink 2012).

For vanraden method: the marker matrix is centered by subtracting column means M= X - ms where ms is the coumn means. Then A=M M'/c, where c = ∑_k{d_k}/k, the mean value of the diagonal values of the M M' portion.

Value

If return.imputed = FALSE, the n \times n additive relationship matrix is returned.

If return.imputed = TRUE, the function returns a list containing

$A

the A matrix

$X

the imputed marker matrix

References

Endelman, J.B., and J.-L. Jannink. 2012. Shrinkage estimation of the realized relationship matrix. G3:Genes, Genomes, Genetics. 2:1405-1413. doi: 10.1534/g3.112.004259

Covarrubias-Pazaran G (2016) Genome assisted prediction of quantitative traits using the R package sommer. PLoS ONE 11(6): doi:10.1371/journal.pone.0156744

See Also

mmer – the core function of the package

Examples

####=========================================####
#### random population of 200 lines with 1000 markers
####=========================================####
X <- matrix(rep(0,200*1000),200,1000)
for (i in 1:200) {
  X[i,] <- ifelse(runif(1000)<0.5,-1,1)
}

A <- A.mat(X)

####=========================================####
#### take a look at the Genomic relationship matrix 
#### (just a small part)
####=========================================####
# colfunc <- colorRampPalette(c("steelblue4","springgreen","yellow"))
# hv <- heatmap(A[1:15,1:15], col = colfunc(100),Colv = "Rowv")
# str(hv)

sommer

Solving Mixed Model Equations in R

v4.1.3
GPL (>= 2)
Authors
Giovanny Covarrubias-Pazaran
Initial release
2021-04-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.