phf: Half-sib Family Phasing

View source: R/hsphase.R

phfR Documentation

Half-sib Family Phasing

Description

Phases a half-sib family using the block structure and an imputed sire haplotype matrix.

Usage

phf(GenotypeMatrix, blockMatrix, sirePhasedMatrix)

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. Use 9 for missing data.

blockMatrix

matrix. Blocking structure (output of bmh).

sirePhasedMatrix

matrix. Imputed sire haplotypes (output of ssp).

Value

Returns a matrix containing the phased parental haplotypes of the half-sibs (two rows per individual). Alleles are coded as 0 (A), 1 (B), and 9 (missing/unphased).

Note

The genotype matrix must contain individuals from one half-sib family and one ordered chromosome. This function is used by aio for complete phasing of a half-sib group.

See Also

aio

Examples

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

block <- bmh(genotype)
phf(genotype, block, ssp(block, genotype))

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