Description Usage Arguments Details Value Examples
ld.weights
computes LD weights for all markers, which is subsequently used to compute LD weighted GRM.
1 | ld.weights(data, input.genotype = TRUE)
|
data |
numeric matrix. |
input.genotype |
logical. |
data
can either be the subject by marker numeric genotype matrix (with 0, 1 or 2 coding), or the matrix of marker genotypic correlations. The default option is to input genotype matrix.
A numeric vector of weights. Note that the sum of weights is not constrained to be 1. They should be scaled appropriately before computing the LD weighted GRM.
1 2 3 4 5 6 7 8 9 | # simulate genotypes of 500 individuals at 100 markers
nsnp = 100 # number of SNPs
freq = runif(nsnp, 0.05, 0.95)
nhaplo = 1000 # number of founder haplotypes
haplo.mat = sim.haplotype(freq, nhaplo)
geno.mat = t(sapply(c(1:500), function(x) 4 - haplo.mat[2*x-1,] - haplo.mat[2*x,]))
# compute unconstrained LD weights
ld.weights(geno.mat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.