Title: | Bayesian Variable Selection for SNP Data using Normal-Gamma |
---|---|
Description: | Posterior distribution of case-control fine-mapping. Specifically, Bayesian variable selection for single-nucleotide polymorphism (SNP) data using the normal-gamma prior. Alenazi A.A., Cox A., Juarez M,. Lin W-Y. and Walters, K. (2019) Bayesian variable selection using partially observed categorical prior information in fine-mapping association studies, Genetic Epidemiology. <doi:10.1002/gepi.22213>. |
Authors: | Abdulaziz Alenazi [aut, cre] |
Maintainer: | Abdulaziz Alenazi <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.3.0 |
Built: | 2024-11-13 03:27:21 UTC |
Source: | https://github.com/cran/NGBVS |
The NGBVS package provides posterior distribution of case-control fine-mapping. Specifically Bayesian variable selection for Single-Nucleotide Polymorphism (SNP) data using the Normal-Gamma prior.
Package: | NG |
Type: | Package |
Version: | 0.3.0 |
Date: | 2022-09-112 |
License: | GPL-2 |
Abdulaziz Alenazi [email protected]
Abdulaziz Alenazi [email protected]
Modified Normal Gamma prior calculates the posterior distribution for the fine mapping cases-controls study. The number of case-controls must be greater than the number of SNPs.
asym_m_ng (y, data, FS, medstar = c(0.01, 0.0001), numb = 100, burnin = 1, every = 1)
asym_m_ng (y, data, FS, medstar = c(0.01, 0.0001), numb = 100, burnin = 1, every = 1)
y |
A vector of the pheontype, where takes 0s and 1s. |
data |
An |
FS |
FS scores for each SNP and it takes value from 0 and 1 or NA for missing FS. |
medstar |
The value of M where M takes two values. |
numb |
Number of samples for each SNP. |
burnin |
The amount of burn-in for the MCMC sample. |
every |
The amount of thining for the MCMC sample. |
A list including:
alpha |
A vector of the posterior distribution of the intercept. |
beta |
A matrix of the posterior distribution of the effect sizes. |
psi |
A matrix of the posterior distribution of |
lambda |
A vector of the posterior distribution of |
gammasq |
A vector of the posterior distribution of |
W |
A vector of the posterior distribution of |
H |
A vector of the posterior distribution of |
Abulaziz Alenazi.
R implementation and documentation: Abulaziz Alenazi [email protected].
set.seed(1) data <- matrix(sample( c( 0, 1, 2 ), 500 * 30, replace = TRUE, prob <- c( 0.35, 0.35, 0.3)), ncol = 30 ) FS <- sample( c( 0.1, 0.5, 0.7, NA ), ncol( data ), replace = TRUE) asym_m_ng(y = rbinom(500, 1, 0.5), data = data, FS = FS)
set.seed(1) data <- matrix(sample( c( 0, 1, 2 ), 500 * 30, replace = TRUE, prob <- c( 0.35, 0.35, 0.3)), ncol = 30 ) FS <- sample( c( 0.1, 0.5, 0.7, NA ), ncol( data ), replace = TRUE) asym_m_ng(y = rbinom(500, 1, 0.5), data = data, FS = FS)
Standard Normal Gammp prior calculates the posterior distribution for the fine mapping cases-controls study. The number of case-controls must be greater than the number of SNPs.
asym_s_ng(y, data, medstar = 1, numb = 100, burnin = 1, every = 1)
asym_s_ng(y, data, medstar = 1, numb = 100, burnin = 1, every = 1)
y |
A vector of the pheontype, where takes 0s and 1s. |
data |
An |
medstar |
The value of M. |
numb |
Number of samples for each SNP. |
burnin |
The amount of burn-in for the MCMC sample. |
every |
The amount of thining for the MCMC sample. |
A list including:
alpha |
A vector of the posterior distribution of the intercept. |
beta |
A matrix of the posterior distribution of the effect sizes. |
psi |
A matrix of the posterior distribution of |
lambda |
A vector of the posterior distribution of |
gammasq |
A vector of the posterior distribution of |
Abulaziz Alenazi.
R implementation and documentation: Abulaziz Alenazi [email protected].
set.seed( 1 ) data <- matrix(sample( c( 0, 1, 2 ), 500 * 30, replace = TRUE, prob = c( 0.35, 0.35, 0.3)), ncol = 30) asym_s_ng(y = rbinom(500, 1, 0.5), data = data)
set.seed( 1 ) data <- matrix(sample( c( 0, 1, 2 ), 500 * 30, replace = TRUE, prob = c( 0.35, 0.35, 0.3)), ncol = 30) asym_s_ng(y = rbinom(500, 1, 0.5), data = data)
Modified Normal Gammp prior calculates the posterior distribution for the fine mapping study. The number of individuals must be greater than the number of SNPs.
m_ng (y, data, FS, medstar = c(0.01, 0.0001), numb = 100, burnin = 1, every = 1)
m_ng (y, data, FS, medstar = c(0.01, 0.0001), numb = 100, burnin = 1, every = 1)
y |
A vector of the pheontype. |
data |
An |
FS |
FS scores for each SNP and it takes value from 0 and 1 or NA for missing FS. |
medstar |
The value of M where M takes two values. |
numb |
Number of samples for each SNP. |
burnin |
The amount of burn-in for the MCMC sample. |
every |
The amount of thining for the MCMC sample. |
A list including:
alpha |
A vector of the posterior distribution of the intercept. |
beta |
A matrix of the posterior distribution of the effect sizes. |
sigmasq |
A vector of the posterior distribution of |
psi |
A matrix of the posterior distribution of |
lambda |
A vector of the posterior distribution of |
gammasq |
A vector of the posterior distribution of |
W |
A vector of the posterior distribution of |
H |
A vector of the posterior distribution of |
Abulaziz Alenazi.
R implementation and documentation: Abulaziz Alenazi [email protected].
set.seed( 1 ) data <- matrix(rnorm(500 * 30), ncol = 30) FS <- sample( c( 0.1, 0.5, 0.7, NA ), ncol( data ), replace = TRUE) m_ng(y = rnorm( 500 ), data = data, FS = FS)
set.seed( 1 ) data <- matrix(rnorm(500 * 30), ncol = 30) FS <- sample( c( 0.1, 0.5, 0.7, NA ), ncol( data ), replace = TRUE) m_ng(y = rnorm( 500 ), data = data, FS = FS)
Random value generation from the Generalized Inverse Gaussian (GIG) Distribution.
rgig(n = 10, lambda = 1, chi = 1, psi = 1)
rgig(n = 10, lambda = 1, chi = 1, psi = 1)
n |
Number of observations. |
lambda |
A shape and scale and parameter. |
chi |
Shape parameter. Must be positive. |
psi |
Scale parameter. Must be positive. |
rgig
uses the code from the GIG-random number generator from
the R package fBasics. I copied the code from the "ghyp" package
because it had not longer a maintainer.
A vector with random values from the GIG distrigution.
David Luethi. Minor changes made by Abdulaziz Alenazi [email protected].
The algorithm for simulating generalized inverse gaussian variates is copied from the R package fBasics from Diethelm Wuertz.
Dagpunar, J.S. (1989). An easily implemented generalised inverse Gaussian generator. Communications in Statistics-Computation and Simulation, 18, 703–710.
Raible S. (2000). Levy Processes in Finance: Theory, Numerics and Empirical Facts, PhD Thesis, University of Freiburg, Germany, 161 pages.
x <- rgig(n = 10, lambda = 1, chi = 1, psi = 1)
x <- rgig(n = 10, lambda = 1, chi = 1, psi = 1)
Standard Normal Gammp prior calculates the posterior distribution for the fine mapping study. The number of individuals must be greater than the number of SNPs.
s_ng(y, data, medstar = 1, numb = 100, burnin = 1, every = 1)
s_ng(y, data, medstar = 1, numb = 100, burnin = 1, every = 1)
y |
A vector of the pheontype. |
data |
An |
medstar |
The value of M. |
numb |
Number of samples for each SNP. |
burnin |
The amount of burn-in for the MCMC sample. |
every |
The amount of thining for the MCMC sample. |
A list including:
alpha |
A vector of the posterior distribution of the intercept. |
beta |
A matrix of the posterior distribution of the effect sizes. |
sigmasq |
A vector of the posterior distribution of |
psi |
A matrix of the posterior distribution of |
lambda |
A vector of the posterior distribution of |
gammasq |
A vector of the posterior distribution of |
Abulaziz Alenazi.
R implementation and documentation: Abulaziz Alenazi [email protected].
set.seed(1) data <- matrix( rnorm(500 * 30), ncol = 30) s_ng(y = rnorm(500), data = data)
set.seed(1) data <- matrix( rnorm(500 * 30), ncol = 30) s_ng(y = rnorm(500), data = data)