qbSim: MCMC samples used in scan.pdf document

Description Usage Details See Also Examples

Description

Retrieve or recreate MCMC samples used in scan.pdf document.

Usage

1
2

Details

Both calls to data create qb objects names qbSim. See vignette scan.pdf or see scan.Rnw in doc folder of package.

See Also

qb.genoprob, qb.mcmc, qb.sim.cross

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
data(qbSimMain)
summary(qbSim)

data(qbSimEpi)
summary(qbSim)

## Not run: 
## Setup for Simulated Data used in scan.pdf.
n.ind <- 100		## number of individuals
n.mark <- 200		## number of markers
by.mark <- 1		## cM spacing between markers
qtl.positions <- n.mark / 2	## position of QTL
markers <- seq(0, n.mark, by = by.mark)
names(markers) <- paste("M", markers, sep = "")
sim.map <- list(ch1 = markers)
sim.model <- matrix(c(1, qtl.positions, qtl.effect / 2), 1, 3)
colnames(sim.model) <- c("chromosome","qtl-position","effect-size")
n.iter <- 1000		## number of iterations for MCMC
qb.random.seed <- 1626  ## random seed for MCMC

## Genetic architecture for scan simulations: 3 QTL.
qtl.positions <- rbind(qtl1 = c(chromosome = 1, locus = 5), 
                       qtl2 = c(chromosome = 1, locus = 50), 
                       qtl3 = c(chromosome = 2, locus = 33) )

qtl.positions
qtl.main.model <-
  rbind(qtl1.main.effect = c(qtl = 1, main.effect.size = 0),
        qtl2.main.effect = c(qtl = 2, main.effect.size = 0),
        qtl3.main.effect = c(qtl = 3, main.effect.size = 0))

qtl.main.model
qtl.epi.model <- rbind(qtl1.and.qtl3.epi.effect =
  c(qtl1 = 1, qtl2 = 3, epi.effect.size = 10))
qtl.epi.model

## SimEpi
set.seed(1234)
sim <- qb.sim.cross(len = rep(100, 2), n.mar = 10, eq.spacing = TRUE, 
                    n.ind = 100, type = "bc", missing.geno = 0.03,
                    qtl.pos = qtl.positions, 
                    qtl.main = qtl.main.model,
                    qtl.epis = qtl.epi.model)
sim <- qb.genoprob(sim)
qbSim <- qb.mcmc(sim, n.iter = n.iter, verbose = FALSE, n.thin = 40,
                 seed = qb.random.seed)

## The next line saves qbSim as an external binary file.
save("qbSim", file = "qbSimEpi.RData")

## SimMain
qtl.main.model[2, "main.effect.size"] = 10
set.seed(1234)
sim <- qb.sim.cross(len = rep(100, 2), n.mar = 10, eq.spacing = TRUE, 
                    n.ind = 100, type = "bc", missing.geno = 0.03,
                    qtl.pos = qtl.positions, 
                    qtl.main = qtl.main.model,
                    qtl.epis = NULL)

## After the data is simulated call qb.genoprob to fill in 
## missing data.
sim <- qb.genoprob(sim, step = 2)

## Call qb.mcmc and then analysis code.
qbSim <- qb.mcmc(sim, n.iter = n.iter, verbose = FALSE, n.thin = 40,
                 seed = qb.random.seed)

## The next line saves qbSim as an external binary file.
save("qbSim", file = "qbSimMain.RData")

## End(Not run)

fboehm/qtlbim documentation built on Feb. 16, 2021, 12:04 a.m.