getHaplo {epinetr}R Documentation

Retrieve haplotypes.

Description

Retrieve haplotypes from the population.

Usage

getHaplo(pop)

Arguments

pop

a valid Population object

Details

Retrieves the haplotypes from both the population which, when added together, form the genotypes.

Value

A list is returned with two elements, corresponding to the two haplotype matrices.

Author(s)

Dion Detterer, Paul Kwan, Cedric Gondro

See Also

getAddCoefs, getAddOffset, getPhased, getGeno

Examples

# Construct a new population with additive effects
pop <- Population(
  popSize = 20, map = map100snp, QTL = 20,
  broadH2 = 0.4, narrowh2 = 0.4, traitVar = 40,
  alleleFrequencies = runif(100, 0.05, 0.5)
)
pop <- addEffects(pop)

# Find the additive contribution to the individuals' phenotypes
hap <- getHaplo(pop)
hap <- (hap[[1]] + hap[[2]])[, getQTL(pop)$Index]
(hap %*% getAddCoefs(pop))[, 1] + getAddOffset(pop)

[Package epinetr version 0.96 Index]