Description Usage Arguments Value Author(s) Examples

This function computes the genomic relationship matrix, G, together with its matrix square root, L.

1 | ```
compute_GL(Z, w)
``` |

`Z` |
Scaled matrix with genotype information |

`w` |
weights |

`L` |
Square root matrix of G |

`svdVec` |
Vectors in the Single Value Decomposition of G |

`svdD` |
Diagonal elements in the Single Value Decomposition of G |

`wZt` |
weights times the transpose of Z |

Lars Ronnegard

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
set.seed(1234)
N <- 20 #Number of individuals
k <- 30 #Number of SNPs with all marker positions including a QTL
Z1 <- matrix(0, N, k )
Z2 <- matrix(0, N, k )
Z1[1:N, 1] <- rbinom(N, 1, 0.5) #Simulated phased SNP matrices
Z2[1:N, 1] <- rbinom(N, 1, 0.5)
LD.par <- 0.2 #A parameter to simulate LD. 0 gives full LD, and 0.5 no LD
for (j in 2:k) {
Z1[1:N, j] <- abs( Z1[1:N, j-1] - rbinom(N, 1, LD.par) )
Z2[1:N, j] <- abs( Z2[1:N, j-1] - rbinom(N, 1, LD.par) )
}
Z <- Z1 + Z2 #Genotypic SNP matrix
sim.res <- compute_GL(Z, w = rep(1,k))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.