GBLUP中G矩阵的构建,理解版参照邓飞老师(https://blog.sciencenet.cn/blog-2577109-1122903.html)
如何用sommer包构建矩阵
myG <- read.table("RHhmp.txt", header = F, comment.char = "")
myGAPIT <- GAPIT(G=myG, output.numerical=TRUE,file.output =FALSE)
myGD= myGAPIT$GD #标记哑变量
myGM= myGAPIT$GM
G<-as.matrix.data.frame(myGD[,-1]-1)
G_a<-A.mat(G) #G矩阵构建完成
##如果想做上位性矩阵如何操作
G_aa<-A.mat(G%*%t(G))/mean(diag(A.mat(G%*%t(G)))) #mean(diag(A.mat(G%*%t(G))矩阵标准化