LDdam: Calculation of maternal LD matrix

Description Usage Arguments Details Value Examples

View source: R/functions.R

Description

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

Usage

1
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

1
2
3
4
 ## 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))

hscovar documentation built on April 13, 2021, 9:06 a.m.

Related to LDdam in hscovar...