bmh: Block Partitioning

View source: R/bmh.R

bmhR Documentation

Block Partitioning

Description

Identifies the block structure (chromosome segments) in a half-sib family that each individual inherited from its sire.

Usage

bmh(
  GenotypeMatrix,
  forwardVectorSize = 30,
  excludeFP = TRUE,
  nsap = 3,
  fillMissing = FALSE
)

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.

forwardVectorSize

integer. Number of heterozygous sites used to validate recombination events or check for genotyping/map errors (50K \to 30, 700K \to 120).

excludeFP

logical. Exclude SNPs that may cause heterozygous sites in the sire due to genotyping errors or map errors.

nsap

integer. Number of SNP per block to validate recombinations (50K \to 3, 700K \to 10).

fillMissing

logical. Because the exact point of recombination is unknown, markers around recombination points may be set to missing. If TRUE, the recombination point is assumed to be in the middle of the ambiguous region, reducing missing markers.

Value

A matrix of block structure containing 1, 2, and 0. Values 1 and 2 represent the two sire strands (arbitrary labeling within a chromosome), and 0 indicates unknown origin.

Note

The genotype matrix must contain individuals from only one half-sib family and one ordered chromosome.

See Also

ssp, phf, aio, imageplot

Examples

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

bmh(genotype)

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