Skip to contents

Collapse a matrix of haplotypes to genotypes

Usage

Haps2Genotypes(haps, ploidy = 2L, method = "additive")

Arguments

haps

a vector or p x N matrix of 1s and 0s for N haplotypes observed at p loci

ploidy

the ploidy of the underlying organisms, haplotypes corresponding to the same organism are assumed to be stored consecutively in haps. Default = 2 (diploid)

method

a character in "additive", "recessive", or "dominant" giving the model of inheritance that should be tested, default = "additive"

Value

a matrix of genotypes with dimensions p x n = N / ploidy