Learn R Programming

HaploSim (version 1.8.4.2)

buildhPedigree: Build a haplotype pedrigree from a haplotype list

Description

Builds a haplotype pedigree from a list of objects of class haplotype. Objects have attributes hID and phID0, phID1, the last two refer to the two haplotypes in the parent. Function can construct a new pedigree or continue a given pedigree. Simulate a list of haplotypes, either sampling using population parameters or from a previous list of haplotypes through a series of meioses.

Usage

buildhPedigree(hPedigree = NULL,hList)

Value

A data.frame.

Arguments

hPedigree

If unspecified, the previous haplotype pedigree upon which buildhPed builds the additional haplotypes.

hList

A list with objects of class haplotype.

Details

The function buildhPedigree uses the attributes hID, phID0, phID1 of objects of class haplotype to build a pedigree of haplotypes. Each haplotype originates from a pair of parental haplotypes between which the meiosis event occured or has no known parental haplotypes.

See Also

SampleHaplotypes

Examples

Run this code
example(SampleHaplotypes)
hPedigree <- buildhPedigree(hList = hList)
for(g in 1:10)
  {
    hList <- SampleHaplotypes(orig = hList,genDist
        = 1,roundDec = 3)
    hPedigree <- buildhPedigree(hPedigree=hPedigree,hList = hList)
  }

Run the code above in your browser using DataLab