convert2gen: Convert simulated pedigree data to genotypes at markers

View source: R/sim_pedigree.R

convert2genR Documentation

Convert simulated pedigree data to genotypes at markers

Description

Convert data generated by sim.ped to a matrix of genotypes.

Usage

convert2gen(xodat, map)

Arguments

xodat

Allele information with continuous crossover locations, as generated by sim.ped.

map

A vector of marker locations, in cM.

Details

The marker locations (map) must be sorted and should span a length that is less then what was used to generated xodat.

If there are just two possible alleles (1 and 2) in xodat, the genotypes are coded as 1, 2, and 3, for genotypes 11, 12 and 22. Otherwise, they are converted to binary codes. For example, with possible alleles 1, 2, and 3, an individual with genotype a,b will be given the value 2^(a-1) + 2^(b-1).

Value

The output is a matrix with length(xodat) rows and length(map) columns. Genotype codes are described in Details.

Author(s)

Karl W Broman, broman@wisc.edu

See Also

sim.ped, genAILped

Examples

ailped <- genAILped(ngen=2, npairs=2, sibship.size=2)
aildat <- sim.ped(ailped, 100)
map <- seq(0, 100, by=10)
names(map) <- paste("M", 1:length(map), sep="")
ailgen <- convert2gen(aildat, map)

kbroman/ricalc documentation built on May 17, 2023, 11:54 p.m.