# NOT RUN {
# read data
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
# }
# NOT RUN {
# insert pseudomarkers into map
map <- insert_pseudomarkers(iron$gmap, step=5)
# calculate genotype probabilities
probs <- calc_genoprob(iron, map, error_prob=0.002)
# grab phenotypes and covariates; ensure that covariates have names attribute
pheno <- iron$pheno[,1]
covar <- match(iron$covar$sex, c("f", "m")) # make numeric
names(covar) <- rownames(iron$covar)
# scan chromosome 7 to find peak
out <- scan1(probs[,"7"], pheno, addcovar=covar)
# find peak position
max_pos <- max(out, map)
# genoprobs at max position
pr_max <- pull_genoprobpos(probs, map, max_pos$chr, max_pos$pos)
# fit QTL model just at that position
out_fit1 <- fit1(pr_max, pheno, addcovar=covar)
# }
Run the code above in your browser using DataLab