recomb_init_founders: Initialize chromosome structures for founders

View source: R/recomb_init_founders.R

recomb_init_foundersR Documentation

Initialize chromosome structures for founders

Description

This function initializes what is otherwise a tedious structure for founders, to be used for simulating recombination in a pedigree. The genetic structure is trivial, in that these "founder" chromosomes are each of a single ancestral individual (none are recombined).

Usage

recomb_init_founders(ids, lengs)

Arguments

ids

The list of IDs to use for each individual

lengs

The lengths of each chromosome in centiMorgans (cM). If this vector is named, the output inherits these chromosome names. If it is a list, it is assumed to be a recombination map (see recomb_map_hg for examples) and the desired lengths extracted automatically (taken as the last value of column posg of each chromosome).

Value

A named list of diploid individuals, each of which is a list with two haploid individuals named pat and mat, each of which is a list of chromosomes (inherits names of lengs if present), each of which is a tibble with a single row and two columns: posg equals the chromosome length, and anc equals the ID of the individual (from ids) concatenated with either _pat or _mat depending on which parent it is.

See Also

recomb_fam() to simulate recombination across a pedigree using the founders initialized here.

Examples

# version with explicit recombination lengths
ancs <- recomb_init_founders( c('a', 'b'), c(100, 200) )
ancs

# version using genetic map (uses provided human map) from which lengths are extracted
ancs <- recomb_init_founders( c('a', 'b'), recomb_map_hg38 )
ancs


simfam documentation built on Jan. 10, 2023, 1:06 a.m.