SamplePedigree: Simulate a haplotypes in a pedigree

View source: R/SamplePedigree.R

SamplePedigreeR Documentation

Simulate a haplotypes in a pedigree

Description

Simulates haplotypes within a given pedigree. Haplotypes for a base individual are sampled from a list of base haplotypes. Parameters for sampling haplotypes are passed to function SampleHaplotype.

Usage

SamplePedigree(orig,ped,...)

Arguments

orig

List of objects of class haplotype. Haplotypes for base individuals are the result of a meiosis event between two haplotypes in this list.

ped

data.frame of three columns. Column 1 contains id's, column two and three id's of parental individuals. Pedigree is first ordered with function orderPed from the package pedigree.

...

Arguments to be passed to function SampleHaplotype.

Details

Samples haplotypes for individuals in a pedigree and returns a pedigree with two additional columns which identify the two haplotypes of an individual together with a list of haplotypes. Uses function SampleHaplotype to sample a meiosis event between two parental haplotypes.

Value

A list with a pedigree and a list of objects of class haplotype.

See Also

SampleHaplotype, orderPed

Examples

example(SampleHaplotypes)
ID <- 1:10
pID0 <- c(rep(0,5),1,1,3,3,5)
pID1 <- c(rep(0,4),2,2,2,4,4,6)
ped <- data.frame(ID,pID0,pID1)
phList <- SamplePedigree(orig = hList,ped = ped)

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