dot-phfnoGenotype: Phase half-sib paternal haplotype using blocks and sire...

.phfnoGenotypeR Documentation

Phase half-sib paternal haplotype using blocks and sire haplotypes (no offspring genotype needed)

Description

Internal helper that constructs a half-sib paternal haplotype matrix using:

  • a block/strand-of-origin matrix (typically produced by bmh)

  • a 2-row phased sire haplotype matrix (typically produced by ssp)

Usage

.phfnoGenotype(blockMatrix, sirePhasedMatrix)

Arguments

blockMatrix

An integer/numeric matrix of block assignments with individuals in rows and markers in columns. Must contain only '0', '1', and '2', where '0' indicates unknown origin.

sirePhasedMatrix

An integer/numeric matrix with **two rows** (the sire haplotypes) and the same number of columns as blockMatrix. Must contain only '0', '1', and '9' (where '9' indicates missing).

Details

For each marker (column) and individual (row), if the block code is:

  • '1': assign sire haplotype row 1 allele at that marker

  • '2': assign sire haplotype row 2 allele at that marker

  • '0': leave as missing ('9')

This function calls a native C routine (phaseNogenotype) via .C().

The underlying C implementation initializes the entire result matrix to '9' and then fills entries according to blockMatrix:

  • if blockMatrix[j,i] == 1, then result[j,i] = sirePhasedMatrix[1,i]

  • if blockMatrix[j,i] == 2, then result[j,i] = sirePhasedMatrix[2,i]

Value

An integer matrix with the same dimensions as blockMatrix, containing the inferred paternal haplotype allele for each individual and marker. Values are '0'/'1' for alleles and '9' for missing/unknown (e.g. where blockMatrix is '0').


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