View source: R/sim_4way_pedigree.R
sim_4way_pedigree | R Documentation |
Simulate a 4-way cross, among four inbred lines (a table of individual, mom, dad, sex)
sim_4way_pedigree(ngen = 1, nsibs = 100)
ngen |
Number of intercross generations (1 or 2) |
nsibs |
Vector with number of siblings in the sibships in the last generation. |
We start with a set of 4 individuals (representing four
inbred lines), and make a pair of crosses to generate a pair of
heterozygous individuals. These are then crosses to generate a set
of F1 individuals. If ngen==1
, we stop there, with
sum(nsibs)
individuals in this last generation. If
gen==2
, we generate length(nsibs)
male/female pairs
of F1 offspring; these are intercrossed to generate a set of
sibships, with lengths defined by the values in nsibs
.
Individuals in the last generation are alternating female/male.
A data frame with five columns: individual ID, mother ID,
father ID, sex, and generation. Founders have 0
for mother
and father ID. Sex is coded 0 for female and 1 for male.
sim_from_pedigree()
,
sim_ril_pedigree()
, sim_do_pedigree()
,
sim_ail_pedigree()
# 100 F1s between heterozygous parents
tab <- sim_4way_pedigree(1, 100)
# could also do this
tab2 <- sim_4way_pedigree(1, rep(10, 10))
# 120 F2s in 10 sibships each of size 12
tab3 <- sim_4way_pedigree(ngen=2, rep(12, 10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.