View source: R/FUN_relationships.R
A.mat | R Documentation |
Calculates the realized additive relationship matrix. Currently is the C++ implementation of van Raden (2008).
A.mat(X,min.MAF=0,return.imputed=FALSE)
X |
Matrix ( |
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. |
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 = \sum_k{d_k}/k
, the mean value of the diagonal values of the M M'
portion.
If return.imputed = FALSE, the n \times n
additive relationship matrix is returned.
If return.imputed = TRUE, the function returns a list containing
the A matrix
the imputed marker matrix
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
mmer
– the core function of the package
####=========================================####
#### 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.