powered by
Matrix containing linkage disequilibrium between marker pairs on maternal gametes is set up by counting haplotypes frequencies.
LDdam(inMat, pos_chr)
[MATRIX] The maternal HAPLOTYPE matrix.
[LIST] The marker positions in Morgan on chromosomes.
Dd
(p x p) matrix of maternal LD
The function generates a block diagonal sparse matrix based on Matrix::bdiag. Use as.matrix() to obtain a regular one.
# NOT RUN { ## haplotype matrix of n individuals at p SNPs p <- 10; n <- 4 mat <- matrix(ncol = p, nrow = 2 * n, sample(c(0, 1), size = 2 * n * p, replace = TRUE)) LDdam(mat, list(1:p)) # }
Run the code above in your browser using DataLab