# simulate AIL pedigree
tab <- sim_ail_pedigree(12, 30)
# simulate data from that pedigree
dat <- sim_from_pedigree(tab)
# marker map (could also use sim.map in R/qtl)
map <- seq(0, 100, by=5)
names(map) <- paste0("marker", seq(along=map))
# convert data to marker genotypes
geno <- convert2geno(dat, map)
# AIL with multiple chromosomes
dat <- sim_from_pedigree(tab, c("1"=100, "2"=75, "X"=100), xchr="X")
# marker map
multmap <- list("1"=seq(0, 100, by=5),
"2"=seq(0, 75, by=5),
"X"=seq(0, 100, by=5))
for(i in 1:3)
names(multmap[[i]]) <- paste0("marker", i, "_", 1:length(map[[i]]))
geno <- convert2geno(dat, multmap)
# simulate DO pedigree
tab <- sim_do_pedigree(8)
# simulate data from that pedigree
dat <- sim_from_pedigree(tab)
# simulate founder snp alleles
fg <- matrix(sample(1:2, 8*length(map), repl=TRUE), nrow=8)
# for DO, need female & male founders (to deal with X chr)
fg <- rbind(fg, fg)
# convert dat to SNP genotypes
geno <- convert2geno(dat, map, fg)
# if fg not provided, result is a 3d array
genoarray <- convert2geno(dat, map)
Run the code above in your browser using DataLab