Learn R Programming

QTLRel (version 0.1)

hapSim: Generate Genotypic Data

Description

Simulate gametic data from a pedigree.

Usage

hapSim(ped, gmap, ids, hap.data, method=c("Haldane","Kosambi"),
   recode.pedigree=FALSE)

Arguments

ped
a pedigree, which is a data frame (id, sex, sire, dam, ...). In "sex", male should be "M", "Male" or 1, and female should be "F", "Female" or 2 (other than 0 and 1). If given, "generation" can be numeric 0, 1, 2, ... or non-numeric "F0", "F1", "F2", ... N
gmap
a genetic map. Should be data frame (snp, chr, dist, ...), where "snp" is the SNP (marker) name, "chr" is the chromosome where the "snp" is, and "dist" is the genetic distance in centi-Morgan (cM) from the leftmost SNP (marker) on the chromosome.
ids
genotypic data are extracted only for individuals with IDs specified by ids. If missing, genotypic data are extracted for all individuals in the pedigree. If ped is an object of pedRecode

Value

  • a matrix giving haplotypes.

Details

The pedigree should be in the same format as an output of pedRecode.

See Also

pedRecode for more information.

Examples

Run this code
data(miscEx)

pedR<- pedRecode(ped)
hapDat<- rbind(rep(1:2,nrow(genMapF34)),rep(3:4,nrow(genMapF34)))

hd<- hapSim(pedR, genMapF34, ids=pedR$id[pedR$gen=="F34"],
   hap.data=hapDat, recode.pedigree=TRUE)
dim(hd)
hd[1:5,1:10]

Run the code above in your browser using DataLab