LDdam {hscovar}R Documentation

Calculation of maternal LD matrix

Description

Matrix containing linkage disequilibrium between marker pairs on maternal gametes is set up by counting haplotypes frequencies.

Usage

LDdam(inMat, pos_chr)

Arguments

inMat

[MATRIX] The maternal HAPLOTYPE matrix.

pos_chr

[LIST] The marker positions in Morgan on chromosomes.

Details

The function generates a block diagonal sparse matrix based on Matrix::bdiag. Use as.matrix() to obtain a regular one.

Value

Dd

(p x p) matrix of maternal LD

Examples

 ## 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))

[Package hscovar version 0.4.2 Index]