WinBUGS – Parametric Bayesian hierarchical variable selection for gene-environment and gene-gene interactions

Posted on June 10, 2011

0



Although a whole new world of research has opened with the advent of rapid and relatively cheap genotyping technologies, including the opportunity to identify gene-environment and gene-gene (epistatic) interactions, this also created new problems caused by the enormous dimensionality of the parameter space.

A large number of methods have been developed that aim to address this. The WinBUGS script below describes a Bayesian mixture model with a variable selection prior which has been developed within a Cancer Research UK small research grant. The methodology has been described in detail in:

Wakefield J, de Vocht F, Hung RJ. Bayesian Mixture Modeling of Gene-Environment and Gene-Gene Interactions. Genetic Epidemiology 2010; 34: 16-25.

And the WinBUGS script can also be found in the Online Supplementary Material available with the above paper. The script below can also be used for JAGS and both programs can be called from within the R environment.

WinBUGS code
Below is the code for 1000 cases and 1000 controls, 20 SNPs and 2 exposures.

model {
for (i in 1 : 2000) {
y[i]~dbern(p[i])

# Logistic linear predictor
logit(p[i]) <- alpha + SNPmain1[i] + SNPmain2[i] + EXPmain[i] + INTER11[i] +
INTER12[i] + INTER21[i] + INTER22[i]
SNPmain1[i] <- beta[1]*X1[i] + beta[2]*X2[i] + beta[3]*X3[i] + beta[4]*X4[i] +
beta[5]*X5[i] + beta[6]*X6[i]+ beta[7]*X7[i] + beta[8]*X8[i] +
beta[9]*X9[i] +beta[10]*X10[i]
SNPmain2[i] <- beta[11]*X11[i] + beta[12]*X12[i] + beta[13]*X13[i] +
beta[14]*X14[i] + beta[15]*X15[i] + beta[16]*X16[i] +
beta[17]*X17[i] + beta[18]*X18[i] + beta[19]*X19[i] +
beta[20]*X20[i]
EXPmain[i]<- gamma[1]*X21[i] + gamma[2]*X22[i]
INTER11[i] <- delta[1,1]*X1[i]*X21[i] + delta[2,1]*X2[i]*X21[i] +
delta[3,1]*X3[i]*X21[i] + delta[4,1]*X4 [i]*X21[i] +
delta[5,1]*X5[i]*X21[i] + delta[6,1]*X6[i]*X21[i] +
delta[7,1]*X7[i]*X21[i] + delta[8,1]*X8[i]*X21[i] +
delta[9,1]*X9[i]*X21[i] + delta[10,1]*X10[i]*X21[i]
INTER12[i] <- delta[11,1]*X11[i]*X21[i] + delta[12,1]*X12[i]*X21[i] +
delta[13,1]*X13[i]*X21[i] + delta[14,1]*X14[i]*X21[i] +
delta[15,1]*X15[i]*X21[i] + delta[16,1]*X16[i]*X21[i] +
delta[17,1]*X17[i]*X21[i] + delta[18,1]*X18[i]*X21[i] +
delta[19,1]*X19[i]*X21[i] + delta[20,1]*X20[i]*X21[i]
INTER21[i] <- delta[1,2]*X1[i]*X22[i] + delta[2,2]*X2[i]*X22[i] +
delta[3,2]*X3[i]*X22[i] + delta[4,2]*X4 [i]*X22[i] +
delta[5,2]*X5[i]*X22[i] + delta[6,2]*X6[i]*X22[i] +
delta[7,2]*X7[i]*X22[i] + delta[8,2]*X8[i]*X22[i] +
delta[9,2]*X9[i]*X22[i] + delta[10,2]*X10[i]*X22[i]
INTER22[i] <- delta[11,2]*X11[i]*X22[i] + delta[12,2]*X12[i]*X22[i] +
delta[13,2]*X13[i]*X22[i] + delta[14,2]*X14[i]*X22[i] +
delta[15,2]*X15[i]*X22[i] + delta[16,2]*X16[i]*X22[i] +
delta[17,2]*X17[i]*X22[i] + delta[18,2]*X18[i]*X22[i] +
delta[19,2]*X19[i]*X22[i] + delta[20,2]*X20[i]*X22[i]
}
# Improper flat prior on the intercept
alpha~dflat()
# Priors for the SNP main effects
for (j in 1:20){
prec[j]<- 1/(T[j]*0.310+(1-T[j])*0.000145)
beta[j]~dnorm(0,prec[j])
T[j]~dbern(0.2)
}
# Priors for the exposures
for (k in 1:2){
prec2[k]<-1/(T2[k]*0.310+(1-T2[k])*0.000145)
gamma[k]~dnorm(0,prec2[k])
T2[k] <- 1
}
# Priors for the interactions
for (j in 1:20){
for (k in 1:2){
prec3[j,k]<-1/(T3[j,k]*0.310 + (1-T3[j,k])*0.000145)
delta[j,k]~dnorm(0,prec3[j,k])
T3[j,k] <- T[j]*T2[k]
}
}
}
#initial starting point 1
list(T=c(1,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),alpha=0,
beta=c(0.18,0.18,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
gamma=c(0.69,0.69),delta=structure(.Data=c(0,0,0,0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0),.Dim=c(20,2)))
#init starting point 2
list(T=c(0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),alpha=0,
beta=c(0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
gamma=c(0,0),delta=structure(.Data=c(0,0,0,0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0),.Dim=c(20,2)))

Advertisements