BayesN TWAS weights (Gaussian prior, ridge-equivalent)
Source:R/regularizedRegressionWrappers.R
bayesNWeights.RdUse Gaussian distribution as prior. Posterior means will be BLUP, equivalent to Ridge Regression.
Usage
bayesNWeights(
X,
y,
Z = NULL,
h2 = NULL,
nit = 5000,
nburn = 1000,
nthin = 5,
methodArgs = QggOptions()
)Arguments
- X
Numeric genotype / design matrix (samples x variants).
- y
Numeric response (phenotype) vector of length
nrow(X).- Z
Optional numeric matrix of fixed-effect covariates, or
NULL.- h2
Numeric or
NULL. Prior heritability;NULLleaves the engine's own default.- nit
Integer. Total MCMC iterations. Default
5000.- nburn
Integer. Burn-in iterations. Default
1000.- nthin
Integer. Thinning interval for retained MCMC samples. Default
5.- methodArgs
Options forwarded to
qgg::gbayes, built withQggOptions. A bare list is refused: it cannot be checked against the engine, so a misspelled option would be silently ignored.
Value
A numeric vector of effect-size weights, one per variant (column of
X); columns dropped for zero variance receive weight 0.
Examples
data(eqtlRegionExample)
X <- eqtlRegionExample$X[, 1:30]
y <- eqtlRegionExample$yRes
bayesNWeights(X, y)
#> Type of analysis performed: st-blr-individual-level-dense-ld
#> [1] -0.035538371 -0.042740916 0.016500483 -0.005125461 -0.004186801
#> [6] -0.010866823 -0.011351706 0.024922519 0.009398730 0.014700825
#> [11] -0.004026619 -0.042731837 -0.009060808 0.010570838 -0.008892798
#> [16] 0.029739587 -0.005919621 -0.008282481 0.009577588 -0.009052599
#> [21] -0.005856381 -0.012898004 -0.009089858 -0.002869922 -0.016079454
#> [26] -0.012692163 -0.035911203 -0.009195258 0.012264962 0.013961942