sim_family_cb | R Documentation |
Simulate multiple families from a crossing block
sim_family_cb(genome, pedigree, founder.pop, crossing.block, ...)
genome |
An object of class |
pedigree |
A |
founder.pop |
An object of class |
crossing.block |
A crossing block detailing the crosses to make. Must be a
|
... |
Additional arguments passed to |
An object of class pop
with the information for all individuals in
the families specified by the crossing block.
# Simulate a genome
n.mar <- rep(500, 7)
len <- runif(n = 7, min = 140, 170)
genome <- sim_genome(len, n.mar)
# Simulate a quantitative trait influenced by 200 QTL
L <- 200
qtl.model <- matrix(NA, L, 4)
genome <- sim_gen_model(genome = genome, qtl.model = qtl.model,
add.dist = "geometric", max.qtl = L)
# Simulate the genotypes for 8 founders
founder.pop <- sim_founders(genome = genome, n.str = 8)
## 2-way population
# Generate a crossing block with 5 crosses
cb <- sim_crossing_block(parents = indnames(founder.pop), n.crosses = 25)
# Create a bi-parental pedigree with 100 individuals selfed to the F_3 generation
ped <- sim_pedigree(n.par = 2, n.ind = 100, n.selfgen = 2)
# Simulate a group of families from the crossing block
fam_cb <- sim_family_cb(genome = genome, pedigree = ped, founder.pop = founder.pop,
crossing.block = cb)
# Create a bi-parental pedigree with 100 individuals selfed to the F_3 generation
ped <- sim_pedigree(n.par = 2, n.ind = 100, n.selfgen = 5)
# Create many F_6 families, genotyped at the F_3
fam_cb <- sim_family_cb(genome = genome, pedigree = ped, founder.pop = founder.pop,
crossing.block = cb, marker.gen = 2)
## 4-way population
# Generate a crossing block with 5 crosses
cb <- sim_crossing_block(parents = indnames(founder.pop), n.crosses = 5, type = "4way")
# Create a pedigree with 100 individuals selfed to the F_3 generation
ped <- sim_pedigree(n.par = 4, n.ind = 100, n.selfgen = 2)
# Simulate a group of families from the crossing block
fam_cb <- sim_family_cb(genome = genome, pedigree = ped, founder.pop = founder.pop,
crossing.block = cb)
## Simulate RIL familes of different sizes
# Generate a crossing block with 5 crosses
cb <- sim_crossing_block(parents = indnames(founder.pop), n.crosses = 5, type = "2way")
# Number of individuals per cross
nIndCross <- c(20, 30, 40, 50, 60)
# Create a list of pedigrees
pedList <- sapply(nIndCross, sim_pedigree, n.par = 2, simplify = FALSE)
# Simulate a group of families from the crossing block
fam_cb <- sim_family_cb(genome = genome, pedigree = pedList, founder.pop = founder.pop,
crossing.block = cb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.