# \donttest{
# 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)
# }
Run the code above in your browser using DataLab