# NOT RUN {
data(steptoe.morex.pheno)
dat <- steptoe.morex.pheno
# Calculate avg yield for each loc as in Romagosa 1996, table 3
t(t(round(tapply(dat$yield, dat$env, FUN=mean),2)))
# SKo92,SKg92 means in table 3 are switched. Who is right, him or me?
# Draw marker map
if(require(qtl)){
data(steptoe.morex.geno)
datg <- steptoe.morex.geno
plot.map(datg) # or just use plot()
}
# }
# NOT RUN {
# This is a very rudimentary example.
# Fit a simple multi-environment mixed model
require(asreml)
m1 <- asreml(yield ~ env, data=dat, random=~gen)
require(wgaim)
plotMissing(datg)
link.map(datg)
# Create an interval object for wgaim
class(datg)[1] <- "bc"
dati <- cross2int(datg, id="gen")
# Whole genome qtl
q1 <- wgaim(m1, dat, dati, merge.by="gen", na.method.X='include')
link.map(q1, dati) # Visualize
out.stat(q1, dati) # outlier statistic
summary(q1, dati) # Table of important intervals
# Chrom Left Marker dist(cM) Right Marker dist(cM) Size Pvalue <!-- % Var -->
# 3 ABG399 52.6 BCD828 56.1 0.254 0.000 45.0
# 5 MWG912 148 ABG387A 151.2 0.092 0.001 5.9
# 6 ABC169B 64.8 CDO497 67.5 -0.089 0.001 5.6
# }
Run the code above in your browser using DataLab