SampleHaplotype: Simulate a haplotype

View source: R/makeHaplotypes.R

SampleHaplotypeR Documentation

Simulate a haplotype

Description

Simulates a haplotype, either sampling using population parameters or through a meiosis event with two parental haplotypes.

Usage

SampleHaplotype(H0 = NULL,H1 = NULL,genDist,nDec,nChrom = 1,prMut =
1E-5,QTL = F,checkValidity = TRUE) 

Arguments

H0

If specified, the first parental haplotype.

H1

If specified, the second parental haplotype. If neither H0 nor H1 are specified, a new haplotype is sampled from a base population. Errors message is displayed when only one haplotype is provided as meiosis occurs between two haplotypes.

genDist

Map size of the simulated genome in Morgan.

nDec

Number of decimals until which marker positions are rounded. Partially specifies marker density on the chromosome.

nChrom

Number of chromosomes, default at 1

prMut

Probability of marker bp mutation.

QTL

If TRUE, qtl alleles are inherited to the next generation. See function AssignQTL for assigning qtl to a list of haplotypes.

checkValidity

If TRUE, tests if a pair of haplotypes is compatible; e.g. if the number of traits in both is equal (or 0) and if the sizes are equal.

Details

Markers are continually spaced over the whole genome. Marker density is specified in SampleBaseHaplotype. Position of 1 alleles is recorded and stored in @snp attribute of the object of class haplotype. If QTL is TRUE, haplotypes with QTL's need to be provided. If not, nothing happens apart from mutations (same prob. as for single basepairs). Function SampleHaplotype is generally called by function SampleHaplotypes.

Value

An object of class haplotype.

See Also

SampleHaplotypes, SampleBaseHaplotype

Examples

hList <- SampleHaplotypes(nHaplotypes = 20,genDist =
1,nDec = 3,nLoc = 20) ## create objects
h <- SampleHaplotype(H0 = hList[[1]],H1 = hList[[2]],genDist =
1,nDec = 3)

HaploSim documentation built on Aug. 14, 2022, 1:06 a.m.