Integer Rank Codes for Haplotypes

Description

Create a vector of integer codes for the input matrix of haplotypes. The haplotypes in the input matrix are converted to character strings, and if there are C unique strings, the integer codes for the haplotypes will be 1, 2, ..., C.

Usage

1

Arguments

hap

A matrix of haplotypes. If there are N haplotypes for K loci, hap have dimensions N x K.

Details

The alleles that make up each row in hap are pasted together as character strings, and the unique strings are sorted so that the rank order of the sorted strings is used as the integer code for the unique haplotypes.

Value

List with elements:

hash

Vector of integer codes for the input data (hap). The value of hash is the row number of the unique haplotypes given in the returned matrix hap.mtx.

hap.mtx

Matrix of unique haplotypes.

See Also

haplo.em

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.