# NOT RUN {
####=========================================####
#### For CRAN time limitations most lines in the
#### examples are silenced with a single '#' mark,
#### remove them and run the examples
###=========================================####
data(CPdata)
####=========================================####
#### convert markers to numeric format
####=========================================####
## fit a model including additive and dominance effects
y <- CPpheno$color
Za <- diag(length(y))
A <- A.mat(CPgeno) # additive relationship matrix
####=========================================####
#### compare prediction accuracies between
#### GBLUP and hits GBLUP
####=========================================####
set.seed(1234)
y.trn <- y # for prediction accuracy
ww <- sample(c(1:dim(Za)[1]),72) # delete data for one fifth of the population
y.trn[ww] <- NA
####=========================================####
#### identify major genes and create the hit matrix
####=========================================####
#ETA.A <- list(list(Z=Za,K=A))
#ans.GWAS <- mmer(Y=y.trn, Z=ETA.A, W=CPgeno)
#summary(ans.GWAS)
####=========================================####
#### run the hits function to design the matrix
#### for top GWAS hits
####=========================================####
#X1 <- hits(ans.GWAS);head(X1); dim(X1)
#ETA.A <- list(list(Z=Za,K=A))
#ans.A <- mmer(Y=y.trn, Z=ETA.A) # GBLUP
#ans.AF <- mmer(Y=y.trn, X=X1, Z=ETA.A) # hitsging-GBLUP
#cor(ans.A$fitted.y[ww], y[ww], use="pairwise.complete.obs") # GBLUP
#cor(ans.AF$fitted.y[ww], y[ww], use="pairwise.complete.obs") # hitsging-GBLUP
#### little increase in prediction accuracy
# }
Run the code above in your browser using DataLab