Learn R Programming

hsphase (version 3.0.0)

ohd: 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)

Value

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

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

Author

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

Examples

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

ohd(genotype)

Run the code above in your browser using DataLab