Stage1: Stage 1 analysis of multi-environment trials

View source: R/Stage1.R

Stage1R Documentation

Stage 1 analysis of multi-environment trials

Description

Computes genotype BLUEs for each experiment

Usage

Stage1(
  filename,
  traits,
  effects = NULL,
  solver = "asreml",
  spline = NULL,
  silent = TRUE,
  workspace = c("500mb", "500mb"),
  max.iter = 30
)

Arguments

filename

Name of CSV file

traits

trait names (see Details)

effects

data frame specifying other effects in the model (see Details)

solver

one of the following: "asreml","spats"

spline

vector of variable names for 2D spline with SpATS

silent

TRUE/FALSE, whether to suppress REML output

workspace

memory limits for ASRreml-R

max.iter

maximum number of iterations for ASRreml-R

Details

The input file must have one column labeled "id" for the individuals and one labeled "env" for the environments. The data for each environment are analyzed independently with a linear mixed model. Although not used in Stage1, to include a genotype x location effect in Stage2, a column labeled "loc" should be present in the input file.

Argument effects is used to specify other i.i.d. effects besides genotype and has three columns: name, fixed, factor. The "name" column is a string that must match a column in the input file. The fixed column is a logical variable to indicate whether the effect is fixed (TRUE) or random (FALSE). The factor column is a logical variable to indicate whether the effect is a factor (TRUE) or numeric (FALSE).

Argument solver specifies which software to use for REML. Current options are "asreml" and "spats". For "spats", the argument spline must be a vector of length two, with the names of the x and y variables (respectively) for the 2D spline.

The heritability and residuals in the output are based on a random effects model for id.

Missing response values are omitted for single-trait analysis but retained for multi-trait analysis (unless both traits are missing), to allow for prediction in Stage 2.

Argument workspace is a vector of length two containing the workspace and pworkspace limits for ASReml-R, with default values of 500mb. If you get an error about insufficient memory, try increasing the appropriate value (workspace for variance estimation and pworkspace for BLUE computation).

For multiple traits, only "asreml" is supported, and only the BLUE model is run, so the returned object does not contain H2.

If the input file has a column "expt", this allows for the use of separate spatial models for multiple experiments within an environment (only for single trait): each experiment is first analyzed separately, and then the BLUEs from all experiments per env are jointly analyzed to compute a single BLUE per env. The estimation errors from each experiment are propagated into the multi-expt model using ASReml-R. The situation is different with multi-trait analysis, as all experiments are analyzed jointly per env, with a fixed effect for expt but a common residual model. Any additional cofactors (e.g., block) that are nested within expt need to be explicitly nested!

Value

List containing

blues

data frame of BLUEs

vcov

list of variance-covariance matrices for the BLUEs, one per env

fit

data frame with broad-sense H2 (plot basis) and/or AIC

resid

For single trait, list of diagnostic plots and data frame of residuals. For multi-trait, list of resid var-cov matrices.


jendelman/StageWise documentation built on Feb. 23, 2025, 11 a.m.