Tests every marker one at a time with the variance components held at their values from the model without a marker (the population parameters previously determined approximation): the ratio of the residual to the genetic variance is fixed, the residual scale is re-estimated at each marker, and the marker effect is tested by a t statistic on \(n - p - 1\) degrees of freedom. Under the rotation every marker column is rotated with the same matrix as the means, so the scan is the ordinary mixed-model GWAS of the rotated data. The two approximate schemes are offered for comparison: inverse-variance weighting divides each mean by its own standard error and treats the estimation errors as uncorrelated; the unweighted analysis ignores the first-stage variance-covariance matrix altogether. Each scheme fits its own model without a marker.
Usage
genome_scan(
x,
markers,
scheme = "rotated",
alpha = 0.05,
chunk_size = 5000,
model = NULL,
fit = c("free", "residual_one")
)Arguments
- x
a
rotationobject.- markers
numeric matrix of marker dosages (0, 1, 2), accessions in rows with the accession names as row names, markers in columns; complete.
- scheme
the scheme or schemes to scan under:
"rotated"(the default),"inverse_variance","unweighted", or several of them.- alpha
the genome-wide level of the Bonferroni threshold, applied to the number of markers with a test.
- chunk_size
markers per block of matrix products.
- model
optionally an
independent_effectobject: the scan then runs under the rotated model with the independent effect, at its fitted variance components (schememust be"rotated"). A warning is given when that model's free fit has the residual variance at the boundary of zero, where the model is the unweighted analysis.- fit
with
model, which of its fits supplies the variance components held in the scan: the free fit ("free", the default) or the fit with the residual variance fixed at one ("residual_one").
Value
a data frame of class genome_scan with one row per marker and
scheme: marker, scheme, maf, beta (the marker effect per dose),
se, t, neglog10p and significant (above the Bonferroni
threshold). A marker without variance has NA in the test columns.
Attributes: fits, a data frame with one row per scheme (the genetic,
independent and residual variances of the model without a marker, the
ratio of residual to genetic variance, the boundary status, the genomic
inflation factor of the scan, the numbers of markers tested and
significant), threshold (in \(-\log_{10} p\)), alpha, n, p,
df and model ("additive", "additive + independent effect" or
"additive + independent effect, residual variance fixed at one").
Details
The residual variance is estimated in the scan under every scheme, also
under the rotation, where its target is one; the test of the residual
variance is a separate step (specification_test()). Markers close to the significance threshold can
be refitted afterwards with the marker in the model and the residual
variance fixed at one (refit_markers()). When the test finds the residual
variance above one, the scan can be run under the model extended by an
effect independent across accessions, from independent_effect(), through
model; that model is defined under the rotation only, and its variance
components are held at their fitted values in the same way, either from
its free fit or, with fit = "residual_one", from its fit with the
residual variance fixed at one. The paper adds the effect to the model
when the test rejects but does not evaluate a scan under the extended
model; the option is offered here so that the scan can follow the model
the test led to.
Examples
ex <- rotationGWAS:::toy_trial(n = 40, n_markers = 60, seed = 2)
r <- rotation(ex$means, ex$Omega, ex$relationship, ex$covariates)
s <- genome_scan(r, ex$markers, scheme = c("rotated", "unweighted"))
summary(s)
#> Genome scan of 40 accessions, 3 fixed effects, 36 degrees of freedom per marker; Bonferroni threshold 3.079 in -log10 p at alpha 0.05
#> scheme genetic residual boundary inflation tested significant
#> rotated 0.5384 3.048 none 0.6445 60 0
#> unweighted 0.7823 2.814 none 0.7318 60 0
#>
#> Strongest markers, rotated:
#> marker beta se neglog10p
#> m0021 -1.297 0.4289 2.339
#> m0053 1.181 0.4460 1.922
#> m0052 2.144 0.8459 1.802
#> m0038 1.115 0.4690 1.641
#> m0017 1.565 0.6801 1.564
#>
#> Strongest markers, unweighted:
#> marker beta se neglog10p
#> m0017 2.061 0.7318 2.106
#> m0053 1.357 0.4840 2.092
#> m0021 -1.297 0.4690 2.051
#> m0052 2.456 0.9384 1.890
#> m0038 1.176 0.5046 1.592
head(s[order(-s$neglog10p), ])
#> marker scheme maf beta se t neglog10p
#> 21 m0021 rotated 0.4500 -1.296880 0.4288650 -3.023982 2.339151
#> 77 m0017 unweighted 0.0875 2.061069 0.7317892 2.816479 2.106178
#> 113 m0053 unweighted 0.3875 1.356994 0.4839905 2.803761 2.092154
#> 81 m0021 unweighted 0.4500 -1.297462 0.4690245 -2.766299 2.051022
#> 53 m0053 rotated 0.3875 1.180678 0.4460400 2.647024 1.921876
#> 112 m0052 unweighted 0.0500 2.456317 0.9383764 2.617624 1.890479
#> significant
#> 21 FALSE
#> 77 FALSE
#> 113 FALSE
#> 81 FALSE
#> 53 FALSE
#> 112 FALSE