Here, I released AFEchidna, an R package based on Echidna software, and demonstrated how to use a mixed linear model to generate solutions for variance components, genetic parameters, and random effects BLUPs.
The main functions in AFEchidna:
- get.es0.file: generate es0 file
- echidna(): specify mixed linear model
- Var(): output variance components
- plot(): model diagnose plots
- pin(): calculate genetic parameters
- predict(): model predictions
- coef(): model equation solutions
- model.comp(): compare different models
- update(): run new mode
library(AFEchidna) setwd("D:\\Rdata") get.es0.file(dat.file=" Provenance.csv") # generate .es fileget.es0.file(es.file=" Provenance.es") # generate .es0 fileSpecified a mixed model:
m1.esr <- echidna( fixed=height~1+Prov, random=~Block*Female, residual=~units, es0.file='Provenance.es0')Output related results:
> Var(m1.esr) Term Sigma SE Z.ratio1 Residual 2.52700 0.131470 19.2211152 Block 0.10749 0.089924 1.1953433 Female 0.18950 0.083980 2.2564904 Block:Female 0.19762 0.086236 2.291618> pin(m1.esr, mulp=c(Va~4*V3,+ Vp~V1+V3+V4,+ h2~4*V3/(V1+V3+V4)), digit=5) Term Estimate SE1 Va 0.75801 0.3359211 Vp 2.91415 0.1497312 h2 0.26011 0.10990> coef(m1.esr)$fixed Term Level Effect SE1 Prov 11 0.0000000 0.00000002 Prov 12 -1.6656325 0.37413443 Prov 13 -0.6237406 0.37013464 Prov 0 -1.2201920 0.37698925 mu 1 11.5120637 0.3619919> coef(m1.esr)$random %>% head Term Level Effect SE1 Block 2 0.3110440 0.18547182 Block 3 0.1268193 0.18582903 Block 4 0.2055624 0.18581584 Block 5 -0.2918516 0.18668715 Block 0 -0.3515741 0.18782876 Female 191 -0.1633745 0.3433451A easy way to run batch analysis:
mt.esr <- update(m1.esr,trait=~height+diameter+volume,batch=TRUE)> Var(mt.esr)V1-Residual; V2-Block; V3-Female; V4-Block.FemaleConverge: 1 means True; 0 means FALSE. V1 V2 V3 V4 V1.se V2.se V3.se V4.se Converge maxitheight 2.5270 0.107490 0.18950 0.19762 0.13147 0.089924 0.08398 0.08624 1 4diameter 16.8810 0.167130 0.80698 0.69100 0.87659 0.198100 0.41470 0.50067 1 5volume 0.0037 0.000084 0.00022 0.00016 0.00019 0.000077 0.00010 0.00011 1 6