读者如果想使用AFEchidna包进行数据分析,须生成.es0文件,其是程序模版文件,仅包含数据域定义和数据文件。
AFEchidna包里的get.es0.file()函数就是用于生成.es0文件,其用法如下:
get.es0.file(dat.file=NULL,es.file=NULL,
path=NULL,message= FALSE,
softp=NULL,
faS=NULL,pedS=NULL)
## 参数含义
---- dat.file: 数据集
---- es.file: 由dat.file生成的.es文件
---- path: 数据集所在路径,可忽略
---- message: 是否需要弹出窗口,可忽略
---- softp: echidna主程序所在路径,可忽略
---- faS: 数据集中因子变量所在位置,
比如faS=1:2,表示第1、2个变量为因子型
---- pedS: 数据集中需要关联谱系的因子,
比如pedS=1:2,表示第1个因子变量与谱系关联
get.es0.file()分两步来生成.es0文件,首先通过数据文件dat.file生成.es文件,再通过.es文件es.file生成.es0文件。即get.es0.file()需要运行两次。
下述简单举例说明。
示例1–非谱系数据
get.es0.file(dat.file='pine_provenance.csv') # .es file
get.es0.file(es.file='pine_provenance.es') # .es0 file
运行过程:
> get.es0.file(dat.file='pine_provenance.csv') # .es file
Generating .es temple for pine_provenance.csv : --done!
> get.es0.file(es.file='pine_provenance.es') # .es0 file
Generating .es0 file: -- done!
然后通过file.edit('pine_provenance.es0')
打开生成的.es0文件,结果如下:
#!WORK 2 !REN !ARG
TITLE: pine_provenance #!DOPART $1
# Treeid,Female,Male,Prov,Block,Plot,height,diameter,volume ...
# 170.1,170,0,10,1,3,12.5,19.6,0.1441 ...
Treeid !I # 170.1
Female !I # 170
Male !I # 0
Prov !I # 10
Block !I # 1
Plot !I # 3
height # 12.5
diameter # 19.6
volume # 0.1441
# Verify data fields are correctly classified ...
pine_provenance.csv !SKIP 1
读者需要确认上述文件里的数据域是否定义准确,如有问题,可以直接修改保存即可。
注意:数据文件里的试验因子名均是大写字母开头,get.es0.file()
函数会自动识别,否则需要通过在第二步中通过参数faS指定。假设所有变量名都是小写字母,前6个是试验因子,则可通过下述代码来设定:
get.es0.file(es.file='pine_provenance.es', faS=1:6) # .es0 file
示例2–谱系数据
假定上述数据文件里的第一个变量跟谱系文件关联,则示范如下:
get.es0.file(dat.file='pine_provenance.csv') # .es file
get.es0.file(es.file='pine_provenance.es', pedS=1) # .es0 file
运行过程:
> get.es0.file(dat.file='pine_provenance.csv') # .es file
Generating .es temple for pine_provenance.csv : --done!
> get.es0.file(es.file='pine_provenance.es',pedS=1) # .es0 file
Make sure there has a correct pedigree file in the .es0 file.
Generating .es0 file: -- done!
然后通过file.edit('pine_provenance.es0')
打开生成的.es0文件,结果如下:
#!WORK 2 !REN !ARG
TITLE: pine_provenance #!DOPART $1
# Treeid,Female,Male,Prov,Block,Plot,height,diameter,volume ...
# 170.1,170,0,10,1,3,12.5,19.6,0.1441 ...
Treeid !P # 170.1
Female !I # 170
Male !I # 0
Prov !I # 10
Block !I # 1
Plot !I # 3
height # 12.5
diameter # 19.6
volume # 0.1441
# Verify data fields are correctly classified ...
pine_provenance.csv !SKIP 1 # pedigree file, be careful here.
pine_provenance.csv !SKIP 1 # data file
注意:get.es0.file()
函数会根据参数pedS指定位置设置谱系关联的试验因子,用!P表示,并自动复制原始数据作为谱系文件(倒数第二行),读者需要判断其是否合适,如果有误,需手动修改谱系文件名,然后保存即可。
下一步将演示如何将生成的基因组关系矩阵文件放置到.es0文件里。
参考文献:
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.