setMarkerHaplo {AlphaSimR}R Documentation

Set marker haplotypes

Description

Manually sets the haplotypes in a population for all individuals at one or more loci.

Usage

setMarkerHaplo(pop, haplo, simParam = NULL)

Arguments

pop

an object of RawPop-class or MapPop-class

haplo

a matrix of haplotypes, see details

simParam

an object of SimParam, not used if pop is MapPop-class

Details

The format of the haplotype matrix should match the format of the output from pullMarkerHaplo with the option haplo="all". Thus, it is recommended that this function is first used to extract the haplotypes and that any desired changes be made to the output of pullMarkerHaplo before passing the matrix to setMarkerHaplo. Any changes made to QTL may potentially result in changes to an individuals genetic value. These changes will be reflected in the gv and/or gxe slot. All other slots will remain unchanged, so the ebv and pheno slots will not reflect the new genotypes.

Value

an object of the same class as the "pop" input

Examples

# Create founder haplotypes
founderPop = quickHaplo(nInd=10, nChr=1, segSites=15)

# Extract haplotypes for marker "1_1"
H = pullMarkerHaplo(founderPop, markers="1_1")

# Set the first haplotype to 1
H[1,1] = 1L

# Set marker haplotypes
founderPop = setMarkerHaplo(founderPop, haplo=H)


[Package AlphaSimR version 1.5.3 Index]