# NOT RUN {
# SNP dataset with 500 persons and 20 SNPs each,
# a two-SNP interaction influences the case probability
snp <- matrix(rbinom(500*20,2,0.3),ncol=20)
bin <- snp2bin(snp)
int <- apply(bin,1,function(x) (x[1] == 1 & x[3] == 0)*1)
case.prob <- exp(-0.5+log(5)*int)/(1+exp(-0.5+log(5)*int))
y <- rbinom(nrow(snp),1,prob=case.prob)
# normally more iterations should be used
fblr(y, bin, niter=1000, nburn=0)
analyse.models("fblr_mcmc.txt")
# Prior information: SNPs 1-10 belong to genes in one pathway,
# SNPs 8-20 to another. Only interactions within a pathway are
# considered and the first pathway is deemed to be twice as
# important than the second.
fblr.weight(y,bin,niter=1000, nburn=0, group=list(1:20, 15:40),
weight=c(rep(2,20),rep(1,20)))
analyse.models("fblr_mcmc.txt")
# }
Run the code above in your browser using DataLab