sim_gen_model: Define the genetic model of a trait

View source: R/sim_gen_model.R

sim_gen_modelR Documentation

Define the genetic model of a trait

Description

Defines the genetic architecture of a trait.

Usage

sim_gen_model(genome, qtl.model, geno, ...)

Arguments

genome

An object of class genome.

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 (a) and the fourth column gives the dominance effect at that QTL (d). If the matrix is one of NA, QTL will be randomly assigned based on the number of rows in the matrix.

geno

Genotype data for a base population. Must be a matrix of dimensions n.ind x n.loci, the elements of which must be z 0, 1, 2, or a list of such matrices. Must be passed if V_GE.scale is passed.

...

Other arguments. See Details for more information.

Details

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.dist

The 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.dist

The 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.qtl

The 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.scale

The 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.

Value

A genome object with added information for the gentic model.

Examples

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)



neyhartj/qgsim documentation built on Nov. 11, 2023, 4:08 p.m.