ohd: Opposing Homozygote Detection

View source: R/ohd.R

ohdR Documentation

Opposing Homozygote Detection

Description

Counts, for each animal, the number of loci where it contributes opposing homozygotes in sites that imply heterozygosity in the sire.

Usage

ohd(genotypeMatrix, unique_check = FALSE, SNPs = 6000)

Arguments

genotypeMatrix

matrix. Half-sib genotypes (one half-sib per row, SNPs ordered by mapping position in the columns). Data should be numeric: 0, 1, 2 for AA, AB, BB and 9 for missing.

unique_check

logical. If TRUE, counts opposing homozygotes using a uniqueness rule (see Details).

SNPs

integer. Number of SNPs to use. (Only applicable if supported by the installed version.)

Value

A numeric vector with the number of heterozygous sites that each sample caused.

Note

This function can be used to identify pedigree errors; i.e., outliers with unusually high values.

Author(s)

This method was suggested by Bruce Tier <btier@une.edu.au> to identify pedigree errors.

Examples

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

ohd(genotype)

hsphase documentation built on Feb. 17, 2026, 5:07 p.m.