Simulate a list of haplotypes

Description

Simulate a list of haplotypes, either sampling using population parameters or from a previous list of haplotypes through a series of meioses.

Usage

1
SampleHaplotypes(orig = NULL,nHaplotypes = 10,nMeioses = 2,gg = NULL,...)

Arguments

orig

If unspecified, the function samples base population haplotypes. If specified, the function requests a list containing objects of class haplotype.

nHaplotypes

The requested number of haplotypes.

nMeioses

The number of offspring from each individual. For details see below.

gg

If specified, the combinations of haplotypes in individuals. Meiosis only occur within individuals. If not specified, individuals are sampled as random combinations of haplotypes.

...

Additional arguments to be passed to function SampleHaplotype, haploList and SampleBaseHaplotype.

Details

The function SampleHaplotypes creates individuals by randomly combining haplotypes from the list. Meiosis events in individuals create new haplotypes. Argument nOff sets the number of meiosis events within each individual. Argument nHaplotypes has only effect when sampling a base population. See SampleBaseHaplotype for sampling base haplotypes and for arguments of this function.

Value

A list of length nHaplotpes or nOff * length(orig) of objects of class haplotype.

See Also

SampleHaplotype, SampleBaseHaplotype

Examples

1
2
3
4
hList <- SampleHaplotypes(nHaplotypes = 20,nLoc = 100,genDist =
1,nDec = 3) ## create objects
for(g in 1:10)hList <- SampleHaplotypes(orig = hList,genDist
= 1,nDec = 3)