hbp: Haplotype Blocks of Phased Data

View source: R/hsphase.R

hbpR Documentation

Haplotype Blocks of Phased Data

Description

Creates a block-structure matrix for a half-sib family based on phased data of the sire and the half-sib family.

Usage

hbp(PhasedGenotypeMatrix, PhasedSireGenotype, strand = "auto")

Arguments

PhasedGenotypeMatrix

matrix. Haplotypes for a half-sib family (two rows per individual). Alleles should be coded as 0 and 1; use 9 for missing/unphased if present.

PhasedSireGenotype

matrix. Haplotypes of the sire (two rows; same SNP order as PhasedGenotypeMatrix).

strand

character. Method for identification of paternal strand. Use "auto" (recommended; default) or specify "1" or "2" to force a strand definition.

Value

A matrix in which 3 or 4 indicates the SNP originates from, respectively, sire strand 1 or strand 2. 0 indicates the origin is unknown.

Note

The input matrices must contain individuals from a single half-sib family and a single ordered chromosome. The SNP order must match between inputs.

See Also

aio, ssp

Examples

sire <- matrix(c(
  0,0,0,0,0,1,                  # Haplotype one of the sire
  0,1,1,1,1,0                   # Haplotype two of the sire
  ), byrow = TRUE, ncol = 6)
  
haplotypeHalfsib <- matrix(c(
  1,0,1,1,1,1,                  # Individual one, haplotype one
  0,1,0,0,0,0,                  # Individual one, haplotype two
  0,1,1,0,1,1,                  # Individual two, haplotype one
  1,0,0,1,0,0                   # Individual two, haplotype two
  ), byrow = TRUE, ncol = 6)    # 0s and 1s are alelle a and b
  
 hbp(haplotypeHalfsib, sire)

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