recomb_fam {simfam} | R Documentation |
Draw recombination breaks for autosomes from a pedigree
Description
Create random recombination breaks for all autosomes of all individuals in the provided pedigree FAM table. Recombination lengths follow an exponential distribution with mean of 100 centiMorgans (cM). The output specifies identical-by-descent (IBD) blocks as ranges per chromosome (per individual) and the founder chromosome they arose from (are IBD with). All calculations are in terms of genetic distance (not base pairs), and no genotypes are constructed/drawn in this step.
Usage
recomb_fam(founders, fam, missing_vals = c("", 0))
Arguments
founders |
The named list of founders with their chromosomes.
For unstructured founders, initialize with |
fam |
The pedigree data.frame, in plink FAM format.
Only columns |
missing_vals |
The list of ID values treated as missing.
|
Value
The list of individuals with recombined chromosomes of the entire fam
table, in the same format as founders
above.
The names of this list correspond to fam$id
in that order.
See Also
recomb_init_founders()
to initialize founders
for this function.
Plink FAM format reference: https://www.cog-genomics.org/plink/1.9/formats#fam
Examples
# 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