View source: R/sim_gen_model.R
| sim_gen_model | R Documentation |
Defines the genetic architecture of a trait.
sim_gen_model(genome, qtl.model, geno, ...)
genome |
An object of class |
qtl.model |
A matrix specifying the QTL model. Each row corresponds to
a different QTL. The first column gives the chromosome number, the second
column gives the locus position (in cM), the third column gives the additive effect of
the favorable QTL allele ( |
geno |
Genotype data for a base population. Must be a matrix of dimensions
|
... |
Other arguments. See Details for more information. |
QTL are simulated by sampling or specifying existing markers, which become "hidden."
The qtl.model matrix specifies the information for this assignment. The
first column in this matrix is the chromosome number. The second column is
the QTL position. The third column is the additive effect of the "1" allele
at the QTL (a). Genotypes homozygous for the "1" allele are assigned a
genotypic value of a and genotypes homozygous for the "-1" allele are
assigned a genotypic value of -a. The value of a provided in
qtl.model can be negative. The fourth column is the dominance effect at the
QTL. If non-zero, this value can be larger that a or smaller than -a
(overdominance). The genotypic value of heterozygotes at the QTL is d.
Other arguments include:
add.distThe distribution of additive effects of QTL (if additive
effects are not provided in the qtl.model input). Can be
"normal" or "geometric". For a distribution of "normal",
additive effects are generated via the rnorm function.
For a distribution of "geometric", additive effects are calculated for
the k-th QTL as a^k where a = (1 - L) / (1 + L) and L is
the number of QTL (Lande and Thompson, 1990).
dom.distThe distribution of dominance effects of QTL (if dominance
effects are not provided in the qtl.model input). Can be
"normal" for normally-distributed dominance effects.
max.qtlThe maximum number of QTL in the simulation experiment. Must
be passed if the QTL are randomly sampled. If a trait is controlled by L QTL
and max.qtl = M, then M - L QTL are given NULL effects.
This is useful if you want to simulate variable genetic architecture, but keep
the number of SNP markers constant.
V_GE.scaleThe scale of genotype-environment variance relative to the genetic variance. If passed and non-zero, this allow for linear QTL-environment interaction.
Also note the following rules that apply when the qtl.model input is
completely NA:
QTL positions are randomly drawn, with no regard to uniformity over chromosomes.
A genome object with added information for the gentic model.
n.mar <- c(505, 505, 505)
len <- c(120, 130, 140)
genome <- sim_genome(len, n.mar)
chromosome <- c(1, 1, 2, 2, 3, 3)
pos <- as.numeric(sapply(X = genome$len, FUN = runif, n = 2, min = 0))
a <- c(1, 0.25, 0.5, 0.25, 0.25, 0.5)
d <- 0
qtl.model <- cbind(chromosome, pos, a, d)
genome <- sim_gen_model(genome, qtl.model)
# Randomly generate 15 QTL with additive allelic effects following a
# genometric series
qtl.model <- matrix(nrow = 15, ncol = 4)
genome <- sim_gen_model(genome, qtl.model, add.dist = "geometric")
# Generate a model with 15 QTL with QTL-environment interaction
# First simulate a population to use the genotype data
geno <- sim_pop(genome = genome, n.ind = 100, ignore.gen.model = TRUE)$geno
genome <- sim_gen_model(genome, qtl.model, add.dist = "geometric", V_GE.scale = 2,
geno = geno)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.