Learn R Programming

hsphase (version 3.0.0)

ohg: Matrix of Opposing Homozygotes

Description

Creates a matrix of pairwise opposing-homozygote (OH) counts from a genotype matrix.

Usage

ohg(genotypeMatrix)

Value

Returns a square matrix (sample \(\times\) sample) of pairwise counts of opposing homozygotes. (Some versions may return this matrix inside a named list element.)

Arguments

genotypeMatrix

matrix. Genotypes (numeric): 0, 1, 2 for AA, AB, BB and 9 for missing.

Author

Ferdosi, M. H., & Boerner, V. (2014). A fast method for evaluating opposing homozygosity in large SNP data sets. Livestock Science.

See Also

rpoh

Examples

Run this code
genotype <- matrix(c(
  2,1,0,
  2,0,0,
  0,0,2
), byrow = TRUE, ncol = 3)

ohg(genotype)

Run the code above in your browser using DataLab