Learn R Programming

qgg (version 1.1.6)

gmap: Finemapping using Bayesian Linear Regression Models

Description

In the Bayesian multiple regression model, the posterior density of the model parameters depends on the likelihood of the data given the parameters and a prior probability for the model parameters. The choice of the prior for marker effects can influence the type and extent of shrinkage induced in the model.

Usage

gmap(
  Glist = NULL,
  stat = NULL,
  sets = NULL,
  models = NULL,
  rsids = NULL,
  ids = NULL,
  mask = NULL,
  lambda = NULL,
  vb = NULL,
  vg = NULL,
  ve = NULL,
  vy = NULL,
  pi = NULL,
  gamma = NULL,
  mc = 5000,
  h2 = 0.5,
  nub = 4,
  nug = 4,
  nue = 4,
  ssb_prior = NULL,
  ssg_prior = NULL,
  sse_prior = NULL,
  vb_prior = NULL,
  vg_prior = NULL,
  ve_prior = NULL,
  updateB = TRUE,
  updateG = TRUE,
  updateE = TRUE,
  updatePi = TRUE,
  formatLD = "dense",
  checkLD = FALSE,
  shrinkLD = FALSE,
  shrinkCor = FALSE,
  pruneLD = FALSE,
  checkConvergence = FALSE,
  critVe = 3,
  critVg = 3,
  critVb = 3,
  critPi = 3,
  critB = 3,
  critB1 = 0.5,
  critB2 = 3,
  verbose = FALSE,
  eigen_threshold = 0.995,
  cs_threshold = 0.9,
  cs_r2 = 0.5,
  nit = 1000,
  nburn = 100,
  nthin = 1,
  output = "summary",
  method = "bayesR",
  algorithm = "mcmc-eigen",
  seed = 10
)

Value

Returns a list structure including the following components:

Arguments

Glist

A list containing information on genotypic data, including SNPs, chromosomes, positions, and optionally, LD matrices.

stat

A data frame or list of summary statistics including effect sizes, standard errors, sample sizes, etc.

sets

Optional list specifying sets of SNPs for mapping.

models

Optional list of predefined models for Bayesian regression.

rsids

Vector of SNP identifiers.

ids

Vector of sample identifiers.

mask

Logical matrix indicating SNPs to exclude from analysis.

lambda

Vector of initial values for penalty parameters in the model.

vb

Initial value for the marker effect variance (default: NULL).

vg

Initial value for the genetic variance (default: NULL).

ve

Initial value for the residual variance (default: NULL).

vy

Initial value for the phenotypic variance (default: NULL).

pi

Vector of initial values for pi parameters in the model (default of pi=c(0.999,0.001) for bayesC and pi=c(0.994,0.003,0.002,0.001).

gamma

Vector of initial values for gamma parameters in the model (default of gamma=c(0,1) for bayesC and gamma=c(0,0.01,0.1,1).

mc

Number of potentiel genome-wide causal markers for the trait analysed - only used for specification of ssb_prior (default: 5000).

h2

Heritability estimate (default: 0.5).

nub, nug, nue

Degrees of freedom parameters for the priors of marker, genetic, and residual variances, respectively.

ssb_prior, ssg_prior, sse_prior

Priors for the marker, genetic, and residual variances.

vb_prior, vg_prior, ve_prior

Additional priors for marker, genetic, and residual variances (default: NULL).

updateB, updateG, updateE, updatePi

Logical values specifying whether to update marker effects, genetic variance, residual variance, and inclusion probabilities, respectively.

formatLD

Format of LD matrix ("dense" by default).

checkLD

Logical, whether to check the LD matrix for inconsistencies (default: FALSE).

shrinkLD, shrinkCor

Logical, whether to apply shrinkage to the LD or correlation matrices (default: FALSE).

pruneLD

Logical, whether to prune LD matrix (default: FALSE).

checkConvergence

Logical, whether to check for convergence of the Gibbs sampler (default: FALSE).

critVe, critVg, critVb, critPi, critB, critB1, critB2

Convergence criteria for residual, genetic, and marker variances, inclusion probabilities, and marker effects.

verbose

Logical, whether to print detailed output for debugging (default: FALSE).

eigen_threshold

Threshold for eigenvalues in eigen decomposition (default: 0.995).

cs_threshold, cs_r2

PIP and r2 thresholds credible set construction (default: cs_threshold=0.9, cs_r2=0.5)

nit

Number of iterations in the MCMC sampler (default: 5000).

nburn

Number of burn-in iterations (default: 500).

nthin

Thinning interval for MCMC (default: 5).

output

Level of output, options include "summary", "full".

method

The regression method to use, options include "blup", "bayesN", "bayesA", "bayesL", "bayesC", "bayesR".

algorithm

Algorithm for MCMC sampling, options include "mcmc", "em-mcmc", "mcmc-eigen".

seed

Random seed for reproducibility (default: 10).

Author

Peter Sørensen

Details

This function implements Bayesian linear regression models to provide unified mapping of genetic variants, estimate genetic parameters (e.g. heritability), and predict disease risk. It is designed to handle various genetic architectures and scale efficiently with large datasets.