yzhlinscau的个人博客分享 http://blog.sciencenet.cn/u/yzhlinscau

博文

AFEchidna包增加函数echidnaT

已有 1246 次阅读 2021-2-14 16:41 |个人分类:Echidna|系统分类:科研笔记

AFEchidna包增加了函数echidnaT(),其用法类似echidna(),如下:

echidnaT(es0.file,trait,fixed,random,residual,
                  delf,foldN,mulT,mulN,
                  met,cycle,
                  trace, maxit,
                  batch,
                  predict,vpredict,
                  qualifier,jobqualf)

echidnaT利用参数batch,容纳了echidna()的参数batch.G和batch.R,达到一次性运行多个性状和多个G结构及R结构。

简单示例如下:

library(AFEchidna)
path<-"C:/Users/yzhlinscau/Desktop/echi/exam"
setwd(path)

mrun<-echidnaT(es0.file="MET.es0", trait=~yield+t2,             fixed=y~1+Loc,             random=c(~Genotype:Loc,~Genotype:xfa2(Loc)),             residual=c(R1~sat(Loc):ar1(Col):ar1(Row),R2~sat(Loc):units),             batch=T,             met=T)

运行过程如下:

> mrun<-echidnaT(es0.file="MET.es0", trait=~yield+t2,
+              fixed=y~1+Loc,
+              random=c(~Genotype:Loc,~Genotype:xfa2(Loc)),
+              residual=c(R1~sat(Loc):ar1(Col):ar1(Row),R2~sat(Loc):units),
+              batch=T,
+              met=T)
Program starts running batch analysis ------
Program runs for 2 more G-structure at one time.
Program runs for 2 more R-structure at one time.

run trait yield  -- -- --:
run  G1 -- random effects: Genotype:Loc run  R1 -- residual effects: sat(Loc):ar1(Col):ar1(Row)
Running Echidna for analysis:  yield   Sun Feb 14 16:16:02 2021  Iteration     LogL NEDF
1         1 -1289.61  630
2         2 -1248.28  630
3         3 -1213.33  630
4         4 -1205.09  630
5         5 -1204.11  630
6         6 -1204.05  630
7         7 -1204.05  630
Sun Feb 14 16:16:02 2021 LogL Converged run  G1 -- random effects: Genotype:Loc run  R2 -- residual effects: sat(Loc):units Running Echidna for analysis:  yield   Sun Feb 14 16:16:03 2021  Iteration     LogL NEDF
1         1 -1310.30  630
2         2 -1250.82  630
3         3 -1239.42  630
4         4 -1238.61  630
5         5 -1238.60  630
6         6 -1238.60  630
Sun Feb 14 16:16:03 2021 LogL Converged run  G2 -- random effects: Genotype:xfa2(Loc)
run  R1 -- residual effects: sat(Loc):ar1(Col):ar1(Row)
Running Echidna for analysis:  yield   Sun Feb 14 16:16:04 2021   Iteration     LogL NEDF
1          1 -1311.29  630
2          2 -1281.15  630
3          3 -1222.34  630
4          4 -1211.13  630
5          5 -1190.16  630
6          6 -1186.36  630
7          7 -1183.56  630
8          8 -1181.45  630
9          9 -1179.86  630
10        10 -1178.65  630
11        11 -1177.75  630
12        12 -1177.07  630
13        13 -1175.09  630
14        14 -1175.02  630
15        15 -1174.98  630
16        16 -1174.98  630
Sun Feb 14 16:16:05 2021 LogL Converged run  G2 -- random effects: Genotype:xfa2(Loc)
run  R2 -- residual effects: sat(Loc):units Running Echidna for analysis:  yield   Sun Feb 14 16:16:05 2021   Iteration     LogL NEDF
1          1 -1333.17  630
2          2 -1269.21  630
3          3 -1230.90  630
4          4 -1218.47  630
5          5 -1213.82  630
6          6 -1212.07  630
7          7 -1211.38  630
8          8 -1211.09  630
9          9 -1210.98  630
10        10 -1210.94  630
11        11 -1210.93  630
12        12 -1210.93  630
Sun Feb 14 16:16:06 2021 LogL Converged run trait  t2 -- -- --:
run  G1 -- random effects: Genotype:Loc run  R1 -- residual effects: sat(Loc):ar1(Col):ar1(Row)
Running Echidna for analysis:   t2 Sun Feb 14 16:16:06 2021  Iteration     LogL NEDF
1         1 -1505.75  642
2         2 -1348.55  642
3         3 -1311.52  642
4         4 -1306.99  642
5         5 -1306.85  642
6         6 -1306.85  642
Sun Feb 14 16:16:07 2021 LogL Converged run  G1 -- random effects: Genotype:Loc run  R2 -- residual effects: sat(Loc):units Running Echidna for analysis:   t2 Sun Feb 14 16:16:07 2021  Iteration     LogL NEDF
1         1 -1492.14  642
2         2 -1403.50  642
3         3 -1326.30  642
4         4 -1313.38  642
5         5 -1312.65  642
6         6 -1312.64  642
Sun Feb 14 16:16:08 2021 LogL Converged run  G2 -- random effects: Genotype:xfa2(Loc)
run  R1 -- residual effects: sat(Loc):ar1(Col):ar1(Row)
Running Echidna for analysis:   t2 Sun Feb 14 16:16:08 2021   Iteration     LogL NEDF
1          1 -1547.90  642
2          2 -1486.87  642
3          3 -1439.19  642
4          4 -1402.68  642
5          5 -1375.05  642
6          6 -1354.31  642
7          7 -1338.94  642
8          8 -1327.60  642
9          9 -1308.18  642
10        10 -1305.47  642
11        11 -1303.56  642
12        12 -1302.20  642
13        13 -1301.24  642
14        14 -1300.55  642
15        15 -1298.89  642
16        16 -1298.82  642
17        17 -1298.78  642
18        18 -1298.78  642
Sun Feb 14 16:16:09 2021 LogL Converged run  G2 -- random effects: Genotype:xfa2(Loc)
run  R2 -- residual effects: sat(Loc):units Running Echidna for analysis:   t2 Sun Feb 14 16:16:10 2021   Iteration     LogL NEDF
1          1 -1526.90  642
2          2 -1455.98  642
3          3 -1371.10  642
4          4 -1331.56  642
5          5 -1314.58  642
6          6 -1307.65  642
7          7 -1305.60  642
8          8 -1305.04  642
9          9 -1304.73  642
10        10 -1304.69  642
11        11 -1304.67  642
12        12 -1304.64  642
13        13 -1304.62  642
14        14 -1304.60  642
15        15 -1304.60  642
Sun Feb 14 16:16:10 2021 LogL Converged

