AFEchidna包可以批量进行计算基因组关系矩阵,简单示例如下:
library(AFEchidna)
setwd("D:/Rdata")
G.marker<-read.csv(file="G.marker.csv",header=T)
G.ped<-read.csv(file="G.ped.csv",header=T)
GmN<-paste0(c('GOF','GD','G05','GMF','Greg'),'.grm',sep='')
Gmat<-vector("list", 5)
for(i in 1:5){
cat('For matrix: ',i,'-----')
Gmat[[i]]<-GenomicRel( G.marker,i, ped=G.ped, Gres=T)
write.csv(Gmat[[i]],file=GmN[[i]],row.names=F,quote=F)
}
运行过程:
> for(i in 1:5){
+ cat('For matrix: ',i,'-----')
+ Gmat[[i]]<-GenomicRel( G.marker,i, ped=G.ped, Gres=T)
+ write.csv(Gmat[[i]],file=GmN[[i]],row.names=F,quote=F)
+