ssp: Sire Imputation and Phasing

View source: R/ssp.R

sspR Documentation

Sire Imputation and Phasing

Description

Infers (imputes) and phases the sire haplotypes based on the block structure matrix and homozygous sites of the half-sib genotype matrix.

Usage

ssp(blockMatrix, genotypeMatrix)

Arguments

blockMatrix

matrix. Block structure (output of bmh).

genotypeMatrix

matrix. Half-sib genotypes (one individual per row). Genotypes coded as 0, 1, 2 for AA, AB, BB. Use 9 for missing data.

Value

A matrix with two rows (one per sire haplotype) and columns corresponding to SNPs in genotype order. Alleles are coded as 0 (A) and 1 (B). Alleles that could not be imputed are coded as 9.

See Also

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)

ssp(bmh(genotype), genotype)

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