Learn R Programming

GenABEL (version 1.8-0)

generateOffspring: simulates offspring's genotypes

Description

Simulat offspring's genotypes given genotypes of the parents. No LD is assumed.

Usage

generateOffspring(g1, g2, q = NULL)

Arguments

g1
vector of genotypes of parent 1, coded with 0, 1, 2 and NA
g2
vector of genotypes of parent 2, coded with 0, 1, 2 and NA
q
vector of the frequencies of effects alleles (used to simulate missings in parental genotypes). If NULL, c(0.25,0.5,0.25) is used.

Value

a vector containing simulated genotypes of offspring

Examples

Run this code
eaf <- runif(10)
g1 <- rbinom(10,2,eaf)
g2 <- rbinom(10,2,eaf)
generateOffspring(g1,g2)

Run the code above in your browser using DataLab