- Notifications
You must be signed in to change notification settings - Fork4
Utilities for field trial analysis.
License
Unknown, MIT licenses found
Licenses found
AparicioJohan/agriutilities
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
agriutilities is anR package designed to make the analysis of fieldtrials easier and more accessible for everyone working in plantbreeding. It provides a simple and intuitive interface for conductingsingle andmulti-environmental trial analysis, with minimalcoding required. Whether you’re a beginner or an experienced user,agriutilities will help you quickly and easily carry out complexanalyses with confidence. With built-in functions for fitting LinearMixed Models (LMM), agriutilities is the ideal choice for anyone whowants to save time and focus on interpreting their results.
install.packages("agriutilities")You can install the development version of agriutilities fromGitHub with:
remotes::install_github("AparicioJohan/agriutilities")
This is a basic example which shows you how to use some of the functionsof the package.
The functioncheck_design_met helps us to check the quality of thedata and also to identify the experimental design of the trials. Thisworks as a quality check or quality control before we fit any model.
library(agriutilities)library(agridat)data(besag.met)dat<-besag.metresults<- check_design_met(data=dat,genotype="gen",trial="county",traits="yield",rep="rep",block="block",col="col",row="row")
plot(results,type="connectivity")
plot(results,type="missing")
Inspecting the output.
print(results)---------------------------------------------------------------------SummaryTraitsbyTrial:---------------------------------------------------------------------# A tibble: 6 × 11countytraitsMinMeanMedianMaxSDCVnn_missmiss_perc<fct><chr><dbl><dbl><dbl><dbl><dbl><dbl><int><int><dbl>1C1yield87.9149.151.200.17.70.11919860.03032C2yield24.456.152.1125.18.40.32819860.03033C3yield28.287.989.2137.19.70.22519860.03034C4yield103.145.143.190.17.10.11819860.03035C5yield66.9115.116.152.16.40.14219860.03036C6yield29.287.687.8148.26.60.30419860.0303---------------------------------------------------------------------ExperimentalDesignDetected:---------------------------------------------------------------------countyexp_design1C1row_col2C2row_col3C3row_col4C4row_col5C5row_col6C6row_col---------------------------------------------------------------------SummaryExperimentalDesign:---------------------------------------------------------------------# A tibble: 6 × 9countynn_genn_repn_blockn_coln_rownum_of_repsnum_of_gen<fct><int><int><int><int><int><int><fct><fct>1C1198643811183_963_12C2198643811183_963_13C3198643811183_963_14C4198643811183_963_15C5198643811183_963_16C6198643811183_963_1---------------------------------------------------------------------ConnectivityMatrix:---------------------------------------------------------------------C1C2C3C4C5C6C1646464646464C2646464646464C3646464646464C4646464646464C5646464646464C6646464646464---------------------------------------------------------------------FiltersApplied:---------------------------------------------------------------------Listof1$yield:Listof4..$missing_50%: chr(0)..$no_variation: chr(0)..$row_col_dup: chr(0)..$trials_to_remove: chr(0)
The results of the previous function are used insingle_trial_analysis() to fit single trial models. This function canfit, Completely Randomized Designs (CRD), Randomized Complete BlockDesigns (RCBD), Resolvable Incomplete Block Designs (res-IBD),Non-Resolvable Row-Column Designs (Row-Col) and ResolvableRow-Column Designs (res-Row-Col).
NOTE: It fits models based on the randomization detected.
obj<- single_trial_analysis(results,progress=FALSE)
Inspecting the output.
print(obj)---------------------------------------------------------------------SummaryFittedModels:---------------------------------------------------------------------traittrialheritabilityCVVarGenVarErrdesign<char><char><num><num><num><num><char>1:yieldC10.706.37005485.2808692.70982row_col2:yieldC20.3916.98723526.87283105.50494row_col3:yieldC30.6412.36684382.84379118.86865row_col4:yieldC40.418.17979435.75059136.21686row_col5:yieldC50.807.042116104.4407766.96454row_col6:yieldC60.4916.58397272.16813206.54020row_col---------------------------------------------------------------------OutliersRemoved:---------------------------------------------------------------------Null data.table (0rowsand0cols)---------------------------------------------------------------------FirstPredictedValuesandStandard Errors (BLUEs/BLUPs):---------------------------------------------------------------------traitgenotypetrialBLUEsseBLUEsBLUPsseBLUPswt<char><fctr><fctr><num><num><num><num><num>1:yieldG01C1142.93166.380244144.51515.4214810.024565492:yieldG02C1156.77656.277083155.05235.3674250.025379573:yieldG03C1126.56546.402526133.17665.4443490.024394804:yieldG04C1155.77906.391590154.24355.4400700.024478365:yieldG05C1163.98566.443261160.76205.4443140.024087326:yieldG06C1129.50926.400364134.74045.4215430.02441129
plot(obj,horizontal=TRUE,nudge_y_h2=0.12)
plot(obj,type="correlation")
The returning object is a set of lists with trial summary, BLUEs, BLUPs,heritability, variance components, potential extreme observations,residuals, the models fitted and the data used.
The results of the previous function are used inmet_analysis() to fitmulti-environmental trial models.
met_results<- met_analysis(obj,vcov="fa2",progress=FALSE)OnlineLicensecheckedoutThuOct1621:37:042025
Inspecting the output.
print(met_results)---------------------------------------------------------------------Trial Effects (BLUEs):---------------------------------------------------------------------traittrialpredicted.valuestd.errorstatus1yieldC1149.590141.369766Estimable2yieldC267.205451.137972Estimable3yieldC390.799581.441812Estimable4yieldC4148.126231.172130Estimable5yieldC5122.401951.440843Estimable6yieldC688.354371.530165Estimable---------------------------------------------------------------------Heritability:---------------------------------------------------------------------traith21yield0.8261367---------------------------------------------------------------------FirstOverallPredictedValuesandStandard Errors (BLUPs):---------------------------------------------------------------------traitgenotypepredicted.valuestd.errorstatus1yieldG01110.84292.536428Estimable2yieldG02111.38362.548777Estimable3yieldG03102.66122.551662Estimable4yieldG04115.87752.546016Estimable5yieldG05121.06402.558195Estimable6yieldG06108.94982.570048Estimable---------------------------------------------------------------------Variance-CovarianceMatrix:---------------------------------------------------------------------Correlation Matrix ('fa2'):yieldC1C2C3C4C5C6C11.000.640.710.860.950.42C20.641.000.580.860.530.70C30.710.581.000.700.710.39C40.860.860.701.000.830.58C50.950.530.710.831.000.34C60.420.700.390.580.341.00Covariance Matrix ('fa2'):yieldC1C2C3C4C5C6C178.9329.3555.7838.0585.2030.76C229.3526.4226.6121.9327.8129.68C355.7826.6178.6530.9763.2728.46C438.0521.9330.9724.5541.4923.89C585.2027.8163.2741.49102.3028.28C630.7629.6828.4623.8928.2867.99---------------------------------------------------------------------FirstStabilityCoefficients:---------------------------------------------------------------------traitgenotypesuperioritystaticwrickepredicted.value1yieldG5722.6417032.9255615.48498792.633622yieldG2917.0332233.668555.02378399.678433yieldG3417.0220333.060408.545979100.066744yieldG5916.7240234.064165.596864100.145115yieldG3115.7702731.3693210.740548102.042496yieldG1015.5921932.0399011.767180102.64704
pvals<-met_results$trial_effectsmodel<-met_results$met_models$yieldfa_objt<- fa_summary(model=model,trial="trial",genotype="genotype",BLUEs_trial=pvals,k_biplot=8,size_label_var=4,filter_score=1)
fa_objt$plots$loadings_c
fa_objt$plots$biplot
For more information and to learn more about what is described here youmay find useful the following sources: Isik, Holland, and Maltecca(2017); Rodriguez-Alvarez et al. (2018).
Please note that the agriutilities project is released with aContributor Code ofConduct.By contributing to this project, you agree to abide by its terms.
Isik, Fikret, James Holland, and Christian Maltecca. 2017.Genetic DataAnalysis for Plant and Animal Breeding. Vol. 400. Springer.
Rodriguez-Alvarez, Maria Xose, Martin P Boer, Fred A van Eeuwijk, andPaul HC Eilers. 2018. “Correcting for Spatial Heterogeneity in PlantBreeding Experiments with p-Splines.”Spatial Statistics 23: 52–71.
About
Utilities for field trial analysis.
Topics
Resources
License
Unknown, MIT licenses found
Licenses found
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.