结果查看:

> yres<-mrun[[1]] # trait
> yres.G1<-yres[[1]] # G1
> m1<-yres.G1$R1
> class(m1)
[1] "esR"
> Var(m1)                                    Term     Sigma       SE     Z.ratio
1                               Residual  1.000000 0.000000         Inf
2                           Genotype.Loc  3.032800 0.754500  4.01961564
3                               ar1(Col)  0.010667 0.112900  0.09448184
4  sat(Loc,1).ar1(Col).ar1(Row);ar1(Row) -0.023540 0.124060 -0.18974690
5  sat(Loc,1).ar1(Col).ar1(Row);ar1(Row) 13.143000 2.091800  6.28310546
6                               ar1(Col)  0.173700 0.109940  1.57995270
7  sat(Loc,2).ar1(Col).ar1(Row);ar1(Row)  0.268190 0.123470  2.17210658
8  sat(Loc,2).ar1(Col).ar1(Row);ar1(Row) 20.948000 3.460700  6.05311064
9                               ar1(Col)  0.558990 0.082029  6.81454120
10 sat(Loc,3).ar1(Col).ar1(Row);ar1(Row) -0.058038 0.137610 -0.42175714
11 sat(Loc,3).ar1(Col).ar1(Row);ar1(Row) 23.010000 4.360300  5.27715983
12                              ar1(Col)  0.501670 0.101850  4.92557683
13 sat(Loc,4).ar1(Col).ar1(Row);ar1(Row)  0.139040 0.117820  1.18010525
14 sat(Loc,4).ar1(Col).ar1(Row);ar1(Row) 28.498000 5.512700  5.16951766
15                              ar1(Col) -0.074562 0.136530 -0.54612173
16 sat(Loc,5).ar1(Col).ar1(Row);ar1(Row)  0.014553 0.127140  0.11446437
17 sat(Loc,5).ar1(Col).ar1(Row);ar1(Row)  9.145600 1.465700  6.23974893
18                              ar1(Col)  0.331200 0.100730  3.28799762
19 sat(Loc,6).ar1(Col).ar1(Row);ar1(Row)  0.122330 0.139670  0.87585022
20 sat(Loc,6).ar1(Col).ar1(Row);ar1(Row)  8.085400 1.390300  5.81557937
> m2<-yres.G1$R2
> Var(m2)          Term   Sigma      SE  Z.ratio
1     Residual  1.0000 0.00000      Inf
2 Genotype.Loc  2.8914 0.82762 3.493632
3        units 13.2700 2.11590 6.271563
4        units 20.5640 3.17370 6.479503
5        units 24.0250 3.71870 6.460591
6        units 27.7710 4.19240 6.624129
7        units  9.2094 1.47380 6.248745
8        units  8.0193 1.27040 6.312421

由于涉及了性状、G结构、R结构的三个层次,结果读取方面就是比较复杂。程序的逻辑是:第一层次是性状,第二层次是G结构,第三层次是R结构。

今年将陆续完善和更新AFEchidna包。

AFEchidna包最新版:V0.1.0
更新: 2021-02-14



https://blog.sciencenet.cn/blog-1114360-1272170.html

上一篇:AFEchidna包主函数echidna更新
下一篇:AFEchidna包的简单示例1--单变量模型
收藏 IP: 202.105.47.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-20 09:02

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部