| phenoRegressor.BGLR | R Documentation |
This is a wrapper around BGLR. As such, it won't work if BGLR package
is not installed.
Genotypes are modeled using the specified type. If type is 'RKHS' (and only
in this case) the covariance/kinship matrix covariances is required, and it will be modeled
as matrix K in BGLR terms. In all other cases genotypes and covariances are put in the model
as X matrices.
Extra covariates, if present, are modeled as FIXED effects.
phenoRegressor.BGLR(
phenotypes,
genotypes,
covariances,
extraCovariates,
type = c("FIXED", "BRR", "BL", "BayesA", "BayesB", "BayesC", "RKHS"),
...
)
phenotypes |
phenotypes, a numeric array (n x 1), missing values are predicted |
genotypes |
SNP genotypes, one row per phenotype (n), one column per marker (m), values in 0/1/2 for
diploids or 0/1/2/...ploidy for polyploids. Can be NULL if |
covariances |
square matrix (n x n) of covariances. Can be NULL if |
extraCovariates |
extra covariates set, one row per phenotype (n), one column per covariate (w). If NULL no extra covariates are considered. |
type |
character literal, one of the following: FIXED (Flat prior), BRR (Gaussian prior), BL (Double-Exponential prior), BayesA (scaled-t prior), BayesB (two component mixture prior with a point of mass at zero and a scaled-t slab), BayesC (two component mixture prior with a point of mass at zero and a Gaussian slab) |
... |
extra parameters are passed to |
The function returns a list with the following fields:
predictions : an array of (n) predicted phenotypes, with NAs filled and all other positions repredicted (useful for calculating residuals)
hyperparams : empty, returned for compatibility
extradata : list with information on trained model, coming from BGLR
BGLR
Other phenoRegressors:
phenoRegressor.RFR(),
phenoRegressor.SVR(),
phenoRegressor.dummy(),
phenoRegressor.rrBLUP(),
phenoregressor.BGLR.multikinships()
## Not run:
#using the GROAN.KI dataset, we regress on the dataset and predict the first ten phenotypes
phenos = GROAN.KI$yield
phenos[1:10] = NA
#calling the regressor with Bayesian Lasso
results = phenoRegressor.BGLR(
phenotypes = phenos,
genotypes = GROAN.KI$SNPs,
covariances = NULL,
extraCovariates = NULL,
type = 'BL', nIter = 2000 #BGLR-specific parameters
)
#examining the predictions
plot(GROAN.KI$yield, results$predictions,
main = 'Train set (black) and test set (red) regressions',
xlab = 'Original phenotypes', ylab = 'Predicted phenotypes')
points(GROAN.KI$yield[1:10], results$predictions[1:10], pch=16, col='red')
#printing correlations
test.set.correlation = cor(GROAN.KI$yield[1:10], results$predictions[1:10])
train.set.correlation = cor(GROAN.KI$yield[-(1:10)], results$predictions[-(1:10)])
writeLines(paste(
'test-set correlation :', test.set.correlation,
'\ntrain-set correlation:', train.set.correlation
))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.