Assessing support for gene sets in disease using varbvs

In this vignette, we fit two variable selection models: the first ("null")
model has a uniform prior for all variables (the 442,001 genetic markers);
the second model has higher prior probability for genetic markers near
cytokine signaling genes. This analysis is intended to assess support for
enrichment of Crohn's disease risk factors near cytokine signaling genes;
a large Bayes factor means greater support for this enrichment hypothesis.
The data in this analysis consist of 442,001 SNPs genotyped for 1,748 cases
and 2,938 controls. Note that file cd.RData cannot be made publicly
available due to data sharing restrictions, so this script is for viewing
only.

knitr::opts_chunk$set(eval =FALSE,collapse =TRUE,comment ="#")

Begin by loading a couple packages into the R environment.

library(lattice)
library(varbvs)

Set the random number generator seed.

set.seed(1)

Load the genotypes, phenotypes and pathway annotation

load("cd.RData")
data(cytokine)

Fit variational approximation to posterior

Here we compute the variational approximation given the assumption that all
variables (genetic markers) are, a priori, equally likely to be included
in the model.

fit.null <- varbvs(X,NULL,y,"binomial",logodds =-4,n0 =0)

Next, compute the variational approximation given the assumption that
genetic markers near cytokine signaling genes are more likely to be
included in the model. For faster and more accurate computation of
posterior probabilities, the variational parameters are initialized to
the fitted values computed above with the exchangeable prior.