Learn R Programming

hsphase (version 3.0.0)

.o2tH: Convert a one-row haplotype to a two-row haplotype

Description

Converts a haplotype matrix where each individual is represented by one row and alleles are stored in alternating columns (1st allele, 2nd allele, ...) into a two-row-per-individual representation.

Usage

.o2tH(haplotype)

Value

An integer matrix in a two-row-per-individual format with 2 * nrow(haplotype) rows and ncol(haplotype) / 2 columns. Row names are interleaved using the original individual names.

Arguments

haplotype

A haplotype object:

  • a matrix with individuals in rows and allele columns in pairs (i.e. ncol(haplotype) must be even).

Details

Internally, any allele code of `2` is converted to `0` before conversion.