||
引子:
本人于2019年主译出版的《动植物育种遗传数据分析》,原书主要使用ASReml进行分析。本博客将陆续演示使用AFEchidna包达到类似ASReml的结果。
第5章的代码如下:
```javascript
// chapter 5
library(AFEchidna2)
get.es0.file(dat.file = 'diallel.csv')
get.es0.file(es.file = 'diallel.es')
file.edit('diallel.es0')
dm.m1<-echidna(fixed=density~1+SITE,
random=~SITE:BLOCK+FEMALE+and(MALE)+
SITE:BLOCK:FEMALE:MALE,
es0.file='diallel.es0')
Var(dm.m1)
# summary(dm.m1)$varcomp
dm.m2a<-echidna(fixed=density~1+SITE,
random=~SITE:BLOCK+nrm(FEMALE)+
and(MALE)+SITE:BLOCK:FEMALE:MALE,
es0.file='diallel.es0')
Var(dm.m2a)
dm.m2b<-update(dm.m2a,
random=~SITE:BLOCK+nrm(FEMALE)+and(MALE)+
SITE:BLOCK:FEMALE:MALE+SITE:FEMALE+and(SITE:MALE)
)
summary(dm.m2b)$varcomp
dm.m3 <- update(dm.m2a,random=~SITE:BLOCK+nrm(FEMALE)+
and(MALE)+SITE:BLOCK:FEMALE:MALE+
SITE:FEMALE+and(SITE:MALE)+CROSS+SITE:CROSS)
Var(dm.m3)
## Code example 5.3
get.es0.file(dat.file='maize_diallel.csv')
get.es0.file(es.file='maize_diallel.es')
file.edit('maize_diallel.es0')
mdm.m1<-echidna(PltHt~1+Year,
random=~female+and(male)+
Year:female+and(Year:male)+
r:female+and(r:male)+
Year:r:female+ and(Year:r:male)+
Year:cross+cross+
r:cross+Year:r:cross,
es0.file='maize_diallel.es0')
Var(mdm.m1)
## Code example 5.5
get.es0.file(dat.file='Pine_clones.csv')
get.es0.file(es.file='Pine_clones.es',faS=1:6,pedS=1)
file.edit('Pine_clones.es0')
ca.m1<-echidna(height8~location,
random=~location:block+nrm(cloneid)+
location:nrm(cloneid),
es0.file='Pine_clones.es0')
Var(ca.m1)
ca.m2<-update(ca.m1,random=~location:block+nrm(cloneid)+ide(cloneid))
Var(ca.m2)
pin11(ca.m2,h2i~V3/(V4+V3+V1)) # heritability
pin11(ca.m2,h2i.cm~V3/(V4+V3+V1*0.082)) # heritability for clone means
```
参考文献
1 . Zhang WH, Wei RY, Liu Y, Lin YZ. AFEchidna is a R package for genetic evaluation of plant and animal breeding datasets. BioRxiv. DOI: 10.1101/2021.06.24.449740.
2. 林元震 丁昌俊 主译,动植物育种遗传数据分析, 科学出版社,2019.9
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-22 00:18
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社