DM: Dominance Matrix

View source: R/bm_grm.r

DMR Documentation

Dominance Matrix

Description

Compute the Dominance Matrix

Usage

 DM(x, which.snps, autosome.only = TRUE, chunk = 1L) 

Arguments

x

A bed.matrix

which.snps

Logical vector, giving which snps to use in the computation. The default is to use all autosomal SNPs

autosome.only

If TRUE, only autosomal SNPs will be considered.

chunk

Parameter for the parallelization: how many SNPs are treated by each task

Details

The Dominance Matrix (DM) gives for each pair of individuals an estimation of their probability of sharing two alleles Identical By Descent.

It is computed by a moment estimator, {1\over q} ZZ' with Z the matrix with entries p \over 1-p, -1, 1-p \over p according to the values 0, 1, 2 in the genotype matrix x (here p is the frequency of the alternate allele, and q is the number of SNPs (ncol(x)).

Value

A symmetric square matrix of dimension equal to the number of individuals. Each entry can be interpreted as an estimated probability of sharing two alleles IBD — as it is a moment estimator, the value can (and will) fall outside of the range (0,1).

See Also

GRM, reshape.GRM

Examples

# load chr2 data set (~10k SNPs in low LD)
x <- read.bed.matrix( system.file("extdata", "chr2.bed", package="gaston") )

# Compute Dominance Matrix
D <- DM(x)
dim(D)


gaston documentation built on May 29, 2024, 7:33 a.m.