Learn R Programming

AlphaSimR (version 0.8.2)

sampleHaplo: Sample haplotypes from a MapPop

Description

Creates a new MapPop-class from an existing MapPop-class by randomly sampling haplotypes.

Usage

sampleHaplo(mapPop, nInd, inbred = FALSE, replace = TRUE)

Arguments

mapPop

the MapPop-class used to sample haplotypes

nInd

the number of individuals to create

inbred

should new individuals be fully inbred

replace

should haplotypes be sampled with replacement

Value

an object of MapPop-class

Examples

Run this code
# NOT RUN {
# Create genetic map for a single chromosome with 1 Morgan
# Chromosome contains 11 equally spaced segregating sites
genMap = list(seq(0,1,length.out=11))
founderPop = trackHaploPop(genMap=genMap,nInd=2,inbred=TRUE)
founderPop = sampleHaplo(nInd=20,mapPop=founderPop)

# }

Run the code above in your browser using DataLab