View source: R/simer.Phenotype.r
phenotype | R Documentation |
Generate single-trait or multiple-trait phenotype by mixed model.
phenotype(SP = NULL, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Jan 28, 2025
the function returns a list containing
the population information containing environmental factors and other effects.
the number of individuals in the base population.
the repeated times of repeated records.
whether repeated records are balanced.
a list of environmental factors setting.
a list of phenotype types.
a list of genetic model of phenotype such as "T1 = A + E".
a list of additive heritability.
a list of dominant heritability.
a list of GxG interaction heritability.
a list of GxE interaction heritability.
a list of permanent environmental heritability.
a list of phenotype variance.
the additive genetic correlation matrix.
the dominant genetic correlation matrix.
the GxG genetic correlation matrix.
the permanent environmental correlation matrix.
the residual correlation matrix.
Dong Yin
Kao C and Zeng Z (2002) <https://www.genetics.org/content/160/3/1243.long>
# Prepare environmental factor list
pop.env <- list(
F1 = list( # fixed effect 1
level = c("1", "2"),
effect = list(tr1 = c(50, 30), tr2 = c(50, 30))
),
F2 = list( # fixed effect 2
level = c("d1", "d2", "d3"),
effect = list(tr1 = c(10, 20, 30), tr2 = c(10, 20, 30))
),
C1 = list( # covariate 1
level = c(70, 80, 90),
slope = list(tr1 = 1.5, tr2 = 1.5)
),
R1 = list( # random effect 1
level = c("l1", "l2", "l3"),
ratio = list(tr1 = 0.1, tr2 = 0.1)
)
)
# Generate genotype simulation parameters
SP <- param.annot(qtn.num = list(tr1 = c(2, 8), tr2 = 10),
qtn.model = "A + D + A:D")
# Generate annotation simulation parameters
SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2)
# Generate phenotype simulation parameters
SP <- param.pheno(
SP = SP,
pop.ind = 100,
pop.rep = 2, # 2 repeated record
pop.rep.bal = TRUE, # balanced repeated record
pop.env = pop.env,
phe.type = list(
tr1 = "continuous",
tr2 = list(case = 0.01, control = 0.99)
),
phe.model = list(
tr1 = "T1 = A + D + A:D + F1 + F2 + C1 + R1 + A:F1 + E",
tr2 = "T2 = A + D + A:D + F1 + F2 + C1 + R1 + A:F1 + E"
),
phe.var = list(tr1 = 100, tr2 = 100)
)
# Run annotation simulation
SP <- annotation(SP)
# Run genotype simulation
SP <- genotype(SP)
# Run phenotype simulation
SP <- phenotype(SP)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.