Learn R Programming

HaploSim (version 1.8.4.2)

SamplePedigree: 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,...)

Value

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

haplotype.

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.

See Also

SampleHaplotype, orderPed

Examples

Run this code
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)

Run the code above in your browser using DataLab