masbayes: Bayesian Genomic Prediction for SNP and Multi-allelic Markers

masbayes: Bayesian Genomic Prediction for SNP and Multi-allelic Markers

Description

masbayes implements BayesR (four-class mixture prior) and BayesA (marker-specific variance prior) for genomic prediction using biallelic SNP or multi-allelic markers. Both methods are available as full MCMC or stochastic EM; continuous (Gaussian) and binary (probit) traits are supported natively via Rust backend.

Statistical model

The general linear model shared by BayesR and BayesA is:

y = + W+ , (0,,_e^2 I)

where \(y\) is the phenotype vector, \(\mu\) is the intercept, \(W\) is the marker design matrix (from construct_wah_matrix for multi-allelic or construct_snp_matrix for SNP markers), \(\beta\) is the vector of allele effects, and \(\sigma_e^2\) is the residual variance. When fixed effects are included:

\(y = \mathbf{1}\mu + X\alpha + W\beta + \varepsilon\)

General assumptions

  • Phenotypic observations are conditionally independent given the genetic and fixed effects.

  • Residuals \(\varepsilon \sim \mathcal{N}(0,\,\sigma_e^2 I)\); for binary traits the probit model with Albert-Chib data augmentation is used (liability scale, \(\sigma_e^2 = 1\)).

  • Allele effects \(\beta_j\) are a priori independent across loci; the prior distribution differs between BayesR and BayesA.

  • The design matrix \(W\) is centred (column mean zero) to ensure identifiability of the intercept \(\mu\).

  • For multi-allelic markers the most-frequent allele per block is treated as the baseline reference and excluded from \(W\).

How the model works (marker level)

masbayes estimates allele effects individually at the marker level, rather than aggregating them into a population-level relationship matrix.

BayesR places a four-component mixture prior on each allele effect (Erbe et al., 2012):

j ,,^2 ;; _0,(0,0) + 1,(0,,0.001^2) + 2,(0,,0.01^2) + 3,(0,,0.1^2)

Most alleles are shrunk to zero (\(\pi_0\)), while a small proportion carry small, medium, or large effects — enabling implicit variable selection.

BayesA assigns each allele a marker-specific variance from a scaled inverse chi-squared distribution (Meuwissen et al., 2001):

j {j}^2 (0,,{j}^2), {_j}^2 {-2}(,,S2)

allowing heavier-tailed effect-size distributions than ridge regression.

Posterior parameters are inferred via MCMC (Gibbs sampling) or stochastic EM. Genomic estimated breeding values (GEBVs) are computed by summing posterior mean allele effects across all loci:

\(\widehat{g}_i = \hat{\mu} + \mathbf{w}_i^\top \hat{\boldsymbol{\beta}}\)

Heritability is estimated as h^2 = (W) / [(W) + _e^2].

Main functions

construct_wah_matrix
Build the multi-allelic \(W_{\alpha h}\) design matrix from phased haplotype data.
construct_snp_matrix
Build the SNP design matrix (VanRaden centering or z-score standardisation).
run_bayesr
Fit BayesR (four-class mixture).
run_bayesa
Fit BayesA (marker-specific variance).
predict.masbayes_bayesr, predict.masbayes_bayesa
Predict GEBVs and compute accuracy metrics (S3 methods).
summary.masbayes_bayesr, summary.masbayes_bayesa
Full posterior report including \(h^2\), ESS, Geweke, and variance components (S3 methods).

References

  • Meuwissen, T. H. E., Hayes, B. J., & Goddard, M. E. (2001). Prediction of total genetic value using genome-wide dense marker maps. Genetics, 157(4), 1819–1829. doi:10.1093/genetics/157.4.1819

  • Erbe, M., Hayes, B. J., Matukumalli, L. K., Goswami, S., Bowman, P. J., Reich, C. M., Mason, B. A., & Goddard, M. E. (2012). Improving accuracy of genomic predictions within and between dairy cattle breeds with imputed high-density single nucleotide polymorphism panels. Journal of Dairy Science, 95(7), 4114–4129. doi:10.3168/jds.2011-5019

  • Da, Y. (2015). Multi-allelic haplotype model based on genetic partition for genomic prediction and variance component estimation using SNP markers. BMC Genetics, 16(1), 144. doi:10.1186/s12863-015-0301-1

Author(s)

Maintainer: Agus Wibowo [email protected]