Checks and aligns the second-stage inputs by accession name, builds the rotation matrix \(W = \Omega^{-1/2}\) (the symmetric root), rotates the means, the intercept, the covariates and the relationship matrix with it, and fits the rotated model without a marker twice: with the residual variance estimated, and with it fixed at one. After the rotation the estimation errors of the means are independent with unit variance, so the second stage has the form of an ordinary mixed-model GWAS (Piepho et al. 2012). Every other function of the package takes the object returned here.
Arguments
- means
numeric vector of adjusted accession means (BLUEs, accessions fixed in the first stage), with the accession names as names.
- Omega
the variance-covariance matrix of the adjusted means from the first stage, an n x n matrix with the accession names as dimnames (the matrix itself, not its inverse and not a correlation matrix). A diagonal matrix, built from standard errors alone, is accepted: the rotation then reduces to inverse-variance weighting, the object says so, and the functions that need the full matrix (
efficiency(),estimation_share(),specification_test(),independent_effect()) refuse it.- relationship
the relationship matrix among accessions, n x n with dimnames, on its original scale; it may be singular (for example a centred VanRaden matrix).
- covariates
optional numeric matrix or data frame of covariates with the accession names as row names, for example principal components. The intercept is added by the package and must not be among the covariates.
- max_condition
the largest condition number of
Omegaaccepted before the rotation is refused.
Value
an object of class rotation, a list with the accession order
(ids), n, p, diagonal (whether Omega is diagonal), the rotation matrix W, the rotated pieces
(y, X with the rotated intercept as its first column, K), the aligned
unrotated inputs (means, Omega, relationship, covariates), a
numeric summary of Omega (omega), and the fits of the model without a
marker (fit: free with both components estimated, one with the
residual variance fixed at one).
References
Piepho, H.-P., J. Möhring, T. Schulz-Streeck and J. O. Ogutu, 2012 A stage-wise approach for the analysis of multi-environment trials. Biometrical Journal 54: 844-860.
Examples
ex <- rotationGWAS:::toy_trial(n = 40, n_markers = 60, seed = 2)
r <- rotation(ex$means, ex$Omega, ex$relationship, ex$covariates)
r
#> Rotation of 40 adjusted means; 3 fixed effects (the rotated intercept and 2 covariates )
#> Omega: diagonal from 0.515 to 1.34 (ratio 2.61); mean |correlation| 0.0229, largest 0.292; condition number 5.23
#> Model without a marker: genetic variance 0.5384, residual variance 3.048 (target one)
#> With the residual variance fixed at one: genetic variance 3.095