####=========================================####
#### For CRAN time limitations most lines in the
#### examples are silenced with one '#' mark,
#### remove them and run the examples using
#### command + shift + C |OR| control + shift + C
####=========================================####
data(DT_rice)
# DT <- DT_rice
# GT <- GT_rice
# GTn <- GTn_rice
# head(DT)
# M <- atcg1234(GT)
# A <- A.mat(M$M)
# mix <- mmes(Protein.content~1,
# random = ~vsm(ism(geno), Gu=A) + geno,
# rcov=~units,
# data=DT)
# summary(mix)$varcomp
# # if using henderson=TRUE provide Gu as inverse
# Ai <- solve(A + diag(1e-6,ncol(A),ncol(A)))
# Ai <- as(as(as( Ai, "dMatrix"), "generalMatrix"), "CsparseMatrix")
# attr(Ai, 'inverse')=TRUE
#
#
#
# ## MULTI-TRAIT MODEL
# ## reshape in long format the dataset
# traits <- c("Protein.content","Flag.leaf.length")
# DTL <- reshape(DT[,c("geno", traits)], idvar = "geno", varying = traits,
# v.names = "value", direction = "long",
# timevar = "trait", times = traits )
# DTL <- DTL[with(DTL, order(trait)), ]
# head(DTL)
#
# M <- DTLM <- atcg1234(GT)
# A <- A.mat(M$M)
# mix <- mmes(value~trait,
# random = ~vsm(usm(trait),ism(geno), Gu=A) ,
# rcov=~vsm(dsm(trait), ism(units)),
# data=DTL)
# summary(mix)$varcomp
# cov2cor(mix$theta$`vsm(usm(trait), ism(geno), Gu = A`)
Run the code above in your browser using DataLab