sim_multi_gen_model: Define a genetic model for two or more traits

View source: R/sim_gen_model.R

sim_multi_gen_modelR Documentation

Define a genetic model for two or more traits

Description

Generates a genetic model for two or more traits with desired genetic correlation.

Usage

sim_multi_gen_model(genome, qtl.model, ...)

Arguments

genome

An object of class genome.

qtl.model

A matrix specifying the QTL model. See sim_gen_model. If the qtl.model matrices are NA, the two traits must have the same number of QTL.

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:

corr

The desired genetic correlation if QTL are to be drawn randomly. May be positive or negative. See below regarding the multivariate random sampling of additive effects.

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 a multivariate normal distribution using the rmvnorm function and with variance-covariance matrix Sigma = rbind(c(1, corr), c(corr, 1)). 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). The same variance-covariance matrix above is then used to adjust the additive effects to achieve the desired correlation. This approach assumes that pairs of QTL are in coupling phase linkage, therefore the desired correlation will be different than the observed correlation depending on the population.

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.

Examples

# Simulate a genome
n.mar  <- c(505, 505, 505)
len <- c(120, 130, 140)

genome <- sim_genome(len, n.mar)

# Simulate two traits that are completely pleiotropy and influenced by 50 QTL
qtl.model <- replicate(n = 2, matrix(NA, 50, 4), simplify = FALSE)
genome <- sim_multi_gen_model(genome = genome, qtl.model = qtl.model, corr = 0.6, 
                              prob.corr = cbind(0, 1), add.dist = "geometric")
                              
# Use your own genetic model - 2 traits controlled by the same 10 QTL
sample_qtl <- sample(markernames(genome, include.qtl = TRUE), 10)
qtl.model <- replicate(2, cbind(find_markerpos(genome = genome, marker = sample_qtl), a = rnorm(10), d = 0), simplify = FALSE)

genome <- sim_multi_gen_model(genome = genome, qtl.model = qtl.model)

                              
# Simulate two traits that are controlled by 50 pairs of QTL that are between 20
# and 30 cM.
prob.corr <- rbind(c(20, 0), c(30, 1))
genome <- sim_multi_gen_model(genome = genome, qtl.model = qtl.model, corr = 0.6, 
                              prob.corr = prob.corr, add.dist = "geometric")



neyhartj/pbsim documentation built on Nov. 11, 2023, 4:07 p.m.