# The smallest pedigree, two parents and a child.
# A minimal fam table with the three required columns.
# Note "mother" and "father" have missing parent IDs, while "child" does not
library(tibble)
fam <- tibble(
id = c('father', 'mother', 'child'),
pat = c(NA, NA, 'father'),
mat = c(NA, NA, 'mother')
)
# initialize parents with this other function
# Name the parents with same codes as in `fam`
# (order can be different)
ids <- c('mother', 'father')
# simulate three chromosomes with these lengths in cM
lengs <- c(50, 100, 150)
founders <- recomb_init_founders( ids, lengs )
# draw recombination breaks for the whole fam table now:
inds <- recomb_fam( founders, fam )
# This is a length-3 list with names matching fam$id.
# The parent data equals the input (reordered),
# but now there's data to the child too
inds
Run the code above in your browser using DataLab