sim.recomb: Simulate inheritance on a given pedigree.

Description Usage Arguments Details Value Examples

View source: R/simulation.R

Description

sim.recomb returns inheritance information simulated on a given pedigree over the specified segment length.

Usage

1
sim.recomb(pedinfo, seglength)

Arguments

pedinfo

dataframe.

seglength

positive real number.

Details

pedinfo must contain at least the following components: unique individual ID named member, father and mother ID named father and mother, and sex (1 for male, 2 for female) named sex. Parents must precede offsprings. Pedigree founders are treated as unrelated.

seglength represents length of genomic segment in Haldane centiMorgan. Recombination breakpoints are simulated under a homogeneous Poisson process with rate seglength/100.

Value

A list of matrices for each meiosis. Each matrix has two columns: founder genome labels (fgl) and recombination breakpoints (recomb). Paternal meiosis precedes maternal meiosis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# a simple pedigree with sibling marriage
pedigree = as.character(rep(1, 5))
member = as.character(c(11, 12, 21, 22, 31))
sex = as.numeric(c(1, 2, 1, 2, 1))
father = as.character(c(NA, NA, 11, 11, 21))
mother = as.character(c(NA, NA, 12, 12, 22))
pedinfo = data.frame(pedigree, member, sex, father, mother, stringsAsFactors = FALSE)

# simulate inheritance over a segment of 100 centiMorgan
sim.recomb(pedinfo, 100)

bowenwang7/rres documentation built on May 5, 2019, 2:41 a.m.