Giter Club home page Giter Club logo

spinbayes's Introduction

spinBayes

Semi-parametric GxE Interaction via Bayesian Variable Selection

Travis build status CRAN Codecov test coverage CRAN RStudio mirror downloads

Many complex diseases are known to be affected by the interactions between genetic variants and environmental exposures beyond the main genetic and environmental effects. Existing Bayesian methods for gene-environment (G×E) interaction studies are challenged by the high-dimensional nature of the study and the complexity of environmental influences. We have developed a novel and powerful semi-parametric Bayesian variable selection method that can accommodate linear and nonlinear G×E interactions simultaneously (Ren et al. (2019)). Furthermore, the proposed method can conduct structural identification by distinguishing nonlinear interactions from main effects only case within Bayesian framework. Spike-and-slab priors are incorporated on both individual and group level to shrink coefficients corresponding to irrelevant main and interaction effects to zero exactly. The Markov chain Monte Carlo algorithms of the proposed and alternative methods are efficiently implemented in C++.

Features

  • BVCfit() integrates five different models for G×E Bayesian variable selection.
  • Generic functions BVSelection() and predict() make the workflow very simple (see ‘Examples’).
  • Highly efficient c++ implementation for MCMC algorithm.

How to install

  • To install from github, run these two lines of code in R
install.packages("devtools")
devtools::install_github("jrhub/spinBayes")
  • Released versions of spinBayes are available on CRAN , and can be installed within R via
install.packages("spinBayes")

Examples

Example.1 (default method)

library(spinBayes)
data(gExp.L)

test = sample((1:nrow(X2)), floor(nrow(X2)/5))
spbayes=BVCfit(X2[-test,], Y2[-test,], Z2[-test,], E2[-test,], clin2[-test,])
spbayes

selected = BVSelection(spbayes)
selected

pred = predict(spbayes, X2[test,], Z2[test,], E2[test,], clin2[test,], Y2[test,])
pred$pmse
# c(pred$y.pred)

## plot the varying effects
plot(spbayes)

Example.2 (non-structural)

data(gExp.L)

test = sample((1:nrow(X2)), floor(nrow(X2)/5))
spbayes=BVCfit(X2[-test,], Y2[-test,], Z2[-test,], E2[-test,], clin2[-test,], structural=FALSE)
spbayes

selected = BVSelection(spbayes)
selected

pred = predict(spbayes, X2[test,], Z2[test,], E2[test,], clin2[test,], Y2[test,])
pred$pmse
# c(pred$y.pred)

Example.3 (non-sparse)

data(gExp.L)

test = sample((1:nrow(X2)), floor(nrow(X2)/5))
spbayes=BVCfit(X2[-test,], Y2[-test,], Z2[-test,], E2[-test,], clin2[-test,], structural=TRUE, sparse=FALSE)
spbayes

selected = BVSelection(spbayes)
selected

pred = predict(spbayes, X2[test,], Z2[test,], E2[test,], clin2[test,], Y2[test,])
pred$pmse
# c(pred$y.pred)

Methods

This package provides implementation for methods proposed in

  • Ren, J., Zhou, F., Li, X., Chen, Q., Zhang, H., Ma, S., Jiang, Y., Wu, C. (2019) Semi-parametric Bayesian variable selection for gene-environment interactions. Statistics in Medicine 39: 617– 638. https://doi.org/10.1002/sim.8434

spinbayes's People

Contributors

jrhub avatar

Forkers

kunfa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.